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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x16a4
call fcn.00452790
inc dword [0x47f2d0]
cmp dword [0x47f2d0], 0x30
push ebx
push esi
push edi
mov ebx, ecx
jl 0x406647
push dword [ebp + 0x14]
push str.include_depth_exceeded.__Make_sure_there_are_no_recursive_includes
push dword [ebp + 0x18]
push dword [ebp + 0x10]
push ebx
call fcn.00405d00
dec dword [0x47f2d0]
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14
and dword [esp + 0x14], 0
and dword [esp + 0x24], 0
lea esi, [esp + 0x20]
mov byte [esp + 0x10], 1
mov byte [esp + 0x13], 1
mov byte [esp + 0x11], 0
call fcn.0040adcf
push dword [ebp + 8]
mov eax, 0x2000
mov ecx, esi
call fcn.0040ac04
test al, al
jne 0x4066a5
push dword [ebp + 0x14]
push str.Error_opening_the_file
push dword [ebp + 0x18]
push dword [ebp + 0x10]
push ebx
call fcn.00405d00
xor bl, bl
lea esi, [esp + 0x20]
call fcn.0040adcf
dec dword [0x47f2d0]
mov al, bl
jmp 0x40663e
lea eax, [esp + 0x398]
push eax
mov esi, 0x104
push esi
call dword [sym.imp.KERNEL32.DLL_GetCurrentDirectoryA]
lea eax, [esp + 0x1c]
push eax
lea eax, [esp + 0x18c]
push eax
push esi
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.DLL_GetFullPathNameA]
lea eax, [esp + 0x5a8]
push eax
lea eax, [esp + 0x4a4]
push eax
lea eax, [esp + 0x298]
push eax
lea eax, [esp + 0x24]
push eax
lea eax, [esp + 0x198]
push eax
call fcn.0044fa34
add esp, 0x14
lea eax, [esp + 0x18]
push eax
lea eax, [esp + 0x84]
push eax
call fcn.0044cf30
lea eax, [esp + 0x298]
push eax
lea eax, [esp + 0x8c]
push eax
call fcn.0044cf40
add esp, 0x10
lea eax, [esp + 0x80]
push eax
call dword [sym.imp.KERNEL32.DLL_SetCurrentDirectoryA]
cmp byte [esp + 0x13], 1
jne 0x4068d2
mov ecx, 0xfff
lea edx, [esp + 0x6b0]
lea eax, [esp + 0x20]
call fcn.0040b0e7
test al, al
je 0x4068d2
inc dword [esp + 0x14]
lea esi, [esp + 0x6b0]
call fcn.004062eb
mov eax, esi
call fcn.0040631e
test al, al
je 0x4068b3
mov edi, esi
call fcn.004062be
mov eax, esi
push eax
mov byte [esp + 0x16], 0
call fcn.0044d720
mov esi, eax
cmp esi, 2
pop ecx
jle 0x4067c2
movzx eax, byte [esp + esi + 0x6ae]
and eax, 0x7f
push eax
call fcn.0044f81b
test eax, eax
pop ecx
je 0x4067c2
lea eax, [esp + esi + 0x6af]
cmp byte [eax], 0x5f
jne 0x4067c2
mov byte [eax], 0
mov byte [esp + 0x12], 1
cmp byte [esp + 0x11], 1
jne 0x40683c
cmp dword [ebx + 0xc], 0
je 0x40689c
mov eax, dword [ebx + 8]
push dword [eax]
call fcn.0044d720
mov esi, eax
pop ecx
lea eax, [esp + 0x6b0]
push eax
call fcn.0044d720
add esi, eax
pop ecx
inc esi
push esi
call fcn.0044d086
mov esi, eax
mov eax, dword [ebx + 8]
pop ecx
push dword [eax]
push esi
call fcn.0044cf30
lea eax, [esp + 0x6b8]
push eax
push esi
call fcn.0044cf40
push esi
call fcn.0044d720
add esp, 0x14
cmp eax, 0xfff
jbe 0x40682a
mov byte [esi + 0xfff], 0
mov eax, dword [ebx + 8]
push dword [eax]
call fcn.0044d0f0
mov eax, dword [ebx + 8]
pop ecx
mov dword [eax], esi
jmp 0x40689c
cmp byte [esp + 0x6b0], 0x23
jne 0x40687f
lea eax, [esp + 0x20]
push eax
lea eax, [esp + 0x18]
push eax
lea eax, [esp + 0x190]
push eax
push ebx
lea ecx, [esp + 0x6c0]
call fcn.004068f2
test eax, eax
je 0x406897
cmp eax, 1
jle 0x40689c
cmp eax, 3
jle 0x40687f
cmp eax, 4
jne 0x40689c
mov byte [esp + 0x13], 0
jmp 0x40689c
push dword [ebp + 0xc]
lea eax, [esp + 0x6b4]
push eax
push dword [esp + 0x1c]
mov esi, ebx
call fcn.00405f71
jmp 0x40689c
mov byte [esp + 0x10], 0
cmp byte [esp + 0x12], 1
sete byte [esp + 0x11]
cmp byte [esp + 0x10], 1
je 0x406735
jmp 0x4068d2
lea eax, [esp + 0x6b0]
push eax
push str.Unterminated_string
push dword [esp + 0x1c]
push dword [ebp + 0x10]
push ebx
call fcn.00405d00
mov byte [esp + 0x10], 0
lea esi, [esp + 0x20]
call fcn.0040adcf
lea eax, [esp + 0x398]
push eax
call dword [sym.imp.KERNEL32.DLL_SetCurrentDirectoryA]
mov bl, byte [esp + 0x10]
jmp 0x406692