Function at 0x466370
Capabilities:
Check if file exists
Create process on windows
Get common file path
Set current directory

Disassembly:
push 0xffffffffffffffff
push 0x4c8210
mov eax, dword fs:[0]
push eax
sub esp, 0xa0
mov eax, dword [0x509354]
xor eax, esp
mov dword [esp + 0x9c], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x509354]
xor eax, esp
push eax
lea eax, [esp + 0xb4]
mov dword fs:[0], eax
mov eax, dword [esp + 0xc4]
mov ecx, dword [esp + 0xcc]
mov edx, dword [esp + 0xd0]
mov edi, dword [esp + 0xc8]
mov ebp, dword [esp + 0xdc]
mov dword [esp + 0x2c], eax
xor ebx, ebx
mov esi, 7
xor eax, eax
mov dword [esp + 0x18], ecx
mov dword [esp + 0x30], edx
mov byte [esp + 0x17], bl
mov dword [esp + 0xac], esi
mov dword [esp + 0xa8], ebx
mov word [esp + 0x98], ax
push ebx
push 0x105
lea ecx, [esp + 0x9c]
mov dword [esp + 0xc4], ebx
call fcn.0040d1c3
cmp dword [esp + 0xac], 8
mov eax, dword [esp + 0x98]
jae 0x46642e
lea eax, [esp + 0x98]
mov ecx, dword [esp + 0xa8]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
cmp eax, ebx
je 0x4666cb
cmp eax, dword [esp + 0xa8]
ja 0x4666cb
cmp dword [edi + 0x14], ebx
je 0x4665c4
mov ecx, edi
call fcn.00402721
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x4665c4
mov ecx, edi
call fcn.00402721
push eax
call dword [sym.imp.SHELL32.dll_PathIsExe]
test eax, eax
je 0x4665c4
xor edx, edx
mov dword [esp + 0x90], esi
mov dword [esp + 0x8c], ebx
mov word [esp + 0x7c], dx
push ebx
push 0x105
lea ecx, [esp + 0x80]
mov byte [esp + 0xc4], 1
call fcn.0040d1c3
mov eax, dword [esp + 0x7c]
mov esi, 8
cmp dword [esp + 0x90], esi
jae 0x4664cc
lea eax, [esp + 0x7c]
mov ecx, dword [esp + 0x8c]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
cmp eax, ebx
je 0x4665bb
cmp eax, dword [esp + 0x8c]
ja 0x4665bb
mov eax, dword [esp + 0x7c]
cmp dword [esp + 0x90], esi
jae 0x466501
lea eax, [esp + 0x7c]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
test eax, eax
je 0x4665bb
push 0x44
lea edx, [esp + 0x38]
push ebx
push edx
call fcn.0048e760
add esp, 0xc
mov dword [esp + 0x34], 0x44
cmp byte [esp + 0xd8], bl
je 0x466543
mov eax, 1
mov dword [esp + 0x60], 1
mov word [esp + 0x64], ax
mov ecx, dword [esp + 0x18]
xor eax, eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], eax
call fcn.00402721
push eax
call fcn.004913b3
add esp, 4
mov esi, eax
mov eax, dword [esp + 0x7c]
cmp ebp, ebx
je 0x466609
cmp dword [esp + 0x90], 8
jae 0x466583
lea eax, [esp + 0x7c]
lea ecx, [esp + 0x1c]
push ecx
lea edx, [esp + 0x38]
push edx
push eax
mov eax, dword [esp + 0xe0]
push ebx
push eax
push ebx
push ebx
push ebx
push esi
mov ecx, edi
call fcn.00402721
push eax
push ebp
call dword [sym.imp.ADVAPI32.dll_CreateProcessAsUserW]
test eax, eax
jne 0x466642
push esi
call fcn.0049042c
add esp, 4
lea ecx, [esp + 0x78]
call fcn.0040198e
mov eax, dword [esp + 0x98]
mov esi, 8
cmp dword [esp + 0xac], esi
jae 0x4665e0
lea eax, [esp + 0x98]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
cmp dword [esp + 0xac], esi
jb 0x466600
mov eax, dword [esp + 0x98]
push eax
call fcn.0048e006
add esp, 4
mov al, byte [esp + 0x17]
jmp 0x4666e7
cmp dword [esp + 0x90], 8
jae 0x466617
lea eax, [esp + 0x7c]
lea ecx, [esp + 0x1c]
push ecx
lea edx, [esp + 0x38]
push edx
push eax
mov eax, dword [esp + 0xe0]
push ebx
push eax
push ebx
push ebx
push ebx
push esi
mov ecx, edi
call fcn.00402721
push eax
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
jmp 0x4665aa
mov eax, dword [esp + 0x1c]
mov edi, dword [esp + 0x30]
mov ebp, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [edi], ebx
cmp eax, ebx
je 0x466692
mov edx, dword [esp + 0x2c]
push 1
push ebx
push 0x101c01
lea ecx, [esp + 0x24]
push ecx
mov ecx, dword [edx + 4]
mov dword [esp + 0x28], ebx
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 0x46668c
mov eax, dword [esp + 0x1c]
push eax
call ebp
jmp 0x466692
mov ecx, dword [esp + 0x18]
mov dword [edi], ecx
mov eax, dword [esp + 0x20]
cmp eax, ebx
je 0x46669d
push eax
call ebp
push esi
mov byte [esp + 0x1b], 1
call fcn.0049042c
add esp, 4
cmp dword [esp + 0x90], 8
jb 0x4665c4
mov edx, dword [esp + 0x7c]
push edx
call fcn.0048e006
add esp, 4
jmp 0x4665c4
cmp dword [esp + 0xac], 8
jb 0x4666e5
mov ecx, dword [esp + 0x98]
push ecx
call fcn.0048e006
add esp, 4
xor al, al
mov ecx, dword [esp + 0xb4]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x9c]
xor ecx, esp
call fcn.0048e25d
add esp, 0xac
ret 0x1c