| 344 | return FALSE; |
| 345 | } |
| 346 | BOOL EnabledDebugPrivilege() |
| 347 | { |
| 348 | BOOL result = FALSE; |
| 349 | |
| 350 | HANDLE process = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, GetCurrentProcessId()); |
| 351 | if (process) |
| 352 | { |
| 353 | HANDLE token; |
| 354 | if (OpenProcessToken(process, TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &token)) |
| 355 | { |
| 356 | LUID luid; |
| 357 | if (LookupPrivilegeValueW(NULL, L"SeDebugPrivilege", &luid)) |
| 358 | { |
| 359 | TOKEN_PRIVILEGES tokenPrivileges; |
| 360 | tokenPrivileges.PrivilegeCount = 1; |
| 361 | tokenPrivileges.Privileges[0].Luid = luid; |
| 362 | tokenPrivileges.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; |
| 363 | |
| 364 | if (AdjustTokenPrivileges(token, FALSE, &tokenPrivileges, sizeof(TOKEN_PRIVILEGES), NULL, NULL)) |
| 365 | { |
| 366 | result = GetLastError() != ERROR_NOT_ALL_ASSIGNED; |
| 367 | } |
| 368 | } |
| 369 | } |
| 370 | |
| 371 | CloseHandle(process); |
| 372 | } |
| 373 | |
| 374 | return result; |
| 375 | } |
| 376 | BOOL GetResource(DWORD resourceID, PCSTR type, LPBYTE *data, LPDWORD size) |
| 377 | { |
| 378 | HRSRC resource = FindResourceA(NULL, MAKEINTRESOURCEA(resourceID), type); |
no outgoing calls
no test coverage detected