Function at 0x401d20
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
push edi
push esi
push ebx
mov edi, dword [ebp + 8]
mov esi, dword [ebp + 0xc]
call fcn.00404e18
mov dword [ebp - 4], 0
mov eax, dword [esi]
mov dword [0x4071a0], eax
add esp, 0xfffffff8
push 0x401b6d
push 0
call sub.msvcrt.dll_setlocale
add esp, 0xfffffff8
push 0x401b6e
push 0x401b86
call fcn.00402000
add esp, 0x20
add esp, 0xfffffff4
push 0x401b86
call fcn.00402060
add esp, 0xfffffffc
push fcn.00401a0c
push 0x401b90
push 0x401b9d
push 0x401ba1
push 0x401baf
push esi
push edi
call fcn.0040480c
mov dword [0x407080], 0
add esp, 0x30
jmp 0x401c51
test eax, eax
je 0x401c51
add esp, 0xfffffff4
push 1
call fcn.00401a0c
add esp, 0x10
add esp, 0xfffffff4
push 0
push 0x401220
push 0x401b6d
push esi
push edi
call fcn.00404784
add esp, 0x20
cmp eax, 0xffffffff
jne 0x401c40
mov eax, dword [0x40602c]
cmp eax, edi
jl 0x401c97
add esp, 0xfffffff8
push 0
push 0x401640
call fcn.00401654
add esp, 0x10
test eax, eax
jge 0x401cc0
mov dword [ebp - 4], 1
jmp 0x401cc0
mov ebx, eax
lea esi, [esi]
add esp, 0xfffffff8
push 1
push dword [esi + ebx*4]
call fcn.00401654
add esp, 0x10
test eax, eax
jge 0x401cbb
mov dword [ebp - 4], 1
inc ebx
cmp ebx, edi
jl 0x401ca0
cmp dword [0x407080], 0
je 0x401cf9
add esp, 0xfffffff4
push dword [sym.imp.msvcrt.dll__iob]
call sub.msvcrt.dll_fclose
mov ebx, eax
add esp, 0x10
cmp ebx, 0xffffffff
jne 0x401cf9
add esp, 0xfffffffc
push 0x401640
call sub.msvcrt.dll__errno
push dword [eax]
push ebx
call fcn.004048c8
add esp, 0x10
add esp, 0xfffffff4
xor eax, eax
cmp dword [ebp - 4], 0
je 0x401d09
mov eax, 0xffffffff
push eax
call sub.msvcrt.dll_exit
add byte [eax], al
add byte [eax], al
add byte [eax], al
add byte [eax], al
add byte [eax], al
add byte [eax], al
add byte [eax], al
add byte [eax], al
add byte [ebp - 0x77], dl
push ebp
mov ebp, esp
sub esp, 0x9c
push edi
push esi
push ebx
mov eax, dword [ebp + 8]
mov dword [eax + 4], 1
mov dword [eax + 8], 0
mov eax, dword [eax]
test eax, eax
je 0x401fe7
add esp, 0xfffffff8
push 0
push eax
call sub.msvcrt.dll__open
mov dword [ebp - 0x84], eax
add esp, 0x10
cmp eax, 0xffffffff
je 0x401fe7
add esp, 0xfffffff8
lea eax, [ebp - 0x80]
push eax
mov edx, dword [ebp - 0x84]
push edx
call sub.msvcrt.dll__fstat
add esp, 0x10
test eax, eax
jne 0x401d8c
mov eax, dword [ebp - 0x6c]
mov dword [ebp - 0x88], eax
cmp eax, 0x1b
ja 0x401da0
add esp, 0xfffffff4
mov edx, dword [ebp - 0x84]
push edx
call sub.msvcrt.dll__close
jmp 0x401fe7
add esp, 0xfffffff4
mov eax, dword [ebp - 0x88]
push eax
call sub.msvcrt.dll_malloc
mov edi, eax
add esp, 0x10
test edi, edi
je 0x401fe7
mov ebx, dword [ebp - 0x88]
mov esi, edi
add esp, 0xfffffffc
push ebx
push esi
mov edx, dword [ebp - 0x84]
push edx
call sub.msvcrt.dll__read
add esp, 0x10
cmp eax, 0xffffffff
je 0x401fd0
add esi, eax
sub ebx, eax
jne 0x401dc4
add esp, 0xfffffff4
mov eax, dword [ebp - 0x84]
push eax
call sub.msvcrt.dll__close
add esp, 0x10
mov eax, dword [edi]
cmp eax, 0x950412de
je 0x401e17
cmp eax, 0xde120495
je 0x401e17
add esp, 0xfffffff4
push edi
call sub.msvcrt.dll_free
jmp 0x401fe7
add esp, 0xfffffff4
push 0x24
call sub.msvcrt.dll_malloc
mov ebx, eax
mov edx, dword [ebp + 8]
mov dword [edx + 8], ebx
add esp, 0x10
test ebx, ebx
je 0x401fe7
mov dword [ebx], edi
mov eax, dword [ebp - 0x88]
mov dword [ebx + 8], eax
cmp dword [edi], 0x950412de
setne al
and eax, 0xff
mov dword [ebx + 0xc], eax
test eax, eax
je 0x401e80
mov eax, dword [edi + 4]
mov ecx, eax
shl ecx, 0x18
mov edx, eax
and edx, 0xff00
shl edx, 8
or ecx, edx
shr eax, 8
mov edx, eax
and edx, 0xff00
or ecx, edx
shr eax, 0x10
or ecx, eax
jmp 0x401e83
mov ecx, dword [edi + 4]
test ecx, ecx
jne 0x401fb0
cmp dword [ebx + 0xc], 0
je 0x401ec0
mov eax, dword [edi + 8]
mov ecx, eax
shl ecx, 0x18
mov edx, eax
and edx, 0xff00
shl edx, 8
or ecx, edx
shr eax, 8
mov edx, eax
and edx, 0xff00
or ecx, edx
shr eax, 0x10
or ecx, eax
jmp 0x401ec3
mov ecx, dword [edi + 8]
mov dword [ebx + 0x10], ecx
cmp dword [ebx + 0xc], 0
je 0x401ef6
mov ecx, dword [edi + 0xc]
mov edx, ecx
shl edx, 0x18
mov eax, ecx
and eax, 0xff00
shl eax, 8
or edx, eax
shr ecx, 8
mov eax, ecx
and eax, 0xff00
or edx, eax
shr ecx, 0x10
or edx, ecx
lea eax, [edx + edi]
jmp 0x401efb
mov eax, edi
add eax, dword [eax + 0xc]
mov dword [ebx + 0x14], eax
cmp dword [ebx + 0xc], 0
je 0x401f30
mov ecx, dword [edi + 0x10]
mov edx, ecx
shl edx, 0x18
mov eax, ecx
and eax, 0xff00
shl eax, 8
or edx, eax
shr ecx, 8
mov eax, ecx
and eax, 0xff00
or edx, eax
shr ecx, 0x10
or edx, ecx
lea eax, [edx + edi]
jmp 0x401f35
mov eax, edi
add eax, dword [eax + 0x10]
mov dword [ebx + 0x18], eax
cmp dword [ebx + 0xc], 0
je 0x401f67
mov eax, dword [edi + 0x14]
mov ecx, eax
shl ecx, 0x18
mov edx, eax
and edx, 0xff00
shl edx, 8
or ecx, edx
shr eax, 8
mov edx, eax
and edx, 0xff00
or ecx, edx
shr eax, 0x10
or ecx, eax
jmp 0x401f6a
mov ecx, dword [edi + 0x14]
mov dword [ebx + 0x1c], ecx
cmp dword [ebx + 0xc], 0
je 0x401fa0
mov ecx, dword [edi + 0x18]
mov edx, ecx
shl edx, 0x18
mov eax, ecx
and eax, 0xff00
shl eax, 8
or edx, eax
shr ecx, 8
mov eax, ecx
and eax, 0xff00
or edx, eax
shr ecx, 0x10
or edx, ecx
lea eax, [edx + edi]
jmp 0x401fa5
mov eax, edi
add eax, dword [edi + 0x18]
mov dword [ebx + 0x20], eax
jmp 0x401fe1
add esp, 0xfffffff4
push edi
call sub.msvcrt.dll_free
add esp, 0xfffffff4
push ebx
call sub.msvcrt.dll_free
mov edx, dword [ebp + 8]
mov dword [edx + 8], 0
jmp 0x401fe7
add esp, 0xfffffff4
mov eax, dword [ebp - 0x84]
push eax
call sub.msvcrt.dll__close
jmp 0x401fe7
inc dword [0x406008]
lea esp, [ebp - 0xa8]
pop ebx
pop esi
pop edi
leave
ret