Function at 0x402790
Capabilities:
Create process on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x7c
push ebx
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov eax, ecx
push edi
mov dword [esp + 0x28], eax
mov dword [esp + 0x24], eax
lea eax, [esp + 0x10]
push eax
push 0x22
mov dword [esp + 0x34], edx
mov dword [esp + 0x18], 0
call esi
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x4027e8
mov ecx, dword [esp + 0x10]
push 1
call fcn.004025a0
add esp, 4
test eax, eax
jne 0x4027f4
push dword [esp + 0x10]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, 0x3f0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea eax, [esp + 0x14]
mov dword [esp + 0x14], 0
push eax
push 1
push 2
push 0
push 0x2000000
push dword [esp + 0x24]
call dword [sym.imp.ADVAPI32.dll_DuplicateTokenEx]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x402853
mov ecx, dword [esp + 0x14]
push 0
call fcn.004025a0
add esp, 4
lea eax, [esp + 0x24]
push 4
push eax
push 0xc
push dword [esp + 0x20]
call dword [sym.imp.ADVAPI32.dll_SetTokenInformation]
test eax, eax
jne 0x402853
push dword [esp + 0x14]
call edi
mov dword [esp + 0x14], 0
mov ecx, dword [esp + 0x10]
push 0
call fcn.004025a0
add esp, 4
push dword [esp + 0x10]
call edi
mov ebx, dword [esp + 0x14]
test ebx, ebx
je 0x4027e8
lea eax, [esp + 0x18]
mov dword [esp + 0x20], 0
push eax
push 0x20
mov dword [esp + 0x24], 0
mov dword [esp + 0x20], 0
call esi
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x4028e0
mov ecx, dword [esp + 0x18]
push 1
call fcn.004025a0
add esp, 4
test eax, eax
jne 0x4028bf
push dword [esp + 0x18]
call edi
jmp 0x4028e2
lea eax, [esp + 0x1c]
push eax
push dword [esp + 0x2c]
call dword [sym.imp.WTSAPI32.dll_WTSQueryUserToken]
push dword [esp + 0x18]
mov esi, eax
call edi
test esi, esi
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
jne 0x4028e2
call esi
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x4028fe
push 0
push eax
lea eax, [esp + 0x28]
push eax
call dword [sym.imp.USERENV.dll_CreateEnvironmentBlock]
push dword [esp + 0x1c]
call edi
lea eax, [esp + 0x30]
mov dword [esp + 0x44], 0
push eax
lea eax, [esp + 0x44]
mov dword [esp + 0x44], 0x44
push eax
push dword [ebp + 8]
xorps xmm0, xmm0
mov dword [esp + 0x54], str.winsta0default
push dword [esp + 0x2c]
movlpd qword [esp + 0x5c], xmm0
push 0x400
push 0
push 0
push 0
push dword [esp + 0x4c]
movlpd qword [esp + 0x78], xmm0
push 0
push ebx
movlpd qword [esp + 0x88], xmm0
movlpd qword [esp + 0x90], xmm0
movlpd qword [esp + 0x98], xmm0
movlpd qword [esp + 0xa0], xmm0
movlpd qword [esp + 0xa8], xmm0
call dword [sym.imp.ADVAPI32.dll_CreateProcessAsUserA]
test eax, eax
je 0x4029c2
cmp dword [ebp + 0xc], 0
je 0x40299e
push 0xffffffffffffffff
push dword [esp + 0x34]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push dword [ebp + 0x10]
push dword [esp + 0x34]
call dword [sym.imp.KERNEL32.dll_GetExitCodeProcess]
push dword [esp + 0x30]
call edi
push dword [esp + 0x34]
call edi
push dword [esp + 0x20]
xor esi, esi
call dword [sym.imp.USERENV.dll_DestroyEnvironmentBlock]
push ebx
call edi
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
call esi
push dword [esp + 0x20]
mov esi, eax
call dword [sym.imp.USERENV.dll_DestroyEnvironmentBlock]
push ebx
call edi
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret