Hey guys In my previous post i teach you all clear and step by step guidance on how to compile any c/c++ program and this time i am going to show how you can disable all usb port of your PC by making a virus using c language.C is my favorite programming language to create this type of virus. Here i provide you simple c source code which helps you to done your work.Anyone with a basic knowledge of C language should be able to understand the working of this virus program.
For your clear understanding i want to give idea about how the source code work ,In this tutorial you just need to compile & execute the c source code and once you execute successfully you get a .exe file which is your application which responsible for disables or block all usb ports of your laptops. As a result you'll will not be able to use your pen drive or any other USB peripheral devices on the computer.
Now start today's post which is overall how we can make virus using c source code follow below step by step procedure .
How To Disables USB Ports
Step:1) first of all you need the .c source code simply open notepad and copy below code as it is and past it in notepad and save it with the name disable_usb.c (remember .c extension must include)
#include<stdio.h>Step:2) when you make disable_usb.c file you need to compile it, if you don't know how to compile then read my previous article step by step guidence to compile any c program .
system("reg add HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\USBSTOR \/v Start \/t REG_DWORD \/d 4 \/f");
Step:3) Now friends i assuming that Upon compilation of disable_usb.c you get disable_usb.exe
Step:4) after that for block all usb port simply right click on disable_usb.exe file and click on run as administrator mode .
Step:5) that's it guys you have done! Now you can see that your pen drive will never get detected when you insert it on your PC.
How To Re-Enable All USB Port
If you think how can i unblock all usb port after blocking ?don't worry cool buddy here i provide you second c source code which unblock usb port .follow below steps and re-enable your usb ports.
Step:1) first of all open notepad and copy below code as it is and past it in notepad and save it with the name unblock_usb.c (remember .c extension must be include)
#include<stdio.h>Step:2) compile this unblock_usb.c file and get unblock_usb.exe file
system("reg add HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\USBSTOR \/v Start \/t REG_DWORD \/d 3 \/f");
Step:3) right click on unblock_usb.exe and click on run as administrator mode
That's it friends .
I hope you like this post. Please pass your comments if you faced any problem I am always here for solve your problem.