Supplement of the information of the information module for the process - improved permissions

xiaoxiao2021-03-06  68

In the article "Obtaining Information of Process Module", since I don't know how to improve permissions, I can't get more information about the system process. I saw a piece of code today, so that I am bright in front of my eyes, don't say nonsense, the code is as follows:

BOOL enabledebugprivilege ()

{

Handle htokeen;

BOOL fok = false;

IF (GetProcessToken (GetCurrentProcess (), Token_Adjust_Privileges, & HToken)

{

Token_Privileges TP;

Tp.privilegectount = 1;

IF (! Lookupprivilerage (NULL, SE_DEBUG_NAME, & TP.PRIVILEGES [0] .luid))

Printf ("can't lookup privilege value);

TP.Privileges [0] .attributes = se_privilege_enabled;

IF (! AdjustTokenPrivileges (HToken, False, & TP, Sizeof (TP), NULL, NULL)

Printf ("Can't Adjust Privilege Value./N");

Fok = (GetLastError () == Error_Success);

CloseHandle (HTOKEN);

}

Return fok;

}

Add this function in the program, you can get more information about the system process!

转载请注明原文地址:https://www.9cbs.com/read-91307.html

New Post(0)