Home > OS >  API HOOK OpenProcess start task manager didn't call OpenProcess?
API HOOK OpenProcess start task manager didn't call OpenProcess?

Time:09-20

Do process protection, don't let the task manager terminates my process, using the API HOOK OpenProcess, write the DLL, and loads the DLL, start the task manager to terminate process did not call OpenProcess, test code directly call OpenProcess can jump to the MyOpenProcess I wrote, is not the task manager terminates process call OpenProcess? Impossible, refer to the information online is a hook OpenProcess, consult everybody this do? The following is my test code:
 int _tmain (int arg c, _TCHAR * argv []) 
{
The OpenProcess (PROCESS_ALL_ACCESS, FALSE, GetProcessIDByName (" HAss. Exe "));
//load the DLL and the HOOK API
HMODULE hDll=: : LoadLibraryA (" InlineHookApi_Test. DLL ");
If (NULL==hDll)
{
Printf (" Load Library Error. \ n ");
}
Printf (" Load Library OK. \ n ");

The OpenProcess (PROCESS_ALL_ACCESS, FALSE, GetProcessIDByName (" HAss. Exe "));//test to jump to the MyOpenProcess I wrote
system("pause");
return 0;
}

CodePudding user response:

Everybody, help solve, thank you

CodePudding user response:

Task manager end process there are many kinds of methods, in addition to the terminateprocess, can also be sendmessage WM_CLOSE. Or enable the CMD taskkill. You can have a try,
  • Related