Function at 0x431215
Capabilities:
Get file size
Read file via mapping
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x124
push ebx
push esi
mov esi, ecx
push edi
mov ecx, dword [ebp + 8]
and byte [ebp - 5], 0
mov eax, dword [esi + 0x118]
mov edi, ecx
lea ebx, [ecx + ecx*2]
shl ebx, 2
shl edi, 2
mov eax, dword [ebx + eax + 4]
mov dword [ebp - 0x20], ebx
add eax, dword [ebp + 0xc]
mov dword [ebp - 0x1c], eax
shl eax, 2
mov dword [ebp - 4], eax
push eax
mov eax, dword [esi + 0x134]
push dword [edi + eax]
call dword [sym.imp.MSVCRT.dll_realloc]
pop ecx
test eax, eax
pop ecx
jne 0x431280
push dword [ebp - 4]
push str.CTranLog::IncreaseSegments_realloc__d__return_NULL
push 0x7d1
push 0
call fcn.00426a9a
add esp, 0x10
jmp 0x431589
mov ecx, dword [esi + 0x134]
mov dword [edi + ecx], eax
mov eax, dword [ebp + 0xc]
mov ecx, dword [esi + 0x134]
shl eax, 2
mov ecx, dword [edi + ecx]
push eax
mov eax, dword [esi + 0x118]
push 0
mov eax, dword [ebx + eax + 4]
lea eax, [ecx + eax*4]
push eax
call sub.MSVCRT.dll_memset
push dword [ebp - 4]
mov eax, dword [esi + 0x138]
push dword [edi + eax]
call dword [sym.imp.MSVCRT.dll_realloc]
add esp, 0x14
test eax, eax
je 0x431264
mov ecx, dword [esi + 0x138]
mov dword [edi + ecx], eax
mov eax, dword [ebp + 0xc]
mov ecx, dword [esi + 0x138]
shl eax, 2
mov ecx, dword [edi + ecx]
push eax
mov eax, dword [esi + 0x118]
push 0
mov eax, dword [ebx + eax + 4]
lea eax, [ecx + eax*4]
push eax
call sub.MSVCRT.dll_memset
push dword [ebp - 4]
mov eax, dword [esi + 0x13c]
push dword [edi + eax]
call dword [sym.imp.MSVCRT.dll_realloc]
add esp, 0x14
test eax, eax
je 0x431264
mov ecx, dword [esi + 0x13c]
mov dword [edi + ecx], eax
mov eax, dword [ebp + 0xc]
mov ecx, dword [esi + 0x13c]
shl eax, 2
mov ecx, dword [edi + ecx]
push eax
mov eax, dword [esi + 0x118]
push 0
mov eax, dword [ebx + eax + 4]
lea eax, [ecx + eax*4]
push eax
call sub.MSVCRT.dll_memset
mov eax, dword [esi + 0x118]
add esp, 0xc
mov eax, dword [ebx + eax + 4]
cmp eax, dword [ebp - 0x1c]
mov dword [ebp - 4], eax
jge 0x431574
jmp 0x43135e
mov eax, dword [ebp - 4]
push eax
lea eax, [esi + 4]
push dword [ebp + 8]
push dword [esi + 0x108]
push eax
lea eax, [ebp - 0x124]
push str._sTranLog_010d_010d_d.dat
push eax
call dword [sym.imp.MSVCRT.dll_sprintf]
mov eax, dword [ebp - 4]
add esp, 0x18
mov ebx, eax
lea eax, [ebp - 0x124]
push 0
push bind
push 4
push 0
push 3
push 0xc0000000
push eax
shl ebx, 2
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ecx, dword [esi + 0x138]
mov ecx, dword [edi + ecx]
mov dword [ecx + ebx], eax
mov eax, dword [esi + 0x138]
mov eax, dword [edi + eax]
mov eax, dword [eax + ebx]
test eax, eax
je 0x431593
push 0
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
cmp eax, 0xffffffff
mov dword [ebp - 0xc], eax
je 0x4315a4
mov ecx, dword [esi + 0x110]
imul ecx, ecx, 0x5c4
cmp eax, ecx
jbe 0x43142f
mov eax, dword [esi + 0x138]
push 0
push 0
push ecx
mov eax, dword [edi + eax]
mov dword [ebp - 0xc], ecx
push dword [eax + ebx]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x4315dd
mov eax, dword [esi + 0x138]
mov eax, dword [edi + eax]
push dword [eax + ebx]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
test eax, eax
je 0x4315c8
jmp 0x4314c8
jae 0x4314c8
mov eax, dword [esi + 0x138]
push 2
push 0
push 0
mov eax, dword [edi + eax]
mov dword [ebp - 0xc], ecx
push dword [eax + ebx]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x4315dd
mov eax, dword [esi + 0x110]
imul eax, eax, 0x5c4
sub eax, dword [ebp - 0xc]
push eax
mov dword [ebp - 0x10], eax
call dword [sym.imp.MSVCRT.dll_malloc]
pop ecx
mov dword [ebp - 0x14], eax
push dword [ebp - 0x10]
test eax, eax
je 0x4315f2
push 0
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
lea eax, [ebp - 0x18]
push 0
push eax
push dword [ebp - 0x10]
mov eax, dword [esi + 0x138]
push dword [ebp - 0x14]
mov eax, dword [edi + eax]
push dword [eax + ebx]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4315fc
mov eax, dword [ebp - 0x10]
push dword [ebp - 0x14]
cmp eax, dword [ebp - 0x18]
jne 0x431620
call dword [sym.imp.MSVCRT.dll_free]
pop ecx
push 0
call dword [sym.imp.KERNEL32.dll_SetLastError]
push dword [ebp - 4]
lea eax, [ebp - 0x124]
push dword [ebp + 8]
push dword [esi + 0x108]
push str.TranLogFileMapping_10d_10d_10d
push eax
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 0x14
lea eax, [ebp - 0x124]
push eax
mov eax, dword [esi + 0x138]
push dword [ebp - 0xc]
mov eax, dword [edi + eax]
push 0
push 4
push 0
push dword [eax + ebx]
call dword [sym.imp.KERNEL32.dll_CreateFileMappingA]
mov ecx, dword [esi + 0x134]
mov ecx, dword [edi + ecx]
mov dword [ecx + ebx], eax
mov eax, dword [esi + 0x134]
xor ecx, ecx
mov eax, dword [edi + eax]
mov eax, dword [eax + ebx]
cmp eax, ecx
je 0x431634
push dword [ebp - 0xc]
push ecx
push ecx
push 6
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov ecx, dword [esi + 0x13c]
mov ecx, dword [edi + ecx]
mov dword [ecx + ebx], eax
mov eax, dword [esi + 0x13c]
mov eax, dword [edi + eax]
cmp dword [eax + ebx], 0
je 0x43164b
inc dword [ebp - 4]
mov eax, dword [ebp - 4]
cmp eax, dword [ebp - 0x1c]
jl 0x43135b
mov ebx, dword [ebp - 0x20]
mov eax, dword [esi + 0x118]
mov ecx, dword [ebp + 0xc]
add dword [ebx + eax + 4], ecx
mov byte [ebp - 5], 1
lea eax, [ebx + eax + 4]
mov al, byte [ebp - 5]
pop edi
pop esi
pop ebx
leave
ret 8
lea eax, [ebp - 0x124]
push eax
push str.CTranLog::IncreaseSegments_CreateFile__s_return_NULL
jmp 0x43126c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x124]
push eax
push str.CTranLog::IncreaseSegments_GetFileSize__s_fail__errno_d
push 0x7d1
push 0
call fcn.00426a9a
add esp, 0x14
jmp 0x431589
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x124]
push eax
push str.CTranLog::IncreaseSegments_SetEndOfFile__s_fail__errno_d
jmp 0x4315b7
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x124]
push eax
push str.CTranLog::IncreaseSegments_SetFilePointer__s_fail__errno_d
jmp 0x4315b7
push str.CTranLog::IncreaseSegments_malloc__d__return_NULL
jmp 0x43126c
push dword [ebp - 0x14]
call dword [sym.imp.MSVCRT.dll_free]
mov dword [esp], str.CTranLog::IncreaseSegments_WriteFile_fail
push 0x7d1
push 0
call fcn.00426a9a
add esp, 0xc
jmp 0x431589
call dword [sym.imp.MSVCRT.dll_free]
pop ecx
push dword [ebp - 0x18]
push dword [ebp - 0x10]
push str.CTranLog::IncreaseSegments_WriteFile_fail___d_bytes__success__d
jmp 0x4315b7
lea eax, [ebp - 0x124]
push eax
push str.CTranLog::IncreaseSegments_CreateFileMapping__s_return_NULL
push 0x7d1
push ecx
jmp 0x431273
lea eax, [ebp - 0x124]
push eax
push str.CTranLog::IncreaseSegments_MapViewOfFile__s_return_NULL
jmp 0x43126c