Make The Program Run At Startup - need help - C++

Scripting's Avatar, Join Date: Jun 2010
John Hoder
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;
}

Last edited by Scripting; 16Feb2011 at 19:13..
0
jimblumberg's Avatar
Ambitious contributor
You really don't expect help on Malware do you?

Jim
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
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\Curr entVersion\Run]
Scripting like this
0
Scripting's Avatar, Join Date: Jun 2010
John Hoder
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?

Last edited by Scripting; 17Feb2011 at 02:02..
0
jimblumberg's Avatar
Ambitious contributor
[quote=shabbir;79423]The help that you need is not for malware. To have anything run at startup you need to make entries in Registry at

Quote:
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.
If this description is not malware then what is?

Jim
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
[QUOTE=jimblumberg;79449]
Quote:
Originally Posted by shabbir View Post
The help that you need is not for malware. To have anything run at startup you need to make entries in Registry at



If this description is not malware then what is?

Jim
What I meant is Putting anything in startup is not malware. He was generous to tell what his exe does but if you don't know then it can be any application running in background.
Scripting like this
0
jimblumberg's Avatar
Ambitious contributor
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
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
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.
Scripting like this
0
Scripting's Avatar, Join Date: Jun 2010
John Hoder
Quote:
Originally Posted by shabbir View Post
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.
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Yes those functions can help
Scripting like this