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

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
mov esi, edx
push ebx
mov ebx, eax
lea edi, [esi + 1]
sub esp, 0x3c
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll__fileno]
mov edx, dword [sym.imp.msvcrt.dll_calloc]
mov dword [esp + 4], edi
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x2c], edx
mov dword [esp], 1
call edx
mov edx, dword [ebp - 0x2c]
mov dword [esp + 4], edi
mov dword [ebp - 0x30], eax
mov dword [esp], 1
call edx
mov dword [esp + 8], 0x45c20f
mov dword [esp + 4], edi
mov dword [esp], eax
mov dword [ebp - 0x2c], eax
call fcn.004142e0
lea eax, [esi - 2]
mov dword [ebp - 0x38], eax
mov dword [esp], ebx
call dword [sym.imp.msvcrt.dll_rewind]
mov dword [esp + 4], 0x9e5
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov eax, dword [ebx + 4]
mov dword [esp + 4], str._cnt_should_be_0_after_rewind__but_is__d_n
test eax, eax
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov eax, dword [ebp - 0x2c]
mov dword [esp + 0xc], ebx
mov dword [esp + 8], edi
mov dword [esp + 4], 1
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll_fwrite]
mov eax, dword [ebp - 0x34]
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll__lseek]
mov dword [esp], ebx
call dword [sym.imp.msvcrt.dll_fflush]
mov dword [esp + 4], 0x9ec
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov eax, dword [ebx + 4]
mov dword [esp + 4], str._cnt_should_be_0_after_fflush__but_is__d_n
test eax, eax
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], ebx
call dword [sym.imp.msvcrt.dll_fseek]
mov dword [esp + 4], 0x9ee
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov eax, dword [ebp - 0x30]
mov dword [esp + 0xc], ebx
mov dword [esp + 8], esi
mov dword [esp + 4], 1
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll_fread]
mov dword [esp + 4], str.read_failed_n
cmp eax, esi
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
cmp esi, edi
je 0x4148d0
mov dword [esp + 4], 0x9f2
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov eax, dword [ebp - 0x30]
mov dword [esp + 8], esi
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x2c]
mov dword [esp], eax
call sub.msvcrt.dll_memcmp
mov dword [esp + 8], edi
test eax, eax
mov dword [esp + 4], str.unexpected_flush_by__d_byte_write_n
setne al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
sub edi, 1
cmp dword [ebp - 0x38], edi
jne 0x414372
mov edi, esi
mov dword [esp], ebx
call dword [sym.imp.msvcrt.dll_rewind]
shr edi, 0x1f
mov eax, dword [ebp - 0x2c]
mov dword [esp + 0xc], ebx
add edi, esi
mov dword [esp + 4], 1
sar edi, 1
mov dword [esp], eax
mov dword [esp + 8], edi
call dword [sym.imp.msvcrt.dll_fwrite]
mov dword [esp + 8], edi
add edi, dword [ebp - 0x2c]
mov dword [esp + 0xc], ebx
mov dword [esp], edi
mov dword [esp + 4], 1
call dword [sym.imp.msvcrt.dll_fwrite]
mov ecx, dword [ebp - 0x34]
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], ecx
call dword [sym.imp.msvcrt.dll__lseek]
mov dword [esp], ebx
call dword [sym.imp.msvcrt.dll_fflush]
mov dword [esp], ebx
mov dword [esp + 8], 0
mov dword [esp + 4], 0
call dword [sym.imp.msvcrt.dll_fseek]
mov dword [esp + 4], 0x9fa
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov edi, dword [ebp - 0x30]
mov dword [esp + 0xc], ebx
mov dword [esp + 8], esi
mov dword [esp], edi
mov dword [esp + 4], 1
call dword [sym.imp.msvcrt.dll_fread]
mov dword [esp + 4], str.read_failed_n
cmp eax, esi
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0x9fb
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov eax, dword [ebp - 0x2c]
mov dword [esp + 8], esi
mov dword [esp + 4], edi
mov dword [esp], eax
mov dword [ebp - 0x30], edi
call sub.msvcrt.dll_memcmp
mov dword [esp + 8], esi
test eax, eax
mov dword [esp + 4], str.unexpected_flush_by__d_2_byte_double_write_n
setne al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0x9fd
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov dword [esp], ebx
mov dword [esp + 8], 2
mov dword [esp + 4], 0xffffffff
call dword [sym.imp.msvcrt.dll_fseek]
mov dword [esp + 4], str.fseek_failed_n
test eax, eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0x9fe
mov dword [esp], 0x45a2c0
call fcn.0044c860
lea eax, [ebp - 0x28]
mov dword [esp], ebx
mov edi, dword [sym.imp.msvcrt.dll_fgetpos]
mov dword [esp + 4], eax
call edi
mov dword [esp + 4], str.fgetpos_failed_n
test eax, eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0x9ff
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov ecx, dword [ebp - 0x30]
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 1
mov dword [esp], ecx
mov dword [esp + 4], 1
call dword [sym.imp.msvcrt.dll_fread]
mov dword [esp + 4], str.fread_failed_n
cmp eax, 1
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0xa00
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov eax, dword [ebx + 0xc]
mov dword [esp + 4], str.file___flag___x_n
mov dword [esp + 8], eax
and eax, 1
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0xa01
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov eax, dword [ebx + 4]
mov dword [esp + 4], str.file___cnt___d_n
test eax, eax
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0xa02
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov dword [esp + 4], str.file___ptr__file___base_n
xor eax, eax
mov edx, dword [ebx + 8]
cmp dword [ebx], edx
setne al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0xa03
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov eax, dword [ebp - 0x2c]
mov dword [esp + 0xc], ebx
mov dword [esp + 8], esi
mov dword [esp + 4], 1
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll_fwrite]
mov dword [esp + 4], str.fwrite_failed_n
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0xa04
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov eax, dword [ebx + 0xc]
mov dword [esp + 4], str.file___flag___x_n
mov dword [esp + 8], eax
and eax, 1
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0xa05
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov eax, dword [ebx + 4]
mov dword [esp + 4], str.file___cnt___d_n
test eax, eax
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0xa06
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov dword [esp + 4], str.file___ptr__file___base_n
xor eax, eax
mov edx, dword [ebx + 8]
cmp dword [ebx], edx
sete al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0xa07
mov dword [esp], 0x45a2c0
call fcn.0044c860
lea eax, [ebp - 0x20]
mov dword [esp], ebx
mov dword [esp + 4], eax
call edi
mov dword [esp + 4], str.fgetpos_failed_n
mov edi, esi
test eax, eax
sete al
sar edi, 0x1f
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0xa08
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov edx, dword [ebp - 0x28]
mov eax, dword [ebp - 0x20]
mov dword [esp + 4], str.pos___d___d__n
add esi, dword [ebp - 0x28]
adc edi, dword [ebp - 0x24]
mov dword [esp + 8], edx
add esi, 1
mov edx, dword [ebp - 0x1c]
adc edi, 0
mov dword [esp + 0xc], eax
xor eax, esi
xor edx, edi
mov esi, eax
xor eax, eax
or esi, edx
sete al
mov dword [esp], eax
call fcn.0044cad0
mov ecx, dword [ebp - 0x30]
mov ebx, dword [sym.imp.msvcrt.dll_free]
mov dword [esp], ecx
call ebx
mov eax, dword [ebp - 0x2c]
mov dword [esp], eax
call ebx
add esp, 0x3c
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 4], 0x9f0
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov eax, dword [ebp - 0x30]
mov dword [esp + 8], esi
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x2c]
mov dword [esp], eax
call sub.msvcrt.dll_memcmp
mov dword [esp + 8], esi
test eax, eax
mov dword [esp + 4], str.missing_flush_by__d_byte_write_n
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
jmp 0x4144d1