Function at 0x466040
Capabilities:
Check if file exists
Create process on windows
Get common file path
Resolve function by parsing pe exports
Set current directory

Disassembly:
push 0xffffffffffffffff
push 0x4c81d0
mov eax, dword fs:[0]
push eax
sub esp, 0x88
mov eax, dword [0x509354]
xor eax, esp
mov dword [esp + 0x84], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x509354]
xor eax, esp
push eax
lea eax, [esp + 0x9c]
mov dword fs:[0], eax
mov eax, dword [esp + 0xac]
mov ecx, dword [esp + 0xb8]
mov ebx, dword [esp + 0xbc]
mov esi, dword [esp + 0xb0]
mov edi, dword [esp + 0xb4]
mov ebp, dword [esp + 0xc4]
mov dword [esp + 0x1c], eax
xor eax, eax
xor edx, edx
mov dword [esp + 0x18], ecx
mov dword [esp + 0x20], ebx
mov byte [esp + 0x17], 0
mov dword [esp + 0x94], 7
mov dword [esp + 0x90], eax
mov word [esp + 0x80], dx
push eax
push 0x105
lea ecx, [esp + 0x84]
mov dword [esp + 0xac], eax
call fcn.0040d1c3
cmp dword [esp + 0x94], 8
mov eax, dword [esp + 0x80]
jae 0x466105
lea eax, [esp + 0x80]
push eax
mov eax, dword [esp + 0x94]
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
test eax, eax
je 0x466329
cmp eax, dword [esp + 0x90]
ja 0x466329
cmp dword [esi + 0x14], 0
je 0x4662e7
mov ecx, esi
call fcn.00402721
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x4662e7
mov ecx, esi
call fcn.00402721
push eax
call dword [sym.imp.SHELL32.dll_PathIsExe]
test eax, eax
je 0x4662e7
xor ecx, ecx
mov dword [esp + 0x78], 7
mov dword [esp + 0x74], 0
mov word [esp + 0x64], cx
push ecx
push 0x105
lea ecx, [esp + 0x68]
mov byte [esp + 0xac], 1
call fcn.0040d1c3
push 0x38
lea edx, [esp + 0x2c]
push 0
test ebx, ebx
push edx
setne bl
mov dword [esp + 0x30], 0x3c
call fcn.0048e760
add esp, 0xc
mov ecx, esi
mov dword [esp + 0x2c], ebp
call fcn.00402721
mov ecx, edi
mov dword [esp + 0x34], eax
call fcn.00402721
mov dword [esp + 0x38], eax
movzx eax, bl
neg eax
sbb eax, eax
and eax, 0x40
or eax, dword [esp + 0xc0]
mov edi, 8
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x64]
mov dword [esp + 0x30], str.open
mov dword [esp + 0x40], 1
cmp dword [esp + 0x78], edi
jae 0x4661fd
lea eax, [esp + 0x64]
mov ecx, dword [esp + 0x74]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
test eax, eax
je 0x4662de
cmp eax, dword [esp + 0x74]
ja 0x4662de
mov eax, dword [esp + 0x64]
cmp dword [esp + 0x78], edi
jae 0x466229
lea eax, [esp + 0x64]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
test eax, eax
je 0x4662de
cmp dword [esp + 0x78], edi
jb 0x466248
mov edx, dword [esp + 0x64]
mov dword [esp + 0x3c], edx
jmp 0x466250
lea eax, [esp + 0x64]
mov dword [esp + 0x3c], eax
lea ecx, [esp + 0x24]
push ecx
call dword [sym.imp.SHELL32.dll_ShellExecuteExW]
test eax, eax
je 0x4662c9
mov edx, dword [esp + 0x44]
mov eax, dword [esp + 0x18]
mov dword [eax], edx
test bl, bl
je 0x4662c4
mov eax, dword [esp + 0x5c]
mov esi, dword [esp + 0x20]
mov dword [esi], 0
test eax, eax
je 0x4662c4
mov edx, dword [esp + 0x1c]
push 1
push 0
push 0x101c01
lea ecx, [esp + 0x24]
push ecx
mov ecx, dword [edx + 4]
mov dword [esp + 0x28], 0
mov edx, dword [ecx]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_DuplicateHandle]
test eax, eax
jne 0x4662be
mov eax, dword [esp + 0x5c]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x4662c4
mov ecx, dword [esp + 0x18]
mov dword [esi], ecx
mov byte [esp + 0x17], 1
cmp dword [esp + 0x78], edi
jb 0x4662e7
mov edx, dword [esp + 0x64]
push edx
call fcn.0048e006
add esp, 4
jmp 0x4662e7
lea ecx, [esp + 0x60]
call fcn.0040198e
mov eax, dword [esp + 0x80]
mov esi, 8
cmp dword [esp + 0x94], esi
jae 0x466303
lea eax, [esp + 0x80]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
cmp dword [esp + 0x94], esi
jb 0x466323
mov eax, dword [esp + 0x80]
push eax
call fcn.0048e006
add esp, 4
mov al, byte [esp + 0x17]
jmp 0x466345
cmp dword [esp + 0x94], 8
jb 0x466343
mov ecx, dword [esp + 0x80]
push ecx
call fcn.0048e006
add esp, 4
xor al, al
mov ecx, dword [esp + 0x9c]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x84]
xor ecx, esp
call fcn.0048e25d
add esp, 0x94
ret 0x1c