Function at 0x402399
Capabilities:
Create process on windows
Impersonate user

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x5c
push ebx
push esi
push edi
xor ebx, ebx
push 0x20
pop esi
push esi
mov edi, eax
lea eax, [ebp - 0x58]
push ebx
push eax
mov byte [ebp - 2], bl
mov dword [ebp - 8], ebx
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 0xc], ebx
mov dword [ebp - 0x20], ebx
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0x14], ebx
call fcn.00456db0
add esp, 0xc
test byte [ebp + 0x10], 1
mov dword [ebp - 0x58], esi
mov dword [ebp - 0x50], edi
mov byte [ebp - 1], bl
je 0x4023e2
mov byte [ebp - 1], 1
mov esi, dword [ebp + 0x10]
push 0
pop eax
and esi, 2
setne al
lea ecx, [ebp - 8]
push ecx
push ebx
add eax, 2
push eax
push dword [ebp + 0xc]
push dword [ebp + 8]
push edi
call dword [sym.imp.ADVAPI32.dll_LogonUserW]
test eax, eax
je 0x4025c0
cmp esi, ebx
je 0x40243a
lea eax, [ebp + 0xc]
push eax
push 1
push 2
push ebx
push ebx
push dword [ebp - 8]
call dword [sym.imp.ADVAPI32.dll_DuplicateTokenEx]
test eax, eax
je 0x4025c0
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp + 0xc]
mov dword [ebp - 8], eax
push 0x60000
push ebx
push str.winsta0
call dword [sym.imp.USER32.dll_OpenWindowStationW]
mov esi, eax
mov dword [ebp - 0x18], esi
cmp esi, ebx
je 0x4025c0
cmp esi, 0xffffffff
je 0x4025c0
call dword [sym.imp.USER32.dll_GetProcessWindowStation]
push esi
mov dword [ebp - 0x20], eax
call dword [sym.imp.USER32.dll_SetProcessWindowStation]
test eax, eax
je 0x4025c0
push 0x60081
push ebx
push ebx
push str.default
call dword [sym.imp.USER32.dll_OpenDesktopW]
mov edi, eax
mov dword [ebp - 0x1c], edi
cmp edi, ebx
je 0x4025c0
cmp edi, 0xffffffff
je 0x4025c0
lea eax, [ebp - 0xc]
push eax
push dword [ebp - 8]
call fcn.0040276b
test al, al
je 0x4025c0
lea eax, [ebp - 0x38]
push eax
push dword [ebp - 0xc]
mov word [ebp - 0x38], 0xb00
push esi
mov dword [ebp - 0x34], 0xf0000000
mov word [ebp - 0x2c], 0x400
mov dword [ebp - 0x28], 0xf037f
call fcn.004028f5
test al, al
je 0x4025c0
lea eax, [ebp - 0x2c]
push eax
push dword [ebp - 0xc]
mov word [ebp - 0x2c], bx
push edi
mov dword [ebp - 0x28], 0xf01ff
call fcn.00402b00
test al, al
je 0x4025c0
mov edi, dword [ebp + 0x20]
mov esi, dword [edi + 0x2c]
and esi, 0x100
mov dword [edi + 8], str.winsta0default
cmp dword [ebp + 0x14], ebx
je 0x402550
push dword [ebp + 0x14]
call fcn.00455031
lea edi, [eax + 1]
xor ecx, ecx
push 2
pop edx
mov eax, edi
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00455447
push edi
push dword [ebp + 0x14]
mov dword [ebp - 0x10], eax
push eax
call fcn.00456e2a
mov edi, dword [ebp + 0x20]
add esp, 0x14
cmp byte [ebp - 1], bl
je 0x402566
lea eax, [ebp - 0x58]
push eax
push dword [ebp - 8]
call dword [sym.imp.USERENV.dll_LoadUserProfileW]
test eax, eax
je 0x4025c0
test byte [ebp + 0x10], 4
jne 0x40257e
push ebx
push dword [ebp - 8]
lea eax, [ebp - 0x14]
push eax
call dword [sym.imp.USERENV.dll_CreateEnvironmentBlock]
test eax, eax
je 0x4025c0
push dword [ebp + 0x24]
mov eax, dword [ebp + 0x18]
push edi
push dword [ebp + 0x1c]
or eax, 0x400
push dword [ebp - 0x14]
push eax
push esi
push ebx
push ebx
push dword [ebp - 0x10]
push ebx
push dword [ebp - 8]
call dword [sym.imp.ADVAPI32.dll_CreateProcessAsUserW]
test eax, eax
je 0x4025c0
cmp byte [ebp - 1], bl
je 0x4025ba
lea eax, [ebp - 8]
push eax
lea eax, [ebp - 0x3c]
push eax
push dword [ebp + 0x24]
call fcn.0040283f
mov byte [ebp - 2], 1
jmp 0x4025d1
cmp dword [ebp - 0x3c], ebx
je 0x4025d1
push dword [ebp - 0x3c]
push dword [ebp - 8]
call dword [sym.imp.USERENV.dll_UnloadUserProfile]
push dword [ebp - 0xc]
call fcn.00402d0b
pop ecx
push dword [ebp - 0x18]
call dword [sym.imp.USER32.dll_CloseWindowStation]
push dword [ebp - 0x1c]
call dword [sym.imp.USER32.dll_CloseDesktop]
push dword [ebp - 0x20]
call dword [sym.imp.USER32.dll_SetProcessWindowStation]
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp - 0x10]
call fcn.0045504c
pop ecx
push dword [ebp - 0x14]
call dword [sym.imp.USERENV.dll_DestroyEnvironmentBlock]
mov al, byte [ebp - 2]
pop edi
pop esi
pop ebx
leave
ret 0x20