Hey guys, I'm gonna make a joke on the teacher of mine . I'm gonna send her an E-mail with a exe file, which has to have ICON of Microsoft power point, and it's function is to mess up the mouse cursor, so she won't be able to use that mouse, and i need that program to add itself to the registry (or somewhere else) to make it run at startup. And I have already made Cursor messing up code, but i'm having problems with that adding it to the registry. I need Ur HELP !!! BTW. I also don't know how to add an ICON to that program. And I Use C++ Here is the code of mine ( to mess up the mouse cursor): Code: #include <windows.h> #include <ctime> int rnd(int, int); int main() { srand((unsigned)time(0)); // seed random /* I have added some explanation for U aneesh :D */ /* Get the screen resolution */ int SCR_WIDTH = GetSystemMetrics(SM_CXSCREEN) - 1; int SCR_HEIGHT = GetSystemMetrics(SM_CYSCREEN) - 1; int xspeed, yspeed; int x = SCR_WIDTH / 2, y = SCR_HEIGHT /2; // start in middle of screen for(int g = 0; g < 100; g++) { // do program 100 times and then quit /* random x and y speed between -10 and 10 minus x will make it go left, plus x right minus y up and plus y down */ xspeed = rnd(-10, 10); yspeed = rnd(-10, 10); for(int i = 0; i < 10; i++) { x += xspeed; y += yspeed; SetCursorPos(x, y); /* Check for hitting the side of screen */ if(x >= SCR_WIDTH) { xspeed = -xspeed; // convert plus to minus or minus to plus } else if(x <= 0) { xspeed = -xspeed; } else if(y >= SCR_HEIGHT) { yspeed = -yspeed; } else if(y <= 0) { yspeed = -yspeed; } Sleep(10); } } return 0; } int rnd(int min, int max) { return rand() % (max - min) + min; }
The help that you need is not for malware. To have anything run at startup you need to make entries in Registry at [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run]
Yeah, I know that I have to make registry entry, but I expected someone will tell me how to I mean, i want that program to add itself to that registry when I run it (BTW. It's for scientific purposes ) And I have in registry folders - [Run, Run-, RunOnce], so which do I have to choose?
But the fact remains the OP did tell us what his program is to do. And by telling him anything you will helping in the manufacture of malware. Shouldn't you as an administrator of this web site try to prevent this? Shouldn't you be at least closing this thread, if not taking actions against the OP, to send a message that this site does not condone malware of any kind? Jim
See this. http://www.pctools.com/guides/registry/detail/109/ What I am explaining is pretty much what is in that article. Use of that can be done in either way.
Thx Shabbir, I regard highly your help, but I know everything about simply regystry, but I need to understand EDITING REGISTRY in C++, E.g Use RegOpenKeyEx(), RegGetValue(), RegSetKeyValue(), RegCloseKey() etc.
I would be very delighted if U would suggest me some good site or explain it by yourself ( or anybody else).