Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <windows.h>
- #include <Tlhelp32.h>
- void killprocess(const char* filename)
- {
- HANDLE hSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPALL, 0);
- PROCESSENTRY32 pEntry;
- pEntry.dwSize = sizeof (pEntry);
- BOOL hRes = Process32First(hSnapShot, &pEntry);
- while (hRes)
- {
- if (strcmp(pEntry.szExeFile, filename) == 0)
- {
- HANDLE hProcess = OpenProcess(PROCESS_TERMINATE, 0, (DWORD) pEntry.th32ProcessID);
- if (hProcess != NULL)
- {
- TerminateProcess(hProcess, 0);
- CloseHandle(hProcess);
- }
- }
- hRes = Process32Next(hSnapShot, &pEntry);
- }
- CloseHandle(hSnapShot);
- }
- int main()
- {
- /* Accounts configuration */
- const BYTE quantity = 5;
- const char* account[quantity] = {"xvolian0",
- "xvolian1",
- "xvolian2",
- "xvolian3",
- "xvolian4"
- };
- BYTE current = quantity;
- HKEY key;
- RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\Valve\\Steam", 0, KEY_ALL_ACCESS, &key);
- while (true)
- {
- for (BYTE i = 0; i<quantity; i++)
- {
- /* Numeric keypad */
- if (GetAsyncKeyState(0x60+i) && i != current)
- {
- killprocess("csgo.exe");
- killprocess("Steam.exe");
- RegSetValueEx(key, "AutoLoginUser", 0, REG_SZ, (LPBYTE)account[i], strlen(account[i]));
- ShellExecute(0, 0, "steam://rungameid/730", 0, 0, SW_SHOWNORMAL);
- current = i;
- }
- }
- Sleep(125);
- /* END key */
- if (GetAsyncKeyState(0x23)) break;
- }
- RegCloseKey(key);
- MessageBox(NULL,"The program has been closed.","Manager",MB_ICONINFORMATION);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement