Function at 0x408650
Capabilities:
Accept command line arguments
Get common file path

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x5d90ff
mov eax, dword fs:[0]
push eax
sub esp, 0x250
mov eax, dword [0x6d26f8]
xor eax, esp
mov dword [esp + 0x248], eax
push ebx
push esi
push edi
mov eax, dword [0x6d26f8]
xor eax, esp
push eax
lea eax, [esp + 0x260]
mov dword fs:[0], eax
mov esi, dword [ebp + 8]
cmp dword [esi + 0x18], 8
mov eax, dword [ebp + 0xc]
mov dword [esp + 0x1c], eax
mov dword [esp + 0x18], ecx
mov dword [esp + 0x24], edx
mov byte [esp + 0x13], 0
lea ebx, [esi + 4]
jb 0x4086b4
mov eax, dword [ebx]
jmp 0x4086b6
mov eax, ebx
push 0x104
push eax
lea eax, [esp + 0x54]
push eax
call fcn.00594186
mov edi, dword [sym.imp.USER32.dll_CharLowerW]
add esp, 0xc
lea edx, [esp + 0x4c]
xor ecx, ecx
push edx
mov word [esp + 0x256], cx
call edi
push 0xb
lea eax, [esp + 0x50]
push str._systemroot
push eax
call fcn.005948ba
add esp, 0xc
test eax, eax
jne 0x40885f
push 0x104
lea ecx, [esp + 0x50]
push ecx
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
xor ebx, ebx
cmp eax, ebx
je 0x408bc2
lea eax, [esp + 0x4c]
xor edx, edx
push eax
mov word [esp + 0x256], dx
call edi
mov eax, dword [esi + 0x14]
lea edx, [esp + 0x28]
push edx
lea ecx, [eax - 0xb]
push esi
lea edx, [ebx + 0xb]
call fcn.0040b590
mov dword [esp + 0x268], ebx
mov edi, 8
cmp dword [eax + 0x18], edi
jb 0x408751
mov eax, dword [eax + 4]
jmp 0x408754
add eax, 4
push eax
lea eax, [esp + 0x50]
push 0x104
push eax
call fcn.0059483d
or esi, 0xffffffff
add esp, 0xc
mov dword [esp + 0x268], esi
cmp dword [esp + 0x40], edi
jb 0x408784
mov ecx, dword [esp + 0x2c]
push ecx
call fcn.0059392f
add esp, 4
xor edx, edx
lea ecx, [esp + 0x4c]
mov dword [esp + 0x40], 7
mov dword [esp + 0x3c], ebx
mov word [esp + 0x2c], dx
call fcn.004063a0
test al, al
je 0x408bc2
lea eax, [esp + 0x14]
push eax
lea ecx, [esp + 0x50]
call fcn.0040b8a0
mov dword [esp + 0x268], 1
lea edi, [esp + 0x14]
call fcn.0040bc80
lea ecx, [esp + 0x28]
push ecx
call fcn.00407050
mov bl, 2
mov byte [esp + 0x268], bl
mov eax, edi
lea edi, [esp + 0x28]
call fcn.0040daa0
mov edx, dword [esp + 0x18]
push edx
lea edi, [esp + 0x30]
call fcn.0040bef0
mov edi, dword [esp + 0x24]
test edi, edi
je 0x408807
lea eax, [esp + 0x28]
call fcn.0040daa0
sub esp, 0x1c
mov eax, esp
mov dword [esp + 0x3c], esp
push eax
lea edi, [esp + 0x48]
call fcn.00407110
mov byte [esp + 0x284], 3
mov byte [esp + 0x284], bl
mov ecx, dword [esp + 0x38]
call fcn.0040aa50
add esp, 0x1c
mov byte [esp + 0x13], 1
mov byte [esp + 0x268], 1
mov ecx, edi
push ecx
call fcn.004070b0
mov dword [esp + 0x268], esi
lea ecx, [esp + 0x14]
call fcn.0040b950
jmp 0x408bc2
push 8
lea edx, [esp + 0x50]
push str.system32
push edx
call fcn.005948ba
add esp, 0xc
test eax, eax
jne 0x408982
push 0x104
lea eax, [esp + 0x50]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
test eax, eax
je 0x408bc2
lea edx, [esp + 0x4c]
xor ecx, ecx
push edx
mov word [esp + 0x256], cx
call edi
push 0x692fe8
lea eax, [esp + 0x50]
push 0x104
push eax
call fcn.0059483d
add esp, 0xc
cmp dword [esi + 0x18], 8
jb 0x4088c3
mov ebx, dword [ebx]
push ebx
lea ecx, [esp + 0x50]
push 0x104
push ecx
call fcn.0059483d
add esp, 0xc
lea ecx, [esp + 0x4c]
call fcn.004063a0
test al, al
je 0x408bc2
lea edx, [esp + 0x14]
push edx
lea ecx, [esp + 0x50]
call fcn.0040b8a0
mov dword [esp + 0x268], 4
lea eax, [esp + 0x28]
push eax
call fcn.00407050
mov bl, 5
mov byte [esp + 0x268], bl
lea eax, [esp + 0x14]
lea edi, [esp + 0x28]
call fcn.0040daa0
mov ecx, dword [esp + 0x18]
push ecx
lea edi, [esp + 0x30]
call fcn.0040bef0
mov edi, dword [esp + 0x24]
test edi, edi
je 0x40893f
lea eax, [esp + 0x28]
call fcn.0040daa0
sub esp, 0x1c
mov edx, esp
mov dword [esp + 0x3c], esp
push edx
lea edi, [esp + 0x48]
call fcn.00407110
mov byte [esp + 0x284], 6
mov byte [esp + 0x284], bl
mov ecx, dword [esp + 0x38]
call fcn.0040aa50
add esp, 0x1c
mov byte [esp + 0x13], 1
mov byte [esp + 0x268], 4
mov eax, edi
push eax
jmp 0x408a5b
push 0x13
push 0
lea ecx, [esp + 0x54]
push ecx
call dword [sym.imp.SHELL32.dll_PathResolve]
test eax, eax
je 0x408a79
push 0x104
lea edx, [esp + 0x50]
push edx
mov eax, edx
push eax
call dword [sym.imp.KERNEL32.dll_GetLongPathNameW]
test eax, eax
je 0x408bc2
lea ecx, [esp + 0x4c]
call fcn.004063a0
test al, al
je 0x408bc2
lea ecx, [esp + 0x14]
push ecx
lea ecx, [esp + 0x50]
call fcn.0040b8a0
mov ebx, 7
mov dword [esp + 0x268], ebx
lea edx, [esp + 0x28]
push edx
call fcn.00407050
mov byte [esp + 0x268], 8
lea eax, [esp + 0x14]
lea edi, [esp + 0x28]
call fcn.0040daa0
mov eax, dword [esp + 0x18]
push eax
lea edi, [esp + 0x30]
call fcn.0040bef0
mov edi, dword [esp + 0x24]
test edi, edi
je 0x408a1d
lea eax, [esp + 0x28]
call fcn.0040daa0
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x3c], esp
push ecx
lea edi, [esp + 0x48]
call fcn.00407110
mov byte [esp + 0x284], 9
mov byte [esp + 0x284], 8
mov ecx, dword [esp + 0x38]
call fcn.0040aa50
add esp, 0x1c
mov byte [esp + 0x13], 1
mov byte [esp + 0x268], bl
mov edx, edi
push edx
call fcn.004070b0
mov dword [esp + 0x268], 0xffffffff
lea ecx, [esp + 0x14]
call fcn.0040b950
jmp 0x408bc2
cmp dword [esi + 0x18], 8
jb 0x408a81
mov ebx, dword [ebx]
lea eax, [esp + 0x44]
push eax
push ebx
call dword [sym.imp.SHELL32.dll_CommandLineToArgvW]
mov edi, eax
mov dword [esp + 0x20], edi
test edi, edi
je 0x408bc2
xor esi, esi
cmp dword [esp + 0x44], esi
jle 0x408bc2
lea ebx, [esi + 0xa]
lea ebx, [ebx]
mov ecx, dword [edi + esi*4]
push 0x104
push ecx
lea edx, [esp + 0x54]
push edx
call fcn.00594186
add esp, 0xc
push 0x13
push 0
lea eax, [esp + 0x54]
push eax
call dword [sym.imp.SHELL32.dll_PathResolve]
test eax, eax
je 0x408bb7
push 0x104
lea ecx, [esp + 0x50]
push ecx
mov edx, ecx
push edx
call dword [sym.imp.KERNEL32.dll_GetLongPathNameW]
test eax, eax
je 0x408bb7
lea ecx, [esp + 0x4c]
call fcn.004063a0
test al, al
je 0x408bb7
lea eax, [esp + 0x14]
push eax
lea ecx, [esp + 0x50]
call fcn.0040b8a0
mov dword [esp + 0x268], ebx
lea ecx, [esp + 0x28]
push ecx
call fcn.00407050
mov byte [esp + 0x268], 0xb
lea eax, [esp + 0x14]
lea edi, [esp + 0x28]
call fcn.0040daa0
mov edx, dword [esp + 0x18]
push edx
lea edi, [esp + 0x30]
call fcn.0040bef0
mov edi, dword [esp + 0x24]
test edi, edi
je 0x408b5c
lea eax, [esp + 0x28]
call fcn.0040daa0
sub esp, 0x1c
mov eax, esp
mov dword [esp + 0x64], esp
push eax
lea edi, [esp + 0x48]
call fcn.00407110
mov byte [esp + 0x284], 0xc
mov byte [esp + 0x284], 0xb
mov ecx, dword [esp + 0x38]
call fcn.0040aa50
add esp, 0x1c
mov byte [esp + 0x13], 1
mov byte [esp + 0x268], bl
mov ecx, edi
push ecx
call fcn.004070b0
mov dword [esp + 0x268], 0xffffffff
lea ecx, [esp + 0x14]
call fcn.0040b950
mov edi, dword [esp + 0x20]
inc esi
cmp esi, dword [esp + 0x44]
jl 0x408ab0
mov al, byte [esp + 0x13]
mov ecx, dword [esp + 0x260]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x248]
xor ecx, esp
call fcn.0059393a
mov esp, ebp
pop ebp
ret