Function at 0x18017902
Capabilities:
Create process on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x7c
and dword [esp + 0x14], 0
push ebx
push esi
push edi
mov dword [esp + 0x28], edx
mov esi, ecx
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
lea ecx, [esp + 0x20]
push ecx
push 0xa
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
jne 0x18017943
call fcn.18017850
mov esi, eax
jmp 0x18017b38
mov eax, dword [esp + 0x20]
mov dword [esp + 0x2c], eax
cmp eax, 0xffffffff
jne 0x1801795a
mov esi, 0x80070057
jmp 0x18017b40
mov ecx, dword [esi]
sub ecx, 0x10
call fcn.18009e91
add eax, 0x10
mov dword [esp + 0x40], 0x44
push 0x40
mov dword [esp + 0x14], eax
lea eax, [esp + 0x48]
push 0
push eax
call fcn.181620e0
and dword [esp + 0x30], 0
lea edi, [esp + 0x3c]
xor eax, eax
xor esi, esi
stosd dword es:[edi], eax
add esp, 0xc
mov dword [esp + 0x18], esi
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
xor edi, edi
mov dword [esp + 0x14], edi
cmp dword [esp + 0x28], esi
je 0x18017a1a
lea edx, [esp + 0x14]
lea ecx, [esp + 0x18]
call fcn.18015a90
mov esi, eax
test esi, esi
jns 0x180179e1
cmp dword [esp + 0x14], edi
je 0x180179c4
push dword [esp + 0x14]
call ebx
cmp dword [esp + 0x18], edi
je 0x180179d0
push dword [esp + 0x18]
call ebx
mov ecx, dword [esp + 0x10]
lea ecx, [ecx - 0x10]
call fcn.1800687d
jmp 0x18017b38
mov esi, dword [sym.imp.KERNEL32.dll_GetStdHandle]
push 0xfffffffffffffff6
mov dword [esp + 0x70], 0x100
call esi
mov edi, dword [esp + 0x14]
push 0xfffffffffffffff4
mov dword [esp + 0x7c], eax
mov dword [esp + 0x80], edi
call esi
mov esi, dword [esp + 0x18]
xor ebx, ebx
inc ebx
mov dword [esp + 0x80], eax
mov dword [esp + 0x24], ebx
jmp 0x18017a1d
xor ebx, ebx
inc ebx
and dword [esp + 0x14], 0
lea eax, [esp + 0x1c]
and dword [esp + 0x1c], 0
push 0
push dword [esp + 0x30]
push eax
call dword [sym.imp.USERENV.dll_CreateEnvironmentBlock]
test eax, eax
je 0x18017a4e
mov eax, dword [esp + 0x1c]
mov dword [esp + 0x14], 0x400
mov dword [esp + 0x18], eax
jmp 0x18017a58
xor edx, edx
mov dword [esp + 0x18], edx
mov dword [esp + 0x1c], edx
mov eax, dword [esp + 0x10]
mov edx, 0x104
mov ecx, dword [eax - 8]
sub ebx, dword [eax - 4]
sub ecx, edx
or ebx, ecx
jge 0x18017a7b
push edx
lea ecx, [esp + 0x14]
call fcn.18006f9e
mov eax, dword [esp + 0x10]
lea ecx, [esp + 0x30]
push ecx
lea ecx, [esp + 0x44]
push ecx
xor ecx, ecx
push ecx
push dword [esp + 0x24]
push dword [esp + 0x24]
push dword [esp + 0x38]
push ecx
push ecx
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
push 0xffffffffffffffff
lea ecx, [esp + 0x14]
mov ebx, eax
call fcn.18009cb5
test ebx, ebx
jne 0x18017ae5
call fcn.18017850
push ebx
mov dword [esp + 0x30], eax
call dword [sym.imp.USERENV.dll_DestroyEnvironmentBlock]
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
test edi, edi
je 0x18017acc
push edi
call ebx
test esi, esi
je 0x18017ad3
push esi
call ebx
mov ecx, dword [esp + 0x10]
lea ecx, [ecx - 0x10]
call fcn.1800687d
mov esi, dword [esp + 0x2c]
jmp 0x18017b38
push dword [esp + 0x34]
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
call ebx
mov ecx, dword [ebp + 8]
test ecx, ecx
jne 0x18017b00
push dword [esp + 0x30]
call ebx
jmp 0x18017b06
mov eax, dword [esp + 0x30]
mov dword [ecx], eax
mov ecx, dword [esp + 0x28]
test ecx, ecx
je 0x18017b14
mov eax, esi
xor esi, esi
mov dword [ecx], eax
push 0
call dword [sym.imp.USERENV.dll_DestroyEnvironmentBlock]
test edi, edi
je 0x18017b23
push edi
call ebx
test esi, esi
je 0x18017b2a
push esi
call ebx
mov ecx, dword [esp + 0x10]
lea ecx, [ecx - 0x10]
call fcn.1800687d
xor esi, esi
mov eax, dword [esp + 0x20]
test eax, eax
je 0x18017b43
push eax
call ebx
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret