Function at 0x180036930
Capabilities:
Get token privileges

Disassembly:
sub rsp, 0x68
movzx eax, byte [0x1800a4f31]
test eax, eax
je 0x180036944
jmp 0x180036b80
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
lea r8, [rsp + 0x40]
mov edx, 0x28
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x180036b79
lea rax, [rsp + 0x34]
mov qword [rsp + 0x20], rax
xor r9d, r9d
xor r8d, r8d
mov edx, 3
mov rcx, qword [rsp + 0x40]
call qword [sym.imp.ADVAPI32.dll_GetTokenInformation]
cmp dword [rsp + 0x34], 0
je 0x180036b6e
mov eax, dword [rsp + 0x34]
shl eax, 1
mov eax, eax
mov edx, eax
mov ecx, 0x40
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov qword [rsp + 0x38], rax
mov eax, dword [rsp + 0x34]
shl eax, 1
lea rcx, [rsp + 0x34]
mov qword [rsp + 0x20], rcx
mov r9d, eax
mov r8, qword [rsp + 0x38]
mov edx, 3
mov rcx, qword [rsp + 0x40]
call qword [sym.imp.ADVAPI32.dll_GetTokenInformation]
test eax, eax
je 0x180036b62
lea r8, [rsp + 0x48]
lea rdx, [0x18007ae10]
xor ecx, ecx
call qword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueW]
test eax, eax
jne 0x180036a02
mov dword [rsp + 0x4c], 0
mov dword [rsp + 0x48], 0
lea r8, [rsp + 0x50]
lea rdx, str.SeRestorePrivilege
xor ecx, ecx
call qword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueW]
test eax, eax
jne 0x180036a2a
mov dword [rsp + 0x54], 0
mov dword [rsp + 0x50], 0
lea r8, [rsp + 0x58]
lea rdx, str.SeTakeOwnershipPrivilege
xor ecx, ecx
call qword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueW]
test eax, eax
jne 0x180036a52
mov dword [rsp + 0x5c], 0
mov dword [rsp + 0x58], 0
mov dword [rsp + 0x30], 0
jmp 0x180036a66
mov eax, dword [rsp + 0x30]
inc eax
mov dword [rsp + 0x30], eax
mov rax, qword [rsp + 0x38]
mov eax, dword [rax]
dec eax
cmp dword [rsp + 0x30], eax
jge 0x180036b39
movsxd rax, dword [rsp + 0x30]
imul rax, rax, 0xc
mov rcx, qword [rsp + 0x38]
mov edx, dword [rsp + 0x4c]
cmp dword [rcx + rax + 8], edx
jne 0x180036aad
movsxd rax, dword [rsp + 0x30]
imul rax, rax, 0xc
mov rcx, qword [rsp + 0x38]
mov edx, dword [rsp + 0x48]
cmp dword [rcx + rax + 4], edx
je 0x180036b34
movsxd rax, dword [rsp + 0x30]
imul rax, rax, 0xc
mov rcx, qword [rsp + 0x38]
mov edx, dword [rsp + 0x54]
cmp dword [rcx + rax + 8], edx
jne 0x180036add
movsxd rax, dword [rsp + 0x30]
imul rax, rax, 0xc
mov rcx, qword [rsp + 0x38]
mov edx, dword [rsp + 0x50]
cmp dword [rcx + rax + 4], edx
je 0x180036b34
movsxd rax, dword [rsp + 0x30]
imul rax, rax, 0xc
mov rcx, qword [rsp + 0x38]
mov edx, dword [rsp + 0x5c]
cmp dword [rcx + rax + 8], edx
jne 0x180036b0d
movsxd rax, dword [rsp + 0x30]
imul rax, rax, 0xc
mov rcx, qword [rsp + 0x38]
mov edx, dword [rsp + 0x58]
cmp dword [rcx + rax + 4], edx
je 0x180036b34
movsxd rax, dword [rsp + 0x30]
imul rax, rax, 0xc
mov rcx, qword [rsp + 0x38]
mov eax, dword [rcx + rax + 0xc]
or eax, 2
movsxd rcx, dword [rsp + 0x30]
imul rcx, rcx, 0xc
mov rdx, qword [rsp + 0x38]
mov dword [rdx + rcx + 0xc], eax
jmp 0x180036a5c
mov qword [rsp + 0x28], 0
mov qword [rsp + 0x20], 0
mov r9d, dword [rsp + 0x34]
mov r8, qword [rsp + 0x38]
xor edx, edx
mov rcx, qword [rsp + 0x40]
call qword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
mov rcx, qword [rsp + 0x38]
call qword [sym.imp.KERNEL32.dll_LocalFree]
nop
mov rcx, qword [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov byte [0x1800a4f31], 1
add rsp, 0x68
ret