Function at 0x40498e
Capabilities:
Read file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
mov eax, dword [0x410c50]
sub esp, 0xc
mov ecx, dword [0x410bd8]
inc eax
mov edx, dword [0x4118dc]
push ebx
push esi
push edi
mov edi, dword [0x410be4]
mov ebx, dword [edi + 4]
add eax, ebx
cmp ecx, eax
ja 0x404bb6
cmp dword [edi + 0x20], 0
jne 0x4049d4
sub ecx, edx
xor eax, eax
cmp ecx, 1
setne al
inc eax
jmp 0x404bb1
mov esi, ecx
sub esi, edx
dec esi
mov dword [ebp - 4], esi
test esi, esi
jle 0x4049ee
mov al, byte [edx]
mov byte [ebx], al
inc ebx
inc edx
sub esi, 1
jne 0x4049e0
mov esi, dword [ebp - 4]
xor eax, eax
inc eax
cmp dword [edi + 0x24], 2
jne 0x404a07
xor esi, esi
and dword [edi + 0x10], esi
mov dword [0x410c50], esi
jmp 0x404b66
mov edx, dword [edi + 0xc]
mov ebx, edx
sub ebx, esi
dec ebx
test ebx, ebx
jg 0x404a7a
mov eax, dword [edi + 4]
sub ecx, eax
cmp dword [edi + 0x14], 0
mov dword [ebp - 8], eax
mov dword [ebp - 0xc], ecx
je 0x404ae4
lea eax, [edx + edx]
lea ebx, [edi + 0xc]
test eax, eax
jg 0x404a39
mov eax, edx
shr eax, 3
add eax, edx
mov edx, ebx
mov ecx, eax
mov dword [edx], ecx
lea ecx, [eax + 2]
cmp ecx, eax
jb 0x404ada
push ecx
push dword [ebp - 8]
call dword [sym.imp.msvcrt.dll_realloc]
mov dword [edi + 4], eax
pop ecx
pop ecx
test eax, eax
je 0x404ae8
mov ebx, dword [ebx]
mov edx, ebx
mov ecx, dword [ebp - 0xc]
sub ebx, esi
add ecx, eax
dec ebx
mov dword [0x410bd8], ecx
test ebx, ebx
jle 0x404a13
xor eax, eax
inc eax
mov ecx, 0x2000
cmp ebx, ecx
jle 0x404a85
mov ebx, ecx
cmp dword [edi + 0x18], 0
je 0x404b18
xor esi, esi
test ebx, ebx
jle 0x404b10
push dword [0x410bd4]
call dword [sym.imp.msvcrt.dll_getc]
mov edi, dword [0x410be4]
mov edx, dword [ebp - 4]
mov dword [ebp - 0xc], eax
pop ecx
cmp eax, 0xffffffff
je 0x404ac5
cmp eax, 0xa
je 0x404ac5
mov ecx, dword [edi + 4]
add ecx, esi
inc esi
mov byte [ecx + edx], al
cmp esi, ebx
jl 0x404a95
mov ecx, esi
cmp eax, 0xa
jne 0x404af2
mov eax, dword [edi + 4]
mov ecx, dword [ebp - 0xc]
add eax, esi
inc esi
mov byte [eax + edx], cl
jmp 0x404b10
mov ecx, 0x4012ac
jmp 0x404bbb
and dword [edi + 4], 0
mov ecx, 0x4012c0
jmp 0x404bbb
mov esi, ecx
cmp eax, 0xffffffff
jne 0x404b10
push dword [0x410bd4]
call dword [sym.imp.msvcrt.dll_ferror]
pop ecx
test eax, eax
jne 0x404b4c
mov edi, dword [0x410be4]
mov dword [0x410c50], esi
jmp 0x404b5f
push dword [0x410bd4]
push ebx
push eax
mov eax, dword [edi + 4]
add eax, esi
push eax
call dword [sym.imp.msvcrt.dll_fread]
mov esi, eax
add esp, 0x10
mov dword [0x410c50], esi
test esi, esi
jne 0x404b59
push dword [0x410bd4]
call dword [sym.imp.msvcrt.dll_ferror]
pop ecx
test eax, eax
je 0x404b53
mov ecx, 0x4012ec
jmp 0x404bbb
mov esi, dword [0x410c50]
mov edi, dword [0x410be4]
mov dword [edi + 0x10], esi
test esi, esi
jne 0x404b8b
mov ebx, dword [ebp - 4]
test ebx, ebx
jne 0x404b83
call fcn.00404d00
mov edi, dword [0x410be4]
xor eax, eax
mov esi, dword [0x410c50]
inc eax
jmp 0x404b90
push 2
pop eax
mov dword [edi + 0x24], eax
jmp 0x404b90
mov ebx, dword [ebp - 4]
xor eax, eax
mov ecx, dword [edi + 4]
lea edx, [esi + ebx]
mov dword [0x410c50], edx
mov byte [edx + ecx], 0
mov ecx, dword [edi + 4]
mov byte [ecx + edx + 1], 0
mov ecx, dword [edi + 4]
mov dword [0x4118dc], ecx
pop edi
pop esi
pop ebx
leave
ret
mov ecx, 0x401274
call fcn.00404e0e
int3