Function at 0x4099ee
Capabilities:
Get common file path
Get file size
Read file on windows
Set current directory
Write file on windows

Disassembly:
push ebp
sub esp, 0x180
lea ebp, [esp - 4]
mov eax, dword [0x466b10]
xor eax, ebp
mov dword [ebp + 0x180], eax
push 0x84
mov eax, 0x44aeea
call fcn.00433137
mov esi, ecx
mov dword [ebp - 0x14], esi
xor edi, edi
add esi, 0xa0
inc edi
mov ecx, esi
mov dword [ebp - 4], edi
call fcn.00408abe
xor ebx, ebx
push 0x103
lea eax, [ebp + 0x7d]
push ebx
push eax
mov dword [ebp - 0x2c], ebx
mov byte [ebp + 0x7c], bl
call fcn.004328f0
add esp, 0xc
lea eax, [ebp + 0x7c]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
sub esp, 0x1c
lea eax, [ebp + 0x1a8]
mov ecx, esp
mov dword [ebp - 0x1c], esp
push eax
call fcn.004019de
sub esp, 0x1c
lea eax, [ebp + 0x18c]
mov ecx, esp
mov dword [ebp - 0x24], esp
push eax
mov byte [ebp - 4], 2
call fcn.004019de
mov ecx, dword [ebp - 0x14]
mov byte [ebp - 4], 1
call fcn.004087f5
sub esp, 0x1c
lea eax, [ebp + 0x1a8]
mov ecx, esp
mov dword [ebp - 0x1c], esp
push eax
call fcn.004019de
mov ecx, dword [ebp - 0x14]
call fcn.004094f9
mov ecx, esi
call fcn.0040763b
test eax, eax
jne 0x409afa
mov byte [ebp - 0xd], bl
push ebx
push edi
lea ecx, [ebp + 0x18c]
call fcn.00401627
push ebx
push edi
lea ecx, [ebp + 0x1a8]
call fcn.00401627
mov al, byte [ebp - 0xd]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x180]
xor ecx, ebp
call fcn.00432980
add ebp, 0x184
leave
ret 0x38
push 0x44fc5c
lea eax, [ebp + 0x18c]
push eax
lea eax, [ebp - 0x58]
push eax
call fcn.00407f8e
lea ecx, [ebp + 0x1a8]
push ecx
push eax
lea eax, [ebp + 0x38]
push eax
mov byte [ebp - 4], 3
call fcn.00407fd5
push str..src
push eax
lea eax, [ebp + 0x1c]
push eax
mov byte [ebp - 4], 4
call fcn.00407f8e
add esp, 0x24
push ebx
push edi
lea ecx, [ebp + 0x38]
call fcn.00401627
push ebx
push edi
lea ecx, [ebp - 0x58]
mov byte [ebp - 4], 7
call fcn.00401627
push 0x44fc5c
lea eax, [ebp + 0x18c]
push eax
lea eax, [ebp - 0x74]
push eax
call fcn.00407f8e
lea ecx, [ebp + 0x1a8]
push ecx
push eax
lea eax, [ebp - 0x90]
push eax
mov byte [ebp - 4], 8
call fcn.00407fd5
push str..hdr
push eax
lea eax, [ebp]
push eax
mov byte [ebp - 4], 9
call fcn.00407f8e
add esp, 0x24
push ebx
push edi
lea ecx, [ebp - 0x90]
call fcn.00401627
push ebx
push edi
lea ecx, [ebp - 0x74]
mov byte [ebp - 4], 0xc
call fcn.00401627
cmp dword [ebp + 0x1a4], 0x10
mov eax, dword [ebp + 0x190]
jae 0x409bc5
lea eax, [ebp + 0x190]
mov ecx, dword [ebp - 0x14]
push eax
call fcn.00409f3a
cmp dword [ebp + 0x34], 0x10
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp + 0x20]
jae 0x409bdd
lea eax, [ebp + 0x20]
push ebx
push 0x80
push 3
push ebx
push ebx
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x18], eax
mov eax, dword [esi + 4]
push esi
push eax
lea ecx, [ebp - 0x34]
call fcn.0040bfda
mov eax, dword [esi + 8]
push esi
push eax
lea ecx, [ebp - 0x3c]
call fcn.0040bfda
cmp dword [ebp - 0x18], 0xffffffff
je 0x409dd2
push ebx
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0x28], eax
jmp 0x409d75
push ebx
lea ecx, [ebp + 0x54]
mov dword [ebp + 0x6c], 0xf
call fcn.0040155f
lea ecx, [ebp - 0x34]
mov byte [ebp - 4], 0xd
call fcn.0040768e
push 0xffffffffffffffff
push ebx
push eax
lea ecx, [ebp + 0x54]
call fcn.004018b9
mov eax, dword [ebp - 0x1c]
mov dword [ebp + 0x70], eax
push 0x44fc5c
lea eax, [ebp + 0x18c]
push eax
lea eax, [ebp - 0x58]
push eax
call fcn.00407f8e
lea ecx, [ebp + 0x54]
push ecx
push eax
lea eax, [ebp + 0x38]
push eax
mov byte [ebp - 4], 0xe
call fcn.00407fd5
add esp, 0x18
push ebx
push edi
lea ecx, [ebp - 0x58]
mov byte [ebp - 4], 0x10
call fcn.00401627
cmp dword [ebp + 0x50], 0x10
mov eax, dword [ebp + 0x3c]
jae 0x409c9e
lea eax, [ebp + 0x3c]
push ebx
push 0x80
push 3
push ebx
push edi
push SysReAllocStringLen
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebp - 0x24], eax
je 0x409d4c
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
lea eax, [esi + 1]
push eax
call fcn.00435fc3
pop ecx
push ebx
lea ecx, [ebp - 0x2c]
push ecx
push esi
push eax
push dword [ebp - 0x24]
mov dword [ebp - 0x20], eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
push 2
push ebx
push ebx
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebx
lea eax, [ebp - 0x2c]
push eax
push esi
push dword [ebp - 0x20]
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push dword [ebp - 0x20]
call fcn.00436086
mov eax, dword [ebp - 0x28]
add dword [ebp - 0x28], esi
cmp dword [ebp + 0x6c], 0x10
mov dword [ebp + 0x74], eax
mov eax, dword [ebp + 0x58]
pop ecx
mov dword [ebp + 0x78], esi
jae 0x409d27
lea eax, [ebp + 0x58]
mov esi, dword [ebp - 0x14]
push eax
mov ecx, esi
call fcn.00409f3a
mov dword [ebp - 0x20], eax
lea eax, [ebp + 0x54]
push eax
lea eax, [ebp - 0x20]
push eax
lea ecx, [esi + 0x28]
call fcn.00408a0e
mov ecx, eax
call fcn.00407ef1
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
push edi
lea ecx, [ebp + 0x38]
call fcn.00401627
push ebx
push edi
lea ecx, [ebp + 0x54]
mov byte [ebp - 4], 0xc
call fcn.00401627
lea ecx, [ebp - 0x34]
call fcn.004076d3
lea eax, [ebp - 0x3c]
push eax
lea ecx, [ebp - 0x34]
call fcn.00407667
test al, al
je 0x409c2c
lea eax, [ebp + 0x7c]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 0x1c
lea eax, [ebp]
mov ecx, esp
mov dword [ebp - 0x1c], esp
push eax
call fcn.004019de
mov ecx, dword [ebp - 0x14]
call fcn.00407bcf
push ebx
push edi
lea ecx, [ebp]
call fcn.00401627
push ebx
push edi
lea ecx, [ebp + 0x1c]
call fcn.00401627
mov byte [ebp - 0xd], 1
jmp 0x409ab8
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [ebp + 0x7c]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
mov ecx, dword [ebp - 0x14]
add ecx, 0x28
call fcn.00408256
push ebx
push edi
lea ecx, [ebp]
call fcn.00401627
push ebx
push edi
lea ecx, [ebp + 0x1c]
call fcn.00401627
jmp 0x409ab5