Function at 0x4019a0
Capabilities:
Read file on windows

Disassembly:
push edi
push esi
push ebx
sub esp, 0x20
mov ebx, dword [esp + 0x30]
mov eax, dword [ebx]
test eax, eax
je 0x401c30
mov dword [esp + 8], 2
mov dword [esp + 4], 0
mov dword [esp], eax
call sub.msvcrt.dll_fseek
mov eax, dword [ebx]
mov dword [esp], eax
call sub.msvcrt.dll_ftell
mov edx, eax
mov esi, eax
mov eax, ebx
call fcn.004015d0
test eax, eax
js 0x401ac0
mov eax, dword [ebx + 0x18]
mov edi, dword [sym.imp.WS2_32.dll_ntohl]
mov dword [ebx + 0x406c], 0
mov dword [esp], eax
call edi
sub esi, eax
mov eax, dword [ebx + 0x1c]
sub esp, 4
mov dword [ebx + 4], esi
mov dword [esp], eax
call edi
sub esp, 4
add eax, esi
mov dword [esp + 8], 0
mov dword [esp + 4], eax
mov eax, dword [ebx]
mov dword [esp], eax
call sub.msvcrt.dll_fseek
mov eax, dword [ebx + 0x20]
mov dword [esp], eax
call edi
sub esp, 4
mov dword [esp], eax
call sub.msvcrt.dll_malloc
test eax, eax
mov dword [ebx + 8], eax
je 0x401c90
mov eax, dword [ebx + 0x20]
mov esi, dword [ebx]
mov dword [esp], eax
call edi
sub esp, 4
mov dword [esp + 0xc], esi
mov dword [esp + 8], 1
mov dword [esp + 4], eax
mov eax, dword [ebx + 8]
mov dword [esp], eax
call sub.msvcrt.dll_fread
test eax, eax
je 0x401c50
mov esi, dword [ebx + 8]
mov eax, dword [ebx + 0x20]
mov dword [esp], eax
call edi
add eax, esi
sub esp, 4
mov dword [ebx + 0xc], eax
mov eax, dword [ebx]
mov dword [esp], eax
call sub.msvcrt.dll_ferror
test eax, eax
mov esi, eax
jne 0x401c70
mov eax, dword [ebx]
test eax, eax
je 0x401ab5
mov dword [esp], eax
call sub.msvcrt.dll_fclose
mov dword [ebx], 0
add esp, 0x20
mov eax, esi
pop ebx
pop esi
pop edi
ret
mov dword [esp + 8], 0
mov dword [esp + 4], 0
lea esi, [esp + 0x1a]
mov eax, dword [ebx]
mov dword [esp + 0x1c], 0
mov dword [esp], eax
call sub.msvcrt.dll_fseek
mov eax, dword [ebx]
mov dword [esp + 8], 2
mov dword [esp + 4], 1
mov dword [esp], esi
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fread
cmp byte [esp + 0x1a], 0x4d
jne 0x401c18
cmp byte [esp + 0x1b], 0x5a
jne 0x401c18
mov dword [esp + 8], 0
mov dword [esp + 4], 0x3c
lea edi, [esp + 0x1c]
mov eax, dword [ebx]
mov dword [esp], eax
call sub.msvcrt.dll_fseek
mov eax, dword [ebx]
mov dword [esp + 8], 1
mov dword [esp + 4], 4
mov dword [esp], edi
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fread
mov eax, dword [esp + 0x1c]
mov dword [esp + 8], 0
add eax, 0x18
mov dword [esp + 4], eax
mov eax, dword [ebx]
mov dword [esp], eax
call sub.msvcrt.dll_fseek
mov eax, dword [ebx]
mov dword [esp], esi
mov esi, 0xffffffff
mov dword [esp + 8], 1
mov dword [esp + 4], 2
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fread
cmp byte [esp + 0x1a], 0xb
jne 0x401ab5
movzx eax, byte [esp + 0x1b]
cmp al, 1
je 0x401c86
cmp al, 2
jne 0x401c18
mov eax, 0xa8
add eax, dword [esp + 0x1c]
mov dword [esp + 8], 0
mov dword [esp + 4], eax
mov eax, dword [ebx]
mov dword [esp], eax
call sub.msvcrt.dll_fseek
mov eax, dword [ebx]
mov dword [esp + 8], 1
mov dword [esp + 4], 4
mov dword [esp], edi
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fread
mov esi, dword [esp + 0x1c]
cmp esi, 0
je 0x401c18
jle 0x401c18
lea edi, [esi - 8]
lea esi, [esi]
mov edx, esi
mov eax, ebx
call fcn.004015d0
test eax, eax
jns 0x4019e9
sub esi, 1
cmp esi, edi
jne 0x401c00
add esp, 0x20
mov esi, 0xffffffff
mov eax, esi
pop ebx
pop esi
pop edi
ret
lea eax, [ebx + 0x68]
mov dword [esp + 4], 0x40c050
mov dword [esp], eax
call fcn.00402f50
test eax, eax
mov dword [ebx], eax
jne 0x4019b4
jmp 0x401c18
mov dword [esp], str.Could_not_read_from_file.
mov esi, 0xffffffff
call fcn.00401ea0
jmp 0x401ab5
mov dword [esp], str.Error_on_file
mov esi, 0xffffffff
call fcn.00401ea0
jmp 0x401ab5
mov eax, 0x98
jmp 0x401bb7
mov dword [esp], str.Could_not_allocate_buffer_for_TOC.
mov esi, 0xffffffff
call fcn.00401ea0
jmp 0x401ab5