Function at 0x40183a
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
sub esp, 0x34
mov eax, dword [0x404010]
mov eax, dword [eax + 4]
mov dword [ebp - 0x20], eax
mov eax, dword [0x405004]
mov dword [ebp - 0x24], eax
mov edx, dword [0x404010]
mov eax, dword [0x405018]
add eax, dword [edx + 4]
inc eax
cmp dword [0x404014], eax
jbe 0x40187b
sub esp, 0xc
push 0x4017b0
call fcn.004024aa
add esp, 0x10
mov eax, dword [0x404010]
cmp dword [eax + 0x20], 0
jne 0x4018b2
mov eax, dword [0x405004]
mov edx, dword [0x404014]
sub edx, eax
mov eax, edx
cmp eax, 1
jne 0x4018a6
mov dword [ebp - 0x1c], 1
jmp 0x401b86
mov dword [ebp - 0x1c], 2
jmp 0x401b86
mov edx, dword [0x405004]
mov eax, dword [0x404014]
sub eax, edx
mov dword [ebp - 0x28], eax
dec dword [ebp - 0x28]
mov dword [ebp - 0x2c], 0
mov edx, dword [ebp - 0x28]
cmp dword [ebp - 0x2c], edx
jl 0x4018d6
jmp 0x4018ed
mov eax, dword [ebp - 0x20]
mov edx, eax
mov eax, dword [ebp - 0x24]
mov al, byte [eax]
mov byte [edx], al
inc dword [ebp - 0x24]
inc dword [ebp - 0x20]
inc dword [ebp - 0x2c]
jmp 0x4018cc
mov eax, dword [0x404010]
cmp dword [eax + 0x24], 2
jne 0x401907
mov dword [0x405018], 0
jmp 0x401b02
mov eax, dword [0x404010]
mov eax, dword [eax + 0xc]
sub eax, dword [ebp - 0x28]
dec eax
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jle 0x401921
jmp 0x4019e0
mov eax, dword [0x404010]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x10]
mov edx, dword [eax + 4]
mov eax, dword [0x404014]
sub eax, edx
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x10]
cmp dword [eax + 0x14], 0
je 0x40199b
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 0xc]
add eax, eax
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
jg 0x40196a
mov ecx, dword [ebp - 0x10]
mov edx, dword [ebp - 0x10]
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 0xc]
shr eax, 3
add eax, dword [edx + 0xc]
mov dword [ecx + 0xc], eax
jmp 0x401978
mov edx, dword [ebp - 0x10]
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 0xc]
add eax, eax
mov dword [edx + 0xc], eax
mov ebx, dword [ebp - 0x10]
sub esp, 8
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 0xc]
add eax, 2
push eax
mov eax, dword [ebp - 0x10]
push dword [eax + 4]
call fcn.004024ec
add esp, 0x10
mov dword [ebx + 4], eax
jmp 0x4019a5
mov eax, dword [ebp - 0x10]
mov dword [eax + 4], 0
mov eax, dword [ebp - 0x10]
cmp dword [eax + 4], 0
jne 0x4019be
sub esp, 0xc
push 0x4017f0
call fcn.004024aa
add esp, 0x10
mov edx, dword [ebp - 0x10]
mov eax, dword [ebp - 0x14]
add eax, dword [edx + 4]
mov dword [0x404014], eax
mov eax, dword [0x404010]
mov eax, dword [eax + 0xc]
sub eax, dword [ebp - 0x28]
dec eax
mov dword [ebp - 0xc], eax
jmp 0x401916
cmp dword [ebp - 0xc], 0x2000
jle 0x4019f0
mov dword [ebp - 0xc], 0x2000
mov eax, dword [0x404010]
cmp dword [eax + 0x18], 0
je 0x401aae
mov dword [ebp - 0x18], 0x2a
mov dword [ebp - 0x14], 0
mov eax, dword [ebp - 0x14]
cmp eax, dword [ebp - 0xc]
jge 0x401a55
sub esp, 0xc
push dword [0x404020]
call sub.msvcrt.dll_getc
add esp, 0x10
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0xffffffff
je 0x401a55
cmp dword [ebp - 0x18], 0xa
jne 0x401a37
jmp 0x401a55
mov eax, dword [0x404010]
mov edx, dword [ebp - 0x28]
add edx, dword [eax + 4]
mov eax, edx
mov edx, eax
add edx, dword [ebp - 0x14]
mov al, byte [ebp - 0x18]
mov byte [edx], al
lea eax, [ebp - 0x14]
inc dword [eax]
jmp 0x401a0d
cmp dword [ebp - 0x18], 0xa
jne 0x401a79
mov edx, dword [0x404010]
mov eax, dword [ebp - 0x14]
mov ecx, eax
mov eax, dword [ebp - 0x28]
add eax, dword [edx + 4]
mov edx, eax
mov al, byte [ebp - 0x18]
mov byte [ecx + edx], al
lea eax, [ebp - 0x14]
inc dword [eax]
cmp dword [ebp - 0x18], 0xffffffff
jne 0x401aa4
sub esp, 0xc
push dword [0x404020]
call sub.msvcrt.dll_ferror
add esp, 0x10
test eax, eax
je 0x401aa4
sub esp, 0xc
push 0x40181c
call fcn.004024aa
add esp, 0x10
mov eax, dword [ebp - 0x14]
mov dword [0x405018], eax
jmp 0x401b02
push dword [0x404020]
push dword [ebp - 0xc]
push 1
mov eax, dword [0x404010]
mov edx, dword [ebp - 0x28]
add edx, dword [eax + 4]
mov eax, edx
push eax
call sub.msvcrt.dll_fread
add esp, 0x10
mov dword [0x405018], eax
mov eax, dword [0x405018]
test eax, eax
jne 0x401b02
sub esp, 0xc
push dword [0x404020]
call sub.msvcrt.dll_ferror
add esp, 0x10
test eax, eax
je 0x401b02
sub esp, 0xc
push 0x40181c
call fcn.004024aa
add esp, 0x10
cmp dword [0x405018], 0
jne 0x401b40
cmp dword [ebp - 0x28], 0
jne 0x401b2b
mov dword [ebp - 8], 1
sub esp, 0xc
push dword [0x404020]
call fcn.00401f9e
add esp, 0x10
jmp 0x401b47
mov dword [ebp - 8], 2
mov eax, dword [0x404010]
mov dword [eax + 0x24], 2
jmp 0x401b47
mov dword [ebp - 8], 0
mov eax, dword [ebp - 0x28]
add dword [0x405018], eax
mov edx, dword [0x404010]
mov eax, dword [0x405018]
add eax, dword [edx + 4]
mov byte [eax], 0
mov edx, dword [0x404010]
mov eax, dword [0x405018]
add eax, dword [edx + 4]
inc eax
mov byte [eax], 0
mov eax, dword [0x404010]
mov eax, dword [eax + 4]
mov dword [0x405004], eax
mov eax, dword [ebp - 8]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x1c]
mov ebx, dword [ebp - 4]
leave
ret