Function at 0x409800
Capabilities:
Check if file exists
Create process on windows
Create process suspended
Get common file path
Get comspec environment variable
Get file attributes
Query environment variable
Resume thread
Set current directory

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0xa90
mov eax, dword [0x4677a0]
xor eax, esp
mov dword [esp + 0xa8c], eax
push ebx
push esi
lea eax, [esp + 0x68]
push eax
push 0x104
mov dword [esp + 0x24], 1
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
push 0x458798
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
push 0x44
lea ecx, [esp + 0x24]
push 0
push ecx
call fcn.00437690
add esp, 0xc
push 0x104
xor eax, eax
lea edx, [esp + 0x274]
push edx
push str.COMSPEC
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], eax
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
test eax, eax
je 0x4099c5
mov esi, dword [sym.imp.KERNEL32.dll_SetPriorityClass]
push 0x104
lea eax, [esp + 0x47c]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetShortPathNameW]
test eax, eax
je 0x4099e6
push 0x44
lea ecx, [esp + 0x24]
push 0
push ecx
call fcn.00437690
xor eax, eax
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], eax
lea eax, [esp + 0x484]
push eax
lea ecx, [esp + 0x280]
push ecx
xor edx, edx
push str._s__c_rmdir__s__s__q
mov ecx, 0x208
lea ebx, [esp + 0x698]
mov dword [esp + 0x38], 0x44
mov dword [esp + 0x64], 1
mov word [esp + 0x68], dx
call fcn.00402d10
add esp, 0x18
lea edx, [esp + 0xc]
push edx
lea eax, [esp + 0x24]
push eax
push 0
push 0
push 4
push 0
push 0
push 0
mov ecx, ebx
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
test eax, eax
je 0x409a07
push 0x80
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call esi
mov edx, dword [esp + 0xc]
push 0x40
push edx
call esi
mov eax, dword [esp + 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_ResumeThread]
mov ecx, dword [esp + 0xc]
push 0x3e8
push ecx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push edi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x409a28
cmp dword [esp + 0x1c], 0
je 0x409a28
push 0x44
lea edx, [esp + 0x24]
push 0
push edx
mov dword [esp + 0x28], 0
call fcn.00437690
xor eax, eax
add esp, 0xc
mov dword [esp + 0xc], eax
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], eax
push 0x104
lea eax, [esp + 0x274]
push eax
push str.COMSPEC
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
test eax, eax
jne 0x409888
lea ecx, [esp + 0x68]
push ecx
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
xor eax, eax
pop esi
pop ebx
mov ecx, dword [esp + 0xa8c]
xor ecx, esp
call fcn.00435010
mov esp, ebp
pop ebp
ret
lea edx, [esp + 0x68]
push edx
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
xor eax, eax
pop esi
pop ebx
mov ecx, dword [esp + 0xa8c]
xor ecx, esp
call fcn.00435010
mov esp, ebp
pop ebp
ret
lea eax, [esp + 0x68]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
xor eax, eax
pop esi
pop ebx
mov ecx, dword [esp + 0xa8c]
xor ecx, esp
call fcn.00435010
mov esp, ebp
pop ebp
ret
lea ecx, [esp + 0x68]
push ecx
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
mov ecx, dword [esp + 0xa94]
pop esi
pop ebx
xor ecx, esp
mov eax, 1
call fcn.00435010
mov esp, ebp
pop ebp
ret