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

Disassembly:
mov eax, dword [esp + 8]
sub esp, 0x48
push ebx
push ebp
push esi
mov esi, ecx
push edi
mov ebx, dword [esi + 4]
mov dword [esi + 0x1f64], eax
mov eax, dword [esp + 0x5c]
test eax, eax
jne 0x401636
push eax
call fcn.00403480
jmp 0x40166f
cmp eax, 1
jne 0x40166f
mov eax, dword [esi + 8]
test eax, eax
jne 0x401652
push 0
mov ecx, esi
call fcn.004036d0
mov eax, dword [esi + 8]
test eax, eax
je 0x40166f
lea edi, [esi + 0x1f4c]
mov ecx, edi
call sub.MFC42.DLL_CString::LockBuffer
mov ecx, dword [esi + 8]
push eax
call fcn.00409f40
mov ecx, edi
call sub.MFC42.DLL_CString::UnlockBuffer
test ebx, ebx
je 0x40196d
mov ecx, dword [esi + 0x1f64]
lea edi, [esi + 0x1f50]
mov dword [esp + 0x60], ecx
mov ecx, edi
mov dword [esp + 0x14], edi
call sub.MFC42.DLL_CString::LockBuffer
add esi, 0x1f4c
mov dword [esp + 0x10], eax
mov ecx, esi
mov dword [esp + 0x18], esi
call sub.MFC42.DLL_CString::LockBuffer
push 0x4100c8
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
mov ebp, eax
add esp, 8
test ebp, ebp
je 0x40195f
push 0
push 0
push ebp
call dword [sym.imp.MSVCRT.dll_fseek]
mov esi, dword [sym.imp.MSVCRT.dll_fread]
push ebp
push 1
lea edx, [esp + 0x30]
push 0xe
push edx
call esi
push ebp
push 1
lea eax, [esp + 0x54]
push 0x28
push eax
call esi
mov edx, dword [esp + 0x60]
add esp, 0x2c
mov eax, edx
and eax, 0x80000007
jns 0x4016fe
dec eax
or eax, 0xfffffff8
inc eax
jne 0x401704
mov ecx, edx
jmp 0x40171a
mov ecx, 8
sub ecx, eax
and ecx, 0x80000007
jns 0x401718
dec ecx
or ecx, 0xfffffff8
inc ecx
add ecx, edx
mov esi, dword [esp + 0x38]
mov eax, esi
and eax, 0x80000007
jns 0x40172c
dec eax
or eax, 0xfffffff8
inc eax
jne 0x401732
mov eax, esi
jmp 0x401749
mov edi, 8
sub edi, eax
mov eax, edi
and eax, 0x80000007
jns 0x401747
dec eax
or eax, 0xfffffff8
inc eax
add eax, esi
mov dword [esp + 0x28], eax
mov dword [ebx + 0xc], eax
imul eax, ecx
mov word [esp + 0x2c], 0x18
mov dword [esp + 0x24], ecx
lea eax, [eax + eax*2]
mov dword [esp + 0x20], esi
push eax
mov dword [esp + 0x20], edx
mov dword [ebx + 0x10], edx
mov dword [ebx + 0x14], esi
mov dword [ebx + 8], ecx
call sub.MFC42.DLL_operatornew
sub esp, 0x10
mov ecx, 5
lea esi, [esp + 0x30]
mov edi, esp
rep movsd dword es:[edi], dword [esi]
push eax
push ebp
mov ecx, ebx
mov dword [esp + 0x78], eax
call fcn.00401980
push ebp
call dword [sym.imp.MSVCRT.dll_fclose]
mov esi, dword [ebx + 0xc]
mov byte [ebx], 0
imul esi, dword [ebx + 8]
push esi
mov byte [ebx + 1], 7
call sub.MFC42.DLL_operatornew
push esi
mov edi, eax
call sub.MFC42.DLL_operatornew
push esi
mov ebp, eax
call sub.MFC42.DLL_operatornew
mov ecx, dword [esp + 0x6c]
add esp, 0x10
mov esi, eax
push esi
push ebp
push edi
push ecx
mov ecx, ebx
call fcn.00401a50
mov edx, dword [ebx + 0xc]
mov eax, dword [ebx + 8]
push 8
push 8
push edx
push eax
push edi
mov ecx, ebx
call fcn.00401b70
mov ecx, dword [ebx + 0xc]
mov edx, dword [ebx + 8]
push 8
push 8
push ecx
push edx
push ebp
mov ecx, ebx
call fcn.00401b70
mov eax, dword [ebx + 0xc]
mov ecx, dword [ebx + 8]
push 8
push 8
push eax
push ecx
push esi
mov ecx, ebx
call fcn.00401b70
mov edx, dword [esp + 0x60]
lea eax, [ebx + 0x101c]
push edx
push eax
push 0x40c560
mov ecx, ebx
call fcn.00401ca0
mov ecx, dword [esp + 0x60]
lea edx, [ebx + 0x105c]
push ecx
push edx
push 0x40c5a0
mov ecx, ebx
call fcn.00401ca0
mov ecx, ebx
call fcn.00401d50
lea eax, [ebx + 0x817]
mov ecx, ebx
mov dword [ebx + 0x1018], eax
call fcn.004032d0
mov ecx, dword [esp + 0x10]
push 0x410020
push ecx
call dword [sym.imp.MSVCRT.dll_fopen]
add esp, 8
mov dword [ebx + 4], eax
test eax, eax
je 0x401938
push eax
push 1
push 2
push 0x40c7ce
call dword [sym.imp.MSVCRT.dll_fwrite]
add esp, 0x10
mov ecx, ebx
call fcn.00401e10
mov ecx, ebx
call fcn.00401e80
mov ecx, ebx
call fcn.00401f00
mov ecx, ebx
call fcn.00401fd0
mov ecx, ebx
call fcn.00402190
lea edx, [ebx + 0x129c]
mov ecx, ebx
push edx
push 0x40c634
push 0x40c620
call fcn.004021f0
lea eax, [ebx + 0x132c]
mov ecx, ebx
push eax
push 0x40c674
push 0x40c660
call fcn.004021f0
lea ecx, [ebx + 0x12e4]
push ecx
push 0x40c654
push 0x40c640
mov ecx, ebx
call fcn.004021f0
lea edx, [ebx + 0x192c]
mov ecx, ebx
push edx
push 0x40c72c
push 0x40c718
call fcn.004021f0
push esi
push ebp
push edi
mov ecx, ebx
call fcn.004022a0
mov eax, dword [ebx + 4]
push eax
push 1
push 2
push 0x40c7d0
call dword [sym.imp.MSVCRT.dll_fwrite]
mov ecx, dword [ebx + 4]
push ecx
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 0x14
mov edx, dword [esp + 0x5c]
push edx
call sub.MFC42.DLL_operatordelete
push edi
call sub.MFC42.DLL_operatordelete
push ebp
call sub.MFC42.DLL_operatordelete
push esi
call sub.MFC42.DLL_operatordelete
mov edi, dword [esp + 0x24]
mov esi, dword [esp + 0x28]
add esp, 0x10
mov ecx, esi
call sub.MFC42.DLL_CString::UnlockBuffer
mov ecx, edi
call sub.MFC42.DLL_CString::UnlockBuffer
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x48
ret 8