Function at 0x409180
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x44849b
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x130
mov eax, dword [0x468a18]
push ebx
push esi
push edi
mov esi, ecx
push 0x4000
mov dword [esp + 0x138], eax
mov dword [esp + 0x1c], esi
call sub.MFC71U.DLL_SerializeElements
add esp, 4
mov ebx, eax
mov eax, dword [ebp + 8]
push ebx
xor edi, edi
push eax
mov ecx, esi
mov dword [esp + 0x30], edi
call fcn.004087b0
cmp eax, edi
je 0x4091e8
mov dword [esp + 0x14], 1
jmp 0x40938c
mov edx, dword [ebp + 8]
push edi
lea ecx, [esp + 0x2c]
push ecx
push edi
push edx
mov dword [esp + 0x24], edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp dword [esi + 0x60], edi
je 0x40927c
mov al, byte [ebp + 0x28]
test al, al
je 0x40927c
lea ecx, [esp + 0x1c]
call fcn.00408b90
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], edi
mov eax, dword [ebp + 0x10]
push eax
lea ecx, [esp + 0x20]
push ecx
mov ecx, esi
mov dword [esp + 0x14c], edi
call fcn.00409090
mov edx, dword [ebp + 0x24]
mov eax, dword [ebp + 0x20]
mov ecx, dword [ebp + 0x1c]
push edx
mov edx, dword [ebp + 0x18]
push eax
push ecx
push edx
lea eax, [esp + 0x2c]
push eax
push ebx
mov ecx, esi
call fcn.00408960
mov esi, dword [esp + 0x20]
mov eax, dword [esi]
cmp eax, esi
mov dword [esi], esi
mov dword [esi + 4], esi
je 0x409271
lea ecx, [ecx]
mov edi, dword [eax]
push eax
call sub.MFC71U.DLL_CNoTrackObject::operator_new
add esp, 4
cmp edi, esi
mov eax, edi
jne 0x409260
push esi
call sub.MFC71U.DLL_CNoTrackObject::operator_new
add esp, 4
jmp 0x409298
mov ecx, dword [ebp + 0x24]
mov edx, dword [ebp + 0x20]
mov eax, dword [ebp + 0x1c]
push ecx
mov ecx, dword [ebp + 0x18]
push edx
mov edx, dword [ebp + 0x10]
push eax
push ecx
push edx
push ebx
mov ecx, esi
call fcn.00408960
mov ecx, 0x800
mov esi, ebx
lea edi, [ebx + 0x2000]
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [esp + 0x18]
lea eax, [ebx + 0x24]
push 0x14
mov edx, ebx
add ecx, 0x28
sub edx, eax
push ecx
add edx, 0x2000
push edx
push eax
call fcn.0040a4e0
mov ecx, dword [ebp + 0xc]
add esp, 0x10
push 0
lea eax, [esp + 0x14]
push eax
push 0x4000
push ebx
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x409384
xor eax, eax
mov byte [esp + 0x30], 0
mov ecx, 0x3f
lea edi, [esp + 0x31]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
push 0x100
lea edx, [esp + 0x34]
push edx
stosb byte es:[edi], al
mov eax, dword [ebp + 0x14]
push 0x14
push eax
call fcn.0040a840
mov esi, dword [ebp + 8]
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
add esp, 0x10
push 0
lea ecx, [esp + 0x14]
push ecx
push 0x2000
push ebx
push esi
call edi
test eax, eax
je 0x40938c
mov eax, dword [esp + 0x10]
push 0x100
lea edx, [esp + 0x34]
push edx
push eax
push ebx
call fcn.0040a810
mov edx, dword [esp + 0x20]
mov eax, dword [ebp + 0xc]
add esp, 0x10
push 0
lea ecx, [esp + 0x30]
push ecx
push edx
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x409384
cmp dword [esp + 0x10], 0x2000
jb 0x40938c
push 0
lea ecx, [esp + 0x14]
push ecx
push 0x2000
push ebx
push esi
call edi
test eax, eax
jne 0x409331
jmp 0x40938c
mov dword [esp + 0x14], 0xfffffffe
push ebx
call sub.MFC71U.DLL_operator_new
mov ecx, dword [esp + 0x140]
mov eax, dword [esp + 0x18]
mov dword fs:[0], ecx
mov ecx, dword [esp + 0x138]
add esp, 4
call fcn.0043cfa9
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x24