Ładny brzuch
Witam. Jak w temacie ma kto moe kod w C++ ktrrym mona zabi systemowy process ? Znalazem kilka w internecie jak ten:
bool SetDebugPrivileges() { DWORD dwPID; HANDLE hProcess; HANDLE hToken; LUID Luid; TOKEN_PRIVILEGES tpDebug; dwPID = GetCurrentProcessId(); if ((hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, dwPID)) == 0) return false; if (OpenProcessToken(hProcess, TOKEN_ALL_ACCESS, &hToken) == 0) return false; if ((LookupPrivilegeValue(0, SE_DEBUG_NAME, &Luid)) == 0) return false; tpDebug.PrivilegeCount = 1; tpDebug.Privileges[0].Luid = Luid; tpDebug.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; if ((AdjustTokenPrivileges(hToken, FALSE, &tpDebug, sizeof(tpDebug), NULL, NULL)) == 0) return false; if (GetLastError() != ERROR_SUCCESS) return false; CloseHandle(hToken); CloseHandle(hProcess); return true; }
Jednak niestety kod nie dziaa poprawnie ? Mam winXP SP2, nie wiem czy to nie wina systemu cho wtpie. Jeeli komu by si chciao to moe sprawdzi u siebie na kompie czy dziaa. Z gory thx.
zanotowane.pl doc.pisz.pl pdf.pisz.pl zsf.htw.pl
bool SetDebugPrivileges() { DWORD dwPID; HANDLE hProcess; HANDLE hToken; LUID Luid; TOKEN_PRIVILEGES tpDebug; dwPID = GetCurrentProcessId(); if ((hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, dwPID)) == 0) return false; if (OpenProcessToken(hProcess, TOKEN_ALL_ACCESS, &hToken) == 0) return false; if ((LookupPrivilegeValue(0, SE_DEBUG_NAME, &Luid)) == 0) return false; tpDebug.PrivilegeCount = 1; tpDebug.Privileges[0].Luid = Luid; tpDebug.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; if ((AdjustTokenPrivileges(hToken, FALSE, &tpDebug, sizeof(tpDebug), NULL, NULL)) == 0) return false; if (GetLastError() != ERROR_SUCCESS) return false; CloseHandle(hToken); CloseHandle(hProcess); return true; }
Jednak niestety kod nie dziaa poprawnie ? Mam winXP SP2, nie wiem czy to nie wina systemu cho wtpie. Jeeli komu by si chciao to moe sprawdzi u siebie na kompie czy dziaa. Z gory thx.