Function at 0x41ca60
Capabilities:
Get common file path
Read file on windows
Set console window title

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4940d7
mov eax, dword fs:[0]
push eax
sub esp, 0x648
mov eax, dword [0x4ae480]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov bl, dl
mov edi, ecx
push 0x430
lea eax, [ebp - 0x648]
mov dword [ebp - 0x654], 0
push 0
push eax
mov dword [ebp - 0x650], 0
call fcn.0047df00
add esp, 0xc
mov byte [ebp - 0x21a], 1
test bl, bl
je 0x41cb6c
cmp byte [0x4b3e64], 0
jne 0x41cb6c
call dword [sym.imp.KERNEL32.dll_AllocConsole]
test eax, eax
je 0x41ccdb
mov esi, dword [sym.imp.KERNEL32.dll_GetStdHandle]
push 0xfffffffffffffff5
mov word [ebp - 0x21c], 0x100
call esi
push 0xfffffffffffffff4
mov dword [ebp - 0x234], eax
call esi
push 0xfffffffffffffff6
mov dword [ebp - 0x230], eax
call esi
cmp dword [ebp - 0x234], 0
mov dword [ebp - 0x22c], eax
je 0x41ccdb
cmp dword [ebp - 0x230], 0
je 0x41ccdb
test eax, eax
je 0x41ccdb
lea ecx, [ebp - 0x650]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
mov eax, dword [ebp - 0x650]
or eax, 0xc0
push eax
push dword [ebp - 0x22c]
mov dword [ebp - 0x650], eax
call dword [sym.imp.KERNEL32.dll_SetConsoleMode]
push str.MPQEditor_Console
call dword [sym.imp.KERNEL32.dll_SetConsoleTitleW]
push 0x3c
call fcn.0047c49c
add esp, 4
mov dword [ebp - 0x64c], eax
mov dword [ebp - 4], 0
mov ecx, eax
push dword [0x4b3e54]
call fcn.0041faa0
mov dword [ebp - 4], 0xffffffff
mov dword [ebp - 0x648], eax
test eax, eax
je 0x41cd93
test edi, edi
je 0x41cbf9
movzx eax, word [edi]
mov ecx, eax
test ax, ax
je 0x41cbf9
xor eax, eax
cmp ax, cx
jae 0x41cbd4
mov eax, ecx
nop dword [eax]
cmp ax, 0x20
ja 0x41cbd4
movzx eax, word [edi + 2]
add edi, 2
xor ecx, ecx
cmp cx, ax
jb 0x41cbc0
movzx eax, word [edi]
mov ecx, eax
cmp eax, 0x2f
je 0x41cbe3
cmp ecx, 0x2d
jne 0x41cbe6
add edi, 2
mov edx, edi
lea ecx, [ebp - 0x648]
call fcn.0041c900
mov dword [ebp - 0x654], eax
cmp byte [ebp - 0x21a], 0
jne 0x41cd3c
nop word [eax + eax]
lea eax, [ebp - 0x218]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
lea eax, [ebp - 0x218]
push eax
lea eax, [ebp - 0x648]
push 0x4a643c
push eax
call fcn.004196d0
add esp, 0xc
xor edi, edi
mov ebx, 0x200
mov dword [ebp - 0x64c], edi
push 0x201
push 8
push dword [0x4b2a38]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov esi, eax
test esi, esi
je 0x41cd2f
push edi
lea eax, [ebp - 0x64c]
push eax
push ebx
push esi
push dword [ebp - 0x22c]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x41ccfc
add edi, dword [ebp - 0x64c]
mov ecx, esi
cmp dword [ebp - 0x64c], 0x200
jne 0x41ccfc
cmp byte [edi + esi - 1], 0xa
je 0x41ccf6
add ebx, 0x200
push ebx
push esi
push 8
push dword [0x4b2a38]
call dword [sym.imp.KERNEL32.dll_HeapReAlloc]
test eax, eax
je 0x41cce5
push 0
lea ecx, [ebp - 0x64c]
mov esi, eax
push ecx
push 0x200
add eax, edi
push eax
push dword [ebp - 0x22c]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x41cc81
jmp 0x41ccfc
mov eax, 0x1f
jmp 0x41cdc6
push esi
push 0
push dword [0x4b2a38]
call dword [sym.imp.KERNEL32.dll_HeapFree]
jmp 0x41cd2f
mov esi, ecx
test ecx, ecx
je 0x41cd2f
push 0
push esi
call fcn.0047bf00
push esi
push 0
push dword [0x4b2a38]
mov edi, eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
test edi, edi
je 0x41cd2f
mov edx, edi
lea ecx, [ebp - 0x648]
call fcn.0041c900
push edi
call fcn.004568b0
add esp, 4
cmp byte [ebp - 0x21a], 0
je 0x41cc10
mov eax, dword [ebp - 0x228]
test eax, eax
je 0x41cd4c
push eax
call fcn.00435720
mov edi, dword [ebp - 0x648]
mov dword [ebp - 0x228], 0
test edi, edi
je 0x41cd93
lea esi, [edi + 0x30]
cmp dword [esi], esi
je 0x41cd80
mov edx, dword [esi]
push edx
mov eax, dword [edx + 4]
mov ecx, dword [edx]
mov dword [eax], ecx
mov dword [ecx + 4], eax
call fcn.004568b0
add esp, 4
cmp dword [esi], esi
jne 0x41cd67
lea eax, [edi + 0x30]
push 0x3c
push edi
mov dword [eax + 4], eax
mov dword [eax], eax
call fcn.0047c4cc
add esp, 8
cmp byte [ebp - 0x21b], 0
jne 0x41cda5
cmp byte [ebp - 0x21c], 0
je 0x41cdc0
push dword [ebp - 0x234]
call dword [sym.imp.KERNEL32.dll_FlushConsoleInputBuffer]
cmp byte [ebp - 0x21b], 0
je 0x41cdc0
call dword [sym.imp.KERNEL32.dll_FreeConsole]
mov eax, dword [ebp - 0x654]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0047c26b
mov esp, ebp
pop ebp
ret