Function at 0x401690
Capabilities:
Get token privileges

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
mov eax, dword [0x406004]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
lea eax, [ebp - 0x28]
mov dword [ebp - 0x28], 0xffffffff
push eax
xor edi, edi
xor ebx, ebx
push 0x28
mov dword [ebp - 0x24], edi
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
mov esi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
test eax, eax
jne 0x4016e7
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenProcessToken___failed._Error:__d_n
call fcn.004010c0
add esp, 8
jmp 0x401821
lea eax, [ebp - 0x24]
push eax
push dword [ebp - 0x24]
push 0
push 3
push dword [ebp - 0x28]
call dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x401721
call esi
cmp eax, 0x7a
je 0x401721
call esi
push eax
push str.GetTokenInformation___failed._Error:__d_n
call fcn.004010c0
add esp, 8
jmp 0x40181b
push dword [ebp - 0x24]
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov ebx, eax
add esp, 4
test ebx, ebx
je 0x40181b
lea eax, [ebp - 0x24]
push eax
push dword [ebp - 0x24]
push ebx
push 3
push dword [ebp - 0x28]
call dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
test eax, eax
je 0x40170c
mov dword [ebp - 0x30], edi
cmp dword [ebx], edi
jbe 0x40181b
lea edi, [ebx + 4]
nop dword [eax]
mov eax, dword [edi + 8]
movq xmm0, qword [edi]
mov dword [ebp - 8], eax
lea eax, [ebp - 0x2c]
push eax
push 0
lea eax, [ebp - 0x10]
movq qword [ebp - 0x10], xmm0
push eax
push 0
mov dword [ebp - 0x2c], 0
call dword [sym.imp.ADVAPI32.dll_LookupPrivilegeNameW]
test eax, eax
jne 0x401793
call esi
cmp eax, 0x7a
jne 0x401809
mov eax, dword [ebp - 0x2c]
xor ecx, ecx
inc eax
mov edx, 2
mov dword [ebp - 0x2c], eax
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov esi, eax
add esp, 4
test esi, esi
je 0x401819
lea eax, [ebp - 0x2c]
push eax
push esi
lea eax, [ebp - 0x10]
push eax
push 0
call dword [sym.imp.ADVAPI32.dll_LookupPrivilegeNameW]
test eax, eax
je 0x4018a4
push str.SeImpersonatePrivilege
push esi
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__wcsicmp]
add esp, 8
test eax, eax
je 0x40184c
push esi
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov esi, dword [ebp - 0x30]
add esp, 4
inc esi
add edi, 0xc
mov dword [ebp - 0x30], esi
cmp esi, dword [ebx]
jae 0x401819
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x401760
call esi
push eax
push str.LookupPrivilegeName___failed._Error:__d_n
call fcn.004010c0
add esp, 8
xor edi, edi
mov esi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov eax, dword [ebp - 0x28]
test eax, eax
je 0x40182f
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test ebx, ebx
je 0x401839
push ebx
call esi
add esp, 4
mov ecx, dword [ebp - 4]
mov eax, edi
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00401e33
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp - 0xc]
push 0
push 0
push 0x10
mov dword [ebp - 0x1c], eax
lea eax, [ebp - 0x20]
push eax
push 0
push dword [ebp - 0x28]
mov dword [ebp - 0x20], 1
mov dword [ebp - 0x18], ecx
mov dword [ebp - 0x14], 2
call dword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
test eax, eax
je 0x401892
push esi
mov esi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov edi, 1
call esi
add esp, 4
jmp 0x401821
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
push eax
push str.AdjustTokenPrivileges___failed._Error:__d_n
jmp 0x401811
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
jmp 0x40180b