EG Information
Training Missions
Knowledge Bank
|
|
Enigma Group's Code Bank
Self Deleting executable codeBy: Evil1 - Date Submitted: 2008-05-23 07:50:44 #include <windows.h> #include <shlobj.h> BOOL SelfDelete() { SHELLEXECUTEINFO sei; TCHAR szModule [MAX_PATH], szComspec[MAX_PATH], szParams [MAX_PATH]; // get file path names: if((GetModuleFileName(0,szModule,MAX_PATH)!=0) && (GetShortPathName(szModule,szModule,MAX_PATH)!=0) && (GetEnvironmentVariable("COMSPEC",szComspec,MAX_PATH)!=0)) { // set command shell parameters lstrcpy(szParams,"/c del "); lstrcat(szParams, szModule); lstrcat(szParams, " > nul"); // set struct members sei.cbSize = sizeof(sei); sei.hwnd = 0; sei.lpVerb = "Open"; sei.lpFile = szComspec; sei.lpParameters = szParams; sei.lpDirectory = 0; sei.nShow = SW_HIDE; sei.fMask = SEE_MASK_NOCLOSEPROCESS; // increase resource allocation to program SetPriorityClass(GetCurrentProcess(), REALTIME_PRIORITY_CLASS); SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL); // invoke command shell if(ShellExecuteEx(&sei)) { // suppress command shell process until program exits SetPriorityClass(sei.hProcess,IDLE_PRIORITY_CLASS); SetProcessPriorityBoost(sei.hProcess,TRUE); // notify explorer shell of deletion SHChangeNotify(SHCNE_DELETE,SHCNF_PATH,szModule,0); // dur, take this out return TRUE; } else // if error, normalize allocation { SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS); SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_NORMAL); } } return FALSE; }
|
| Return to
c category list |
|
|
Who's Online
483 Guests, 101 Users Ios, ckryptix, viper0i0, Diznablo, rabbidmind, asapong, Nasrudin, CollapsingWalls, mehtaparag, bitstrike, jnony, C, Nicid1, Nusquam-Redono-Sapientia, bazcrown, saifulfaizan, The End, Ultraminor, psychomarine, st3alth, themastersinner, pgmrlink, login, lionaneesh, ishkur88, mahraja, Mac, chekifr, gandalf88, Vap0r, t0ast, tantrum6226, BnE, Distorted, Psiber_Syn, Ausome1, invas10n, oldgoat, freedaysbecumei, BinaryShinigami, Rex_Mundi, Red_beard, Strobeflux, s0m3nak3dguy, Descent, teehee, machupicchu, Genetix, Anandarl, NotMyOwn, thegamerdude, Godzila, popo12341234, RedEvolution, velocity_b, myne17, teto111, aVoid, Central-Gsm, 1101, JackalReborn, InjectioN, h4lted, c0re, DisPater, markt4death, splatta, Jackowacko, saint556, Pyron2312, Azerion, howsens, white.hat.gone.bad, vazzilly, pwunkz, Inverted, QuarterCask, Infernoe11, deskata, cr4ck3rj4ck, Blizer, jasonmax, j0sh, gwenwavor, N4g4c3N, spizeyboy, Network X, Uino59, Jae Cee, ianFDK, saykov, medhaavee, zofy, demonkiller410, Stumble, SaMTHG, kishore, Raze, helasraizam, Venom1019, Jakabo |
| |
|
|
|
|
|