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

Disassembly:
push 0xffffffffffffffff
push 0x459f9a
mov eax, dword fs:[0]
push eax
sub esp, 0x1cc
mov eax, dword [0x477c1c]
xor eax, esp
mov dword [esp + 0x1c8], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x477c1c]
xor eax, esp
push eax
lea eax, [esp + 0x1e0]
mov dword fs:[0], eax
mov dword [esp + 0x14], ecx
mov dword [esp + 0x1e8], 1
mov ebx, dword [ecx + 0xe8]
cmp dword [ecx + 0xe4], ebx
lea esi, [ecx + 0xd8]
jbe 0x411d03
call fcn.004408d8
mov ebp, dword [esi + 0xc]
mov edi, dword [esi]
cmp ebp, dword [esi + 0x10]
jbe 0x411d12
call fcn.004408d8
mov eax, dword [esi]
push ebx
push edi
push ebp
push eax
lea eax, [esp + 0x64]
push eax
mov ecx, esi
call fcn.0040f840
xor ebx, ebx
push 0x103
lea ecx, [esp + 0xdd]
push ebx
push ecx
mov dword [esp + 0x3c], ebx
mov byte [esp + 0xe4], bl
call fcn.00440d10
add esp, 0xc
lea edx, [esp + 0xd8]
push edx
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x38], esp
push 0xffffffffffffffff
push ebx
lea eax, [esp + 0x230]
mov edi, 0xf
mov dword [ecx + 0x18], edi
mov dword [ecx + 0x14], ebx
push eax
mov byte [ecx + 4], bl
call fcn.00401cc0
mov byte [esp + 0x204], 2
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x64], esp
push 0xffffffffffffffff
push ebx
lea edx, [esp + 0x230]
mov dword [ecx + 0x18], edi
mov dword [ecx + 0x14], ebx
push edx
mov byte [ecx + 4], bl
call fcn.00401cc0
mov byte [esp + 0x220], 3
mov byte [esp + 0x220], 1
mov ebp, dword [esp + 0x4c]
mov ecx, ebp
call fcn.0040fb20
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x38], esp
push 0xffffffffffffffff
push ebx
lea eax, [esp + 0x230]
mov dword [ecx + 0x18], edi
mov dword [ecx + 0x14], ebx
push eax
mov byte [ecx + 4], bl
call fcn.00401cc0
mov byte [esp + 0x204], 4
mov byte [esp + 0x204], 1
mov ecx, ebp
call fcn.004111d0
mov ecx, dword [esi + 0x10]
sub ecx, dword [esi + 0xc]
mov eax, 0x92492493
imul ecx
add edx, ecx
sar edx, 4
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
jne 0x411e79
mov byte [esp + 0x1e8], bl
mov esi, 0x10
cmp dword [esp + 0x208], esi
jb 0x411e3f
mov edx, dword [esp + 0x1f4]
push edx
call fcn.00421b49
add esp, 4
mov dword [esp + 0x208], edi
mov dword [esp + 0x204], ebx
mov byte [esp + 0x1f4], bl
mov dword [esp + 0x1e8], 0xffffffff
cmp dword [esp + 0x224], esi
jb 0x4124c0
mov eax, dword [esp + 0x210]
push eax
jmp 0x4124b8
push 0x45ecf4
lea ecx, [esp + 0x1f4]
push ecx
lea edx, [esp + 0x3c]
push edx
call fcn.00409410
mov byte [esp + 0x1f4], 5
lea ecx, [esp + 0x218]
push ecx
push eax
lea edx, [esp + 0x70]
push edx
call fcn.004094f0
mov byte [esp + 0x200], 6
push str..src
push eax
lea eax, [esp + 0x98]
push eax
call fcn.00409410
add esp, 0x24
mov byte [esp + 0x1e8], 8
cmp dword [esp + 0x74], 0x10
jb 0x411ee5
mov ecx, dword [esp + 0x60]
push ecx
call fcn.00421b49
add esp, 4
mov dword [esp + 0x74], edi
mov dword [esp + 0x70], ebx
mov byte [esp + 0x60], bl
mov byte [esp + 0x1e8], 9
cmp dword [esp + 0x4c], 0x10
jb 0x411f0d
mov edx, dword [esp + 0x38]
push edx
call fcn.00421b49
add esp, 4
push 0x45ecf4
lea eax, [esp + 0x1f4]
push eax
lea ecx, [esp + 0x64]
push ecx
mov dword [esp + 0x58], edi
mov dword [esp + 0x54], ebx
mov byte [esp + 0x44], bl
call fcn.00409410
mov byte [esp + 0x1f4], 0xa
lea edx, [esp + 0x218]
push edx
push eax
lea eax, [esp + 0x48]
push eax
call fcn.004094f0
mov byte [esp + 0x200], 0xb
push str..hdr
push eax
lea ecx, [esp + 0xb4]
push ecx
call fcn.00409410
add esp, 0x24
mov byte [esp + 0x1e8], 0xd
cmp dword [esp + 0x4c], 0x10
jb 0x411f85
mov edx, dword [esp + 0x38]
push edx
call fcn.00421b49
add esp, 4
mov dword [esp + 0x4c], edi
mov dword [esp + 0x48], ebx
mov byte [esp + 0x38], bl
mov byte [esp + 0x1e8], 0xe
cmp dword [esp + 0x74], 0x10
jb 0x411fad
mov eax, dword [esp + 0x60]
push eax
call fcn.00421b49
add esp, 4
cmp dword [esp + 0x208], 0x10
mov eax, dword [esp + 0x1f4]
mov dword [esp + 0x74], edi
mov dword [esp + 0x70], ebx
mov byte [esp + 0x60], bl
jae 0x411fd1
lea eax, [esp + 0x1f4]
push eax
mov ecx, ebp
call fcn.00412800
cmp dword [esp + 0x90], 0x10
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x7c]
jae 0x411fef
lea eax, [esp + 0x7c]
push ebx
push 0x80
push 3
push ebx
push ebx
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebp, dword [esi + 0xc]
mov dword [esp + 0x18], eax
cmp ebp, dword [esi + 0x10]
jbe 0x412016
call fcn.004408d8
mov eax, dword [esi + 0x10]
mov ecx, dword [esi]
mov dword [esp + 0x20], ecx
mov dword [esp + 0x24], ebp
mov dword [esp + 0x50], eax
cmp dword [esi + 0xc], eax
jbe 0x412031
call fcn.004408d8
mov eax, dword [esp + 0x18]
mov edx, dword [esi]
mov dword [esp + 0x54], edx
cmp eax, 0xffffffff
je 0x4123bd
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [esp + 0x28], eax
mov esi, dword [esp + 0x20]
cmp esi, ebx
je 0x41205e
cmp esi, dword [esp + 0x54]
je 0x412063
call fcn.004408d8
cmp ebp, dword [esp + 0x50]
je 0x41229e
mov dword [esp + 0xc8], edi
mov dword [esp + 0xc4], ebx
mov byte [esp + 0xb4], bl
mov byte [esp + 0x1e8], 0x10
cmp esi, ebx
jne 0x412293
call fcn.004408d8
xor eax, eax
cmp ebp, dword [eax + 0x10]
jb 0x4120a3
call fcn.004408d8
push 0xffffffffffffffff
push ebx
push ebp
lea ecx, [esp + 0xbc]
call fcn.00401cc0
mov eax, dword [esp + 0x2c]
push 0x45ecf4
lea ecx, [esp + 0x1f4]
push ecx
lea edx, [esp + 0x3c]
push edx
mov dword [esp + 0xd8], eax
call fcn.00409410
mov byte [esp + 0x1f4], 0x11
lea ecx, [esp + 0xbc]
push ecx
push eax
lea edx, [esp + 0x70]
push edx
call fcn.004094f0
add esp, 0x18
mov byte [esp + 0x1e8], 0x13
mov ebp, 0x10
cmp dword [esp + 0x4c], ebp
jb 0x412113
mov eax, dword [esp + 0x38]
push eax
call fcn.00421b49
add esp, 4
mov eax, dword [esp + 0x60]
mov dword [esp + 0x4c], edi
mov dword [esp + 0x48], ebx
mov byte [esp + 0x38], bl
cmp dword [esp + 0x74], ebp
jae 0x41212d
lea eax, [esp + 0x60]
push ebx
push 0x80
push 3
push ebx
push 1
push SysReAllocString
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebp, eax
cmp ebp, 0xffffffff
je 0x412229
push ebx
push ebp
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
lea ecx, [esi + 1]
push ecx
call fcn.00442266
add esp, 4
push ebx
lea edx, [esp + 0x34]
push edx
push esi
mov edi, eax
push edi
push ebp
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [esp + 0x18]
push 2
push ebx
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edx, dword [esp + 0x18]
push ebx
lea ecx, [esp + 0x34]
push ecx
push esi
push edi
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
push edi
call fcn.00442189
mov eax, dword [esp + 0x2c]
mov dword [esp + 0xd4], eax
add eax, esi
add esp, 4
cmp dword [esp + 0xc8], 0x10
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0xb4]
mov dword [esp + 0xd4], esi
jae 0x4121d1
lea eax, [esp + 0xb4]
mov esi, dword [esp + 0x14]
push eax
mov ecx, esi
call fcn.00412800
mov dword [esp + 0x1c], eax
lea eax, [esp + 0x1c]
push eax
lea ecx, [esi + 0x28]
call fcn.0040ff60
push 0xffffffffffffffff
push ebx
lea ecx, [esp + 0xb8]
mov esi, eax
push ecx
mov ecx, esi
call fcn.00401cc0
mov edx, dword [esp + 0xcc]
mov dword [esi + 0x1c], edx
mov eax, dword [esp + 0xd0]
mov dword [esi + 0x20], eax
mov ecx, dword [esp + 0xd4]
mov dword [esi + 0x24], ecx
mov esi, dword [esp + 0x20]
mov edi, 0xf
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov byte [esp + 0x1e8], 0x10
cmp dword [esp + 0x74], 0x10
jb 0x41224c
mov edx, dword [esp + 0x60]
push edx
call fcn.00421b49
add esp, 4
mov dword [esp + 0x74], edi
mov dword [esp + 0x70], ebx
mov byte [esp + 0x60], bl
mov byte [esp + 0x1e8], 0xe
lea ecx, [esp + 0xb0]
call fcn.0040e480
cmp esi, ebx
jne 0x41229a
call fcn.004408d8
xor eax, eax
mov ecx, dword [esp + 0x24]
cmp ecx, dword [eax + 0x10]
jb 0x412285
call fcn.004408d8
add dword [esp + 0x24], 0x1c
mov ebp, dword [esp + 0x24]
jmp 0x412050
mov eax, dword [esi]
jmp 0x412099
mov eax, dword [esi]
jmp 0x412277
lea edx, [esp + 0xd8]
push edx
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
mov eax, dword [esp + 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x38], esp
push 0xffffffffffffffff
push ebx
lea edx, [esp + 0xb8]
mov dword [ecx + 0x18], edi
mov dword [ecx + 0x14], ebx
push edx
mov byte [ecx + 4], bl
call fcn.00401cc0
mov byte [esp + 0x204], 0x14
mov byte [esp + 0x204], 0xe
mov ecx, dword [esp + 0x30]
call fcn.0040e710
mov byte [esp + 0x1e8], 9
mov esi, 0x10
cmp dword [esp + 0xac], esi
jb 0x412318
mov eax, dword [esp + 0x98]
push eax
call fcn.00421b49
add esp, 4
mov dword [esp + 0xac], edi
mov dword [esp + 0xa8], ebx
mov byte [esp + 0x98], bl
mov byte [esp + 0x1e8], 1
cmp dword [esp + 0x90], esi
jb 0x41234b
mov ecx, dword [esp + 0x7c]
push ecx
call fcn.00421b49
add esp, 4
mov dword [esp + 0x90], edi
mov dword [esp + 0x8c], ebx
mov byte [esp + 0x7c], bl
mov byte [esp + 0x1e8], bl
cmp dword [esp + 0x208], esi
jb 0x41237d
mov edx, dword [esp + 0x1f4]
push edx
call fcn.00421b49
add esp, 4
mov dword [esp + 0x208], edi
mov dword [esp + 0x204], ebx
mov byte [esp + 0x1f4], bl
mov dword [esp + 0x1e8], 0xffffffff
cmp dword [esp + 0x224], esi
jb 0x4123b6
mov eax, dword [esp + 0x210]
push eax
call fcn.00421b49
add esp, 4
mov al, 1
jmp 0x4124c2
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [esp + 0xd8]
push ecx
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
mov esi, dword [esp + 0x14]
mov edx, dword [esi + 0x40]
mov eax, dword [edx + 4]
add esi, 0x28
push eax
mov ecx, esi
call fcn.0040ef10
mov eax, dword [esi + 0x18]
mov dword [eax + 4], eax
mov eax, dword [esi + 0x18]
mov dword [esi + 0x1c], ebx
mov dword [eax], eax
mov esi, dword [esi + 0x18]
mov dword [esi + 8], esi
mov byte [esp + 0x1e8], 9
mov esi, 0x10
cmp dword [esp + 0xac], esi
jb 0x412422
mov ecx, dword [esp + 0x98]
push ecx
call fcn.00421b49
add esp, 4
mov dword [esp + 0xac], edi
mov dword [esp + 0xa8], ebx
mov byte [esp + 0x98], bl
mov byte [esp + 0x1e8], 1
cmp dword [esp + 0x90], esi
jb 0x412455
mov edx, dword [esp + 0x7c]
push edx
call fcn.00421b49
add esp, 4
mov dword [esp + 0x90], edi
mov dword [esp + 0x8c], ebx
mov byte [esp + 0x7c], bl
mov byte [esp + 0x1e8], bl
cmp dword [esp + 0x208], esi
jb 0x412487
mov eax, dword [esp + 0x1f4]
push eax
call fcn.00421b49
add esp, 4
mov dword [esp + 0x208], edi
mov dword [esp + 0x204], ebx
mov byte [esp + 0x1f4], bl
mov dword [esp + 0x1e8], 0xffffffff
cmp dword [esp + 0x224], esi
jb 0x4124c0
mov ecx, dword [esp + 0x210]
push ecx
call fcn.00421b49
add esp, 4
xor al, al
mov dword [esp + 0x224], edi
mov dword [esp + 0x220], ebx
mov byte [esp + 0x210], bl
mov ecx, dword [esp + 0x1e0]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x1c8]
xor ecx, esp
call fcn.0044014d
add esp, 0x1d8
ret 0x38