Skip to content

Commit 9acca56

Browse files
committed
Privilege view
1 parent 3e02bb0 commit 9acca56

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/dbg/debugger.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ char szSymbolCachePath[MAX_PATH] = "";
5353
char sqlitedb[deflen] = "";
5454
PROCESS_INFORMATION* fdProcessInfo = &g_pi;
5555
HANDLE hActiveThread;
56+
HANDLE hProcessToken;
5657
bool bUndecorateSymbolNames = true;
5758
bool bEnableSourceDebugging = true;
5859

@@ -1860,6 +1861,9 @@ static void debugLoopFunction(void* lpParameter, bool attach)
18601861
//set script variables
18611862
varset("$hp", (duint)fdProcessInfo->hProcess, true);
18621863
varset("$pid", fdProcessInfo->dwProcessId, true);
1864+
1865+
if (!OpenProcessToken(fdProcessInfo->hProcess, TOKEN_ALL_ACCESS, &hProcessToken))
1866+
hProcessToken = 0;
18631867
}
18641868

18651869
//set custom handlers
@@ -1933,6 +1937,8 @@ static void debugLoopFunction(void* lpParameter, bool attach)
19331937
dputs("Debugging stopped!");
19341938
varset("$hp", (duint)0, true);
19351939
varset("$pid", (duint)0, true);
1940+
if(hProcessToken)
1941+
CloseHandle(hProcessToken);
19361942
unlock(WAITID_STOP); //we are done
19371943
pDebuggedEntry = 0;
19381944
pDebuggedBase = 0;

0 commit comments

Comments
 (0)