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

Disassembly:
mov eax, 0x43cc62
call fcn.0041d79c
sub esp, 0x1d0
push ebx
push esi
push edi
mov dword [ebp - 0x1c], ecx
mov eax, dword [ecx + 0x9c]
lea esi, [ecx + 0x94]
push eax
mov dword [ebp - 4], 1
mov ecx, dword [esi + 4]
push ecx
mov ecx, esi
call fcn.00402cf2
push 0x40
xor ebx, ebx
pop ecx
xor eax, eax
lea edi, [ebp - 0x1db]
mov byte [ebp - 0x1dc], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [ebp - 0x1dc]
mov dword [ebp - 0x18], ebx
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
mov al, byte [ebp + 0x18]
sub esp, 0x10
mov edi, esp
mov dword [ebp - 0x30], esp
push ebx
mov ecx, edi
mov byte [edi], al
call fcn.00402b70
push dword [0x44067c]
lea eax, [ebp + 0x18]
mov ecx, edi
push ebx
push eax
call fcn.00402a76
sub esp, 0x10
lea eax, [ebp + 8]
mov ecx, esp
mov dword [ebp - 0x28], esp
push eax
mov byte [ebp - 4], 2
call fcn.0040298a
mov ecx, dword [ebp - 0x1c]
mov byte [ebp - 4], 1
call fcn.004016af
mov al, byte [ebp + 0x18]
sub esp, 0x10
mov edi, esp
mov dword [ebp - 0x30], esp
push ebx
mov ecx, edi
mov byte [edi], al
call fcn.00402b70
push dword [0x44067c]
lea eax, [ebp + 0x18]
mov ecx, edi
push ebx
push eax
call fcn.00402a76
mov edi, dword [ebp - 0x1c]
mov ecx, edi
call fcn.004011a3
mov eax, dword [esi + 4]
cmp eax, ebx
je 0x401e16
mov ecx, dword [esi + 8]
sub ecx, eax
test ecx, 0xfffffff0
jne 0x401e1e
mov byte [ebp - 0xd], bl
jmp 0x402190
mov esi, 0x44e1c8
lea eax, [ebp + 8]
push esi
push eax
lea eax, [ebp - 0xd8]
push eax
call fcn.00403714
lea ecx, [ebp + 0x18]
mov byte [ebp - 4], 3
push ecx
push eax
lea eax, [ebp - 0xc8]
push eax
call fcn.0040379d
push str..src
push eax
lea eax, [ebp - 0x88]
mov byte [ebp - 4], 4
push eax
call fcn.00403714
add esp, 0x24
push 1
lea ecx, [ebp - 0xc8]
mov byte [ebp - 4], 7
call fcn.00402b70
push 1
lea ecx, [ebp - 0xd8]
mov byte [ebp - 4], 6
call fcn.00402b70
lea eax, [ebp + 8]
push esi
push eax
lea eax, [ebp - 0x98]
push eax
call fcn.00403714
lea ecx, [ebp + 0x18]
mov byte [ebp - 4], 8
push ecx
push eax
lea eax, [ebp - 0xb8]
push eax
call fcn.0040379d
push str..hdr
push eax
lea eax, [ebp - 0x78]
mov byte [ebp - 4], 9
push eax
call fcn.00403714
add esp, 0x24
push 1
lea ecx, [ebp - 0xb8]
mov byte [ebp - 4], 0xc
call fcn.00402b70
push 1
lea ecx, [ebp - 0x98]
mov byte [ebp - 4], 0xb
call fcn.00402b70
mov eax, dword [ebp + 0xc]
cmp eax, ebx
jne 0x401eee
mov eax, 0x440680
push eax
mov ecx, edi
call fcn.00404087
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x84]
cmp eax, ebx
jne 0x401f08
mov eax, 0x440680
push ebx
push 0x80
push 3
push ebx
push ebx
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ecx, dword [edi + 0x98]
cmp eax, ebx
mov dword [ebp - 0x20], ecx
mov ecx, dword [edi + 0x9c]
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x38], ecx
push ebx
je 0x402153
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
mov eax, dword [ebp - 0x38]
cmp dword [ebp - 0x20], eax
je 0x402109
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
mov al, byte [ebp + 0x27]
push ebx
lea ecx, [ebp - 0x58]
mov byte [ebp - 0x58], al
call fcn.00402b70
push dword [0x44067c]
lea ecx, [ebp - 0x58]
mov byte [ebp - 4], 0xd
push ebx
push dword [ebp - 0x20]
call fcn.00402a76
mov eax, dword [ebp - 0x28]
push 0x44e1c8
mov dword [ebp - 0x48], eax
lea eax, [ebp + 8]
push eax
lea eax, [ebp - 0xa8]
push eax
call fcn.00403714
lea ecx, [ebp - 0x58]
mov byte [ebp - 4], 0xe
push ecx
push eax
lea eax, [ebp - 0x68]
push eax
call fcn.0040379d
add esp, 0x18
push 1
lea ecx, [ebp - 0xa8]
mov byte [ebp - 4], 0x10
call fcn.00402b70
mov eax, dword [ebp - 0x64]
cmp eax, ebx
jne 0x401fc9
mov eax, 0x440680
push ebx
push 0x80
push 3
push ebx
push 1
push 0x10000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebp - 0x34], eax
je 0x4020d1
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0x24], eax
inc eax
push eax
call fcn.0041daf1
pop ecx
mov dword [ebp - 0x3c], eax
lea ecx, [ebp - 0x18]
push ebx
push ecx
push dword [ebp - 0x24]
push eax
push dword [ebp - 0x34]
call dword [sym.imp.KERNEL32.dll_ReadFile]
push 2
push ebx
push ebx
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [ebp - 0x60]
push ebx
mov dword [ebp - 0x2c], eax
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0x2c]
push 4
push eax
push dword [ebp - 0x14]
call edi
mov eax, dword [ebp - 0x64]
cmp eax, ebx
jne 0x402043
mov eax, 0x440680
lea ecx, [ebp - 0x18]
push ebx
push ecx
push dword [ebp - 0x2c]
push eax
push dword [ebp - 0x14]
call edi
lea eax, [ebp - 0x18]
push ebx
push eax
lea eax, [ebp - 0x24]
push 4
push eax
push dword [ebp - 0x14]
call edi
lea eax, [ebp - 0x18]
push ebx
push eax
mov eax, dword [ebp - 0x1c]
add eax, 0x70
push 4
push eax
push dword [ebp - 0x14]
call edi
lea eax, [ebp - 0x18]
push ebx
push eax
push dword [ebp - 0x24]
push dword [ebp - 0x3c]
push dword [ebp - 0x14]
call edi
push dword [ebp - 0x3c]
call fcn.0041da08
mov eax, dword [ebp - 0x24]
pop ecx
mov ecx, dword [ebp - 0x2c]
mov dword [ebp - 0x40], eax
lea esi, [esi + ecx + 0xc]
mov dword [ebp - 0x44], esi
add esi, eax
mov eax, dword [ebp - 0x54]
cmp eax, ebx
jne 0x4020ab
mov eax, 0x440680
mov ecx, dword [ebp - 0x1c]
push eax
call fcn.00404087
mov dword [ebp - 0x30], eax
lea eax, [ebp - 0x58]
push eax
lea eax, [ebp - 0x30]
push eax
mov eax, dword [ebp - 0x1c]
lea ecx, [eax + 0x28]
call fcn.004029b4
mov ecx, eax
call fcn.00401cf8
push dword [ebp - 0x34]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 1
lea ecx, [ebp - 0x68]
mov byte [ebp - 4], 0xd
call fcn.00402b70
push 1
lea ecx, [ebp - 0x58]
mov byte [ebp - 4], 0xb
call fcn.00402b70
add dword [ebp - 0x20], 0x10
mov eax, dword [ebp - 0x20]
cmp eax, dword [ebp - 0x38]
jne 0x401f57
mov edi, dword [ebp - 0x1c]
lea eax, [ebp - 0x1dc]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, byte [ebp - 0x78]
sub esp, 0x10
mov esi, esp
mov dword [ebp - 0x28], esp
push ebx
mov ecx, esi
mov byte [esi], al
call fcn.00402b70
push dword [0x44067c]
lea eax, [ebp - 0x78]
mov ecx, esi
push ebx
push eax
call fcn.00402a76
mov ecx, edi
call fcn.004026f2
mov byte [ebp - 0xd], 1
jmp 0x402171
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [ebp - 0x1dc]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
lea ecx, [edi + 0x28]
call fcn.00402c4a
mov byte [ebp - 0xd], bl
push 1
lea ecx, [ebp - 0x78]
mov byte [ebp - 4], 6
call fcn.00402b70
push 1
lea ecx, [ebp - 0x88]
mov byte [ebp - 4], 1
call fcn.00402b70
push 1
lea ecx, [ebp + 8]
mov byte [ebp - 4], bl
call fcn.00402b70
or dword [ebp - 4], 0xffffffff
push 1
lea ecx, [ebp + 0x18]
call fcn.00402b70
mov ecx, dword [ebp - 0xc]
mov al, byte [ebp - 0xd]
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
leave
ret 0x20