Function at 0x1007865
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.0101c14a
lea ebx, [esi + 0x1d0]
push edi
mov ecx, ebx
mov dword [ebp - 0xa2c], ebx
call fcn.0101c14a
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 0x1007b70
cmp word [eax], di
je 0x1007b70
cmp dword [ebp - 0xa30], edi
je 0x1007b70
xor eax, eax
inc eax
cmp dword [ebp - 0xa38], eax
mov dword [ebp - 0xc], eax
jle 0x1007ae2
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 0x1007977
mov dword [esi + 0xc8], 1
mov eax, dword [section..data]
cmp eax, ebx
je 0x1007ac8
test dword [eax + 0x1c], 0x400
je 0x1007ac8
cmp byte [eax + 0x19], 5
jb 0x1007ac8
push 0x1001ca0
push 0x31
jmp 0x10079bf
push 0x1001f80
push dword [edi]
call dword [sym.imp.msvcrt.dll_wcsstr]
pop ecx
pop ecx
test eax, eax
je 0x10079cf
mov dword [ebp - 0xa34], 1
mov eax, dword [section..data]
cmp eax, ebx
je 0x1007ac8
test dword [eax + 0x1c], 0x400
je 0x1007ac8
cmp byte [eax + 0x19], 5
jb 0x1007ac8
push 0x1001ca0
push 0x32
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.01006ffe
jmp 0x1007ac8
push 0x1001f78
push dword [edi]
call dword [sym.imp.msvcrt.dll_wcsstr]
pop ecx
pop ecx
test eax, eax
je 0x1007a9c
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 0x1007a64
mov edi, dword [ebp - 0xa28]
lea eax, [ebp - 0x214]
push eax
mov ecx, edi
call fcn.0101c14a
mov eax, dword [section..data]
cmp eax, ebx
je 0x1007ac8
test dword [eax + 0x1c], 0x400
je 0x1007ac8
cmp byte [eax + 0x19], 5
jb 0x1007ac8
push dword [edi]
push 0x1001ca0
push 0x33
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.01007050
jmp 0x1007ac8
mov eax, dword [section..data]
cmp eax, ebx
je 0x1007ac8
test dword [eax + 0x1c], 0x400
je 0x1007ac8
cmp byte [eax + 0x19], 5
jb 0x1007ac8
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.01007024
jmp 0x1007ac8
push 0x1001f64
push dword [edi]
call dword [sym.imp.msvcrt.dll_wcsstr]
pop ecx
pop ecx
test eax, eax
je 0x1007abb
mov dword [esi + 0x1d8], 1
jmp 0x1007ac8
push dword [edi]
mov ecx, dword [ebp - 0xa2c]
call fcn.0101c14a
inc dword [ebp - 0xc]
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp - 0xa38]
jl 0x1007917
mov ebx, dword [ebp - 0xa2c]
xor edi, edi
mov ecx, dword [ebx]
cmp dword [ecx - 8], edi
jle 0x1007b70
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 0x1007b70
lea eax, [ebp - 0x414]
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
cmp cx, di
jne 0x1007b26
sub eax, edx
sar eax, 1
je 0x1007b4f
mov ecx, dword [ebp - 0xa28]
mov eax, dword [ecx]
cmp dword [eax - 8], edi
jg 0x1007b4f
lea eax, [ebp - 0x414]
push eax
call fcn.0101c14a
mov ecx, dword [ebp - 0xa28]
lea eax, [ebp - 0xc]
push eax
call fcn.0101c14a
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 0x1007b98
push edi
call fcn.0101f14a
jmp 0x1007b9d
call fcn.0101e65e
cmp eax, edi
pop edi
pop esi
pop ebx
je 0x1007bb1
lea eax, [ebp - 0x824]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0101d957
leave
ret