Function at 0x403719
Capabilities:
Get common file path
Set current directory

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x16c
push ebx
mov ebx, dword [ebp + 0x18]
push esi
push edi
push dword [ebp + 0x1c]
push ebx
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.0040338c
add esp, 0x10
test eax, eax
je 0x403790
cmp byte [ebx], 0
je 0x403790
cmp dword [ebp + 0x14], 0
je 0x403759
push ebx
call fcn.00403948
test eax, eax
pop ecx
je 0x403790
jmp 0x403940
lea eax, [ebp - 0x16c]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
test eax, eax
jbe 0x403790
mov edi, dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
push ebx
call edi
mov esi, eax
lea eax, [ebp - 0x16c]
neg esi
sbb esi, esi
push eax
inc esi
call edi
test esi, esi
je 0x403940
cmp dword [ebp + 0x20], 0
jne 0x40392b
mov eax, dword [ebp + 0x1c]
dec eax
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
test eax, eax
jbe 0x4037b0
and byte [ebx + 2], 0
jmp 0x4037bc
push 0x4068c0
push ebx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
and dword [ebp + 0x20], 0
lea eax, [ebp - 0x64]
push 0x64
push eax
mov ebx, 0x40444c
push 0x4068ac
mov edi, SysReAllocStringLen
push ebx
push edi
call fcn.004034f9
mov esi, dword [sym.imp.KERNEL32.dll_lstrlenA]
add esp, 0x14
test eax, eax
je 0x40382e
push 0xd
lea eax, [ebp - 0x64]
push 0x40443c
push eax
call fcn.00403006
add esp, 0xc
test eax, eax
jne 0x40382e
lea eax, [ebp - 0x57]
push 0x25
push eax
call fcn.00402d48
pop ecx
test eax, eax
pop ecx
jne 0x40382e
lea eax, [ebp - 0x57]
push eax
call esi
mov ecx, dword [ebp + 0x1c]
add ecx, 0xfffffffe
cmp eax, ecx
jge 0x40382e
lea eax, [ebp - 0x57]
push eax
mov eax, dword [ebp + 0x18]
add eax, 2
push eax
jmp 0x403870
lea eax, [ebp - 0x64]
push 0x64
push eax
push 0x40689c
push ebx
push edi
call fcn.004034f9
add esp, 0x14
test eax, eax
je 0x40387d
cmp byte [ebp - 0x64], 0
je 0x40387d
lea eax, [ebp - 0x64]
push 0x25
push eax
call fcn.00402d48
pop ecx
test eax, eax
pop ecx
jne 0x40387d
lea eax, [ebp - 0x64]
push eax
call esi
cmp eax, dword [ebp + 0x1c]
jge 0x40387d
lea eax, [ebp - 0x64]
push eax
push dword [ebp + 0x18]
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
mov dword [ebp + 0x20], 1
xor edi, edi
cmp dword [ebp + 0x10], edi
je 0x40388b
push dword [ebp + 0x10]
call esi
mov edi, eax
push dword [0x4067dc]
call esi
push dword [0x4067d8]
mov ebx, eax
call esi
add edi, ebx
cmp dword [ebp + 0x20], 1
lea edi, [eax + edi + 0xa]
jne 0x4038c4
mov ebx, dword [ebp + 0x18]
push ebx
call esi
dec eax
test eax, eax
jle 0x4038be
cmp byte [eax + ebx], 0x5c
jne 0x4038be
and byte [eax + ebx], 0
lea edi, [edi + eax + 1]
jmp 0x4038d1
push dword [0x4067d4]
call esi
mov ebx, dword [ebp + 0x18]
add edi, eax
cmp edi, dword [ebp + 0x1c]
jg 0x40392b
mov eax, dword [ebp + 0x20]
mov esi, dword [sym.imp.KERNEL32.dll_lstrcatA]
cmp eax, 3
jge 0x403906
lea edi, [eax*4 + 0x4067d4]
push dword [edi]
push ebx
call esi
push ebx
call fcn.0040328f
test eax, eax
pop ecx
je 0x40392b
add edi, 4
cmp edi, str._bar
jl 0x4038eb
cmp dword [ebp + 0x10], 0
je 0x403912
push dword [ebp + 0x10]
push ebx
call esi
cmp dword [ebp + 0x14], 0
jne 0x40392f
push 0x40688c
push ebx
call esi
push ebx
call fcn.0040328f
test eax, eax
pop ecx
jne 0x40392f
xor eax, eax
jmp 0x403943
push 0
push ebx
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.0040357e
add esp, 0x10
push 1
pop eax
pop edi
pop esi
pop ebx
leave
ret