Function at 0x100785f
Capabilities:
Accept command line arguments
Get common file path
Set current directory

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0xa38
mov eax, dword [0x1026bcc]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov esi, ecx
push edi
xor eax, eax
lea ecx, [esi + 0x1cc]
mov edi, 0x1001f98
push edi
mov dword [ebp - 0xa34], eax
mov dword [esi + 0xc8], eax
mov dword [esi + 0x1d8], eax
mov dword [esi + 0xdc], eax
mov dword [ebp - 0xa28], ecx
call fcn.0101bfc4
lea ebx, [esi + 0x1d0]
push edi
mov ecx, ebx
mov dword [ebp - 0xa2c], ebx
call fcn.0101bfc4
lea eax, [ebp - 0xa38]
push eax
call dword [sym.imp.KERNEL32.dll_GetCommandLineW]
push eax
call dword [sym.imp.SHELL32.dll_CommandLineToArgvW]
mov dword [ebp - 0xa30], eax
mov eax, dword [esi + 0x74]
xor edi, edi
cmp eax, edi
je 0x1007b6a
cmp word [eax], di
je 0x1007b6a
cmp dword [ebp - 0xa30], edi
je 0x1007b6a
xor eax, eax
inc eax
cmp dword [ebp - 0xa38], eax
mov dword [ebp - 0xc], eax
jle 0x1007adc
mov ebx, section..data
mov eax, dword [ebp - 0xa30]
mov ecx, dword [ebp - 0xc]
lea edi, [eax + ecx*4]
push dword [edi]
call dword [sym.imp.msvcrt.dll__wcsupr]
mov dword [esp], 0x1001f90
push dword [edi]
call dword [sym.imp.msvcrt.dll_wcsstr]
pop ecx
pop ecx
test eax, eax
je 0x1007971
mov dword [esi + 0xc8], 1
mov eax, dword [section..data]
cmp eax, ebx
je 0x1007ac2
test dword [eax + 0x1c], 0x400
je 0x1007ac2
cmp byte [eax + 0x19], 5
jb 0x1007ac2
push 0x1001ca0
push 0x31
jmp 0x10079b9
push 0x1001f80
push dword [edi]
call dword [sym.imp.msvcrt.dll_wcsstr]
pop ecx
pop ecx
test eax, eax
je 0x10079c9
mov dword [ebp - 0xa34], 1
mov eax, dword [section..data]
cmp eax, ebx
je 0x1007ac2
test dword [eax + 0x1c], 0x400
je 0x1007ac2
cmp byte [eax + 0x19], 5
jb 0x1007ac2
push 0x1001ca0
push 0x32
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.01006ff8
jmp 0x1007ac2
push 0x1001f78
push dword [edi]
call dword [sym.imp.msvcrt.dll_wcsstr]
pop ecx
pop ecx
test eax, eax
je 0x1007a96
xor eax, eax
push 0x206
push eax
mov word [ebp - 0x214], ax
lea eax, [ebp - 0x212]
push eax
call sub.msvcrt.dll_memset
add esp, 0xc
push 0x103
lea eax, [ebp - 0x214]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
test eax, eax
je 0x1007a5e
mov edi, dword [ebp - 0xa28]
lea eax, [ebp - 0x214]
push eax
mov ecx, edi
call fcn.0101bfc4
mov eax, dword [section..data]
cmp eax, ebx
je 0x1007ac2
test dword [eax + 0x1c], 0x400
je 0x1007ac2
cmp byte [eax + 0x19], 5
jb 0x1007ac2
push dword [edi]
push 0x1001ca0
push 0x33
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.0100704a
jmp 0x1007ac2
mov eax, dword [section..data]
cmp eax, ebx
je 0x1007ac2
test dword [eax + 0x1c], 0x400
je 0x1007ac2
cmp byte [eax + 0x19], 5
jb 0x1007ac2
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov eax, dword [section..data]
push 0x1001ca0
push 0x34
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.0100701e
jmp 0x1007ac2
push 0x1001f64
push dword [edi]
call dword [sym.imp.msvcrt.dll_wcsstr]
pop ecx
pop ecx
test eax, eax
je 0x1007ab5
mov dword [esi + 0x1d8], 1
jmp 0x1007ac2
push dword [edi]
mov ecx, dword [ebp - 0xa2c]
call fcn.0101bfc4
inc dword [ebp - 0xc]
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp - 0xa38]
jl 0x1007911
mov ebx, dword [ebp - 0xa2c]
xor edi, edi
mov ecx, dword [ebx]
cmp dword [ecx - 8], edi
jle 0x1007b6a
mov eax, 0x100
push eax
lea edx, [ebp - 0xa24]
push edx
push eax
lea edx, [ebp - 0x20c]
push edx
push eax
lea eax, [ebp - 0x414]
push eax
push 3
lea eax, [ebp - 0xc]
push eax
push ecx
call sub.msvcrt.dll__wsplitpath_s
add esp, 0x24
test eax, eax
jne 0x1007b6a
lea eax, [ebp - 0x414]
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
cmp cx, di
jne 0x1007b20
sub eax, edx
sar eax, 1
je 0x1007b49
mov ecx, dword [ebp - 0xa28]
mov eax, dword [ecx]
cmp dword [eax - 8], edi
jg 0x1007b49
lea eax, [ebp - 0x414]
push eax
call fcn.0101bfc4
mov ecx, dword [ebp - 0xa28]
lea eax, [ebp - 0xc]
push eax
call fcn.0101bfc4
mov ecx, dword [ebp - 0xa28]
lea eax, [ebp - 0x414]
push eax
call sub.MFC42u.dll_CString::operator
push dword [ebp - 0xa30]
call dword [sym.imp.KERNEL32.dll_LocalFree]
push 0x208
lea eax, [ebp - 0x824]
push eax
cmp dword [ebp - 0xa34], edi
je 0x1007b92
push edi
call fcn.0101efca
jmp 0x1007b97
call fcn.0101e4de
cmp eax, edi
pop edi
pop esi
pop ebx
je 0x1007bab
lea eax, [ebp - 0x824]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0101d7d3
leave
ret