-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
I believe the below should be part of your code since it requires SeDebugPrivilege:
BOOL Inject_SetDebugPrivilege
(
)
{
BOOL bRet = FALSE;
HANDLE hToken = NULL;
LUID luid = { 0 };
if (OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &hToken))
{
if (LookupPrivilegeValue(NULL, SE_DEBUG_NAME, &luid))
{
TOKEN_PRIVILEGES tokenPriv = { 0 };
tokenPriv.PrivilegeCount = 1;
tokenPriv.Privileges[0].Luid = luid;
tokenPriv.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
bRet = AdjustTokenPrivileges(hToken, FALSE, &tokenPriv, sizeof(TOKEN_PRIVILEGES), NULL, NULL);
}
}
return bRet;
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels