Function at 0x4022a5
Capabilities:
Impersonate user

Disassembly:
push ebp
mov ebp, esp
push esi
push ebx
sub esp, 0x40
mov dword [ebp - 0xc], 0
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x24]
test eax, eax
je 0x40237f
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x24]
lea edx, [ebp - 0x20]
mov dword [esp + 4], edx
mov dword [esp], eax
call fcn.00402200
test eax, eax
jne 0x4022f5
mov eax, dword [ebp + 8]
mov eax, dword [eax]
mov dword [esp + 4], str.error_Incorrect_runas_credentials_n
mov dword [esp], eax
call fcn.00401e5c
jmp 0x40252c
mov eax, dword [ebp + 8]
lea ebx, [eax + 0x14]
mov ecx, dword [ebp - 0x18]
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x20]
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 2
mov dword [esp + 8], ecx
mov dword [esp + 4], edx
mov dword [esp], eax
mov eax, dword [sym.imp.ADVAPI32.dll_LogonUserA]
call eax
sub esp, 0x18
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jne 0x402372
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
mov esi, eax
mov ebx, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x20]
mov eax, dword [ebp + 8]
mov eax, dword [eax]
mov dword [esp + 0x14], esi
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], ecx
mov dword [esp + 8], edx
mov dword [esp + 4], str.error_Cannot_LogonUser__s__s__s___d_n
mov dword [esp], eax
call fcn.00401e5c
jmp 0x40252c
mov dword [ebp - 0xc], 1
nop
jmp 0x40252c
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x1c]
test eax, eax
je 0x4023dd
mov eax, dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
call eax
mov edx, eax
lea eax, [ebp - 0x14]
mov dword [esp + 8], eax
mov dword [esp + 4], 0xf01ff
mov dword [esp], edx
mov eax, dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
call eax
sub esp, 0xc
test eax, eax
jne 0x402471
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
mov edx, eax
mov eax, dword [ebp + 8]
mov eax, dword [eax]
mov dword [esp + 8], edx
mov dword [esp + 4], str.error_Cannot_OpenProcessToken__d_n
mov dword [esp], eax
call fcn.00401e5c
jmp 0x40252c
mov eax, dword [ebp + 8]
mov eax, dword [eax]
mov eax, dword [eax]
mov dword [esp], eax
mov eax, dword [sym.imp.ADVAPI32.dll_ImpersonateNamedPipeClient]
call eax
sub esp, 4
test eax, eax
jne 0x40241c
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
mov edx, eax
mov eax, dword [ebp + 8]
mov eax, dword [eax]
mov dword [esp + 8], edx
mov dword [esp + 4], str.error_Cannot_ImpersonateNamedPipeClient__d_n
mov dword [esp], eax
call fcn.00401e5c
jmp 0x40252c
mov eax, dword [sym.imp.KERNEL32.dll_GetCurrentThread]
call eax
mov edx, eax
lea eax, [ebp - 0x14]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0
mov dword [esp + 4], 0xf01ff
mov dword [esp], edx
mov eax, dword [sym.imp.ADVAPI32.dll_OpenThreadToken]
call eax
sub esp, 0x10
test eax, eax
jne 0x402471
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
mov edx, eax
mov eax, dword [ebp + 8]
mov eax, dword [eax]
mov dword [esp + 8], edx
mov dword [esp + 4], str.error_Cannot_OpenThreadToken__d_n
mov dword [esp], eax
call fcn.00401e5c
jmp 0x4024ee
mov eax, dword [ebp + 8]
lea edx, [eax + 0x14]
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x18]
mov ecx, eax
mov eax, dword [ebp - 0x14]
mov dword [esp + 0x14], edx
mov dword [esp + 0x10], 1
mov dword [esp + 0xc], ecx
mov dword [esp + 8], 0
mov dword [esp + 4], 0x2000000
mov dword [esp], eax
mov eax, dword [sym.imp.ADVAPI32.dll_DuplicateTokenEx]
call eax
sub esp, 0x18
test eax, eax
jne 0x4024d7
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
mov edx, eax
mov eax, dword [ebp + 8]
mov eax, dword [eax]
mov dword [esp + 8], edx
mov dword [esp + 4], str.error_Cannot_Duplicate_Token__d_n
mov dword [esp], eax
call fcn.00401e5c
jmp 0x4024de
mov dword [ebp - 0xc], 1
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_CloseHandle]
call eax
sub esp, 4
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x1c]
test eax, eax
jne 0x40252c
mov eax, dword [sym.imp.ADVAPI32.dll_RevertToSelf]
call eax
test eax, eax
jne 0x40252c
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
mov edx, eax
mov eax, dword [ebp + 8]
mov eax, dword [eax]
mov dword [esp + 8], edx
mov dword [esp + 4], str.error_Cannot_RevertToSelf__d_n
mov dword [esp], eax
call fcn.00401e5c
mov dword [ebp - 0xc], 0
mov eax, dword [ebp - 0xc]
lea esp, [ebp - 8]
pop ebx
pop esi
pop ebp
ret