Function at 0x4019d0
Capabilities:
Read file on windows

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x9c
mov ebx, dword [esp + 0xb0]
mov eax, dword [ebx]
test eax, eax
je 0x401d20
mov dword [esp + 8], 0
lea esi, [esp + 0x2e]
mov dword [esp + 4], 0
mov dword [esp], eax
mov dword [esp + 0x30], 0
call sub.msvcrt.dll_fseek
mov eax, dword [ebx]
mov dword [esp + 8], 2
mov dword [esp + 4], 1
mov dword [esp + 0xc], eax
mov dword [esp], esi
call sub.msvcrt.dll_fread
cmp byte [esp + 0x2e], 0x4d
mov eax, dword [ebx]
jne 0x401acb
cmp byte [esp + 0x2f], 0x5a
jne 0x401acb
mov dword [esp + 8], 0
mov dword [esp + 4], 0x3c
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 + 0xc], eax
lea eax, [esp + 0x30]
mov dword [esp], eax
mov dword [esp + 0x18], eax
call sub.msvcrt.dll_fread
mov eax, dword [esp + 0x30]
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 + 8], 1
mov dword [esp + 4], 2
mov dword [esp + 0xc], eax
mov dword [esp], esi
call sub.msvcrt.dll_fread
cmp byte [esp + 0x2e], 0xb
je 0x401ca8
mov eax, dword [ebx]
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 dword [esp + 0x1c], eax
mov eax, dword [esp + 0x1c]
mov dword [esp + 8], 0
sub eax, 0x60
mov dword [esp + 4], eax
mov eax, dword [ebx]
mov dword [esp], eax
call sub.msvcrt.dll_fseek
test eax, eax
jne 0x401b6c
mov eax, dword [ebx]
mov dword [esp + 8], 1
mov dword [esp + 4], 0x60
mov dword [esp + 0xc], eax
lea eax, [esp + 0x30]
mov dword [esp], eax
mov dword [esp + 0x18], eax
call sub.msvcrt.dll_fread
test eax, eax
je 0x401b6c
lea ebp, [esp + 0x38]
mov eax, str.MEI_f_v_n_v
lea edx, [esp + 0x2f]
lea esi, [esi]
mov ecx, 8
mov esi, eax
mov edi, ebp
repe cmpsb byte [esi], byte es:[edi]
seta cl
sbb cl, 0
test cl, cl
je 0x401b80
sub ebp, 1
cmp ebp, edx
jne 0x401b50
mov esi, 0xffffffff
add esp, 0x9c
mov eax, esi
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [ebp]
lea edi, [ebx + 0x14]
lea ecx, [ebx + 0x10]
mov esi, ebp
and edi, 0xfffffffc
mov dword [ebx + 0x10], eax
sub ecx, edi
mov eax, dword [ebp + 0x54]
sub esi, ecx
add ecx, 0x58
mov dword [ebx + 0x64], eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov esi, dword [sym.imp.WS2_32.dll_ntohl]
mov eax, dword [ebx + 0x18]
mov dword [esp], eax
call esi
mov dword [ebx + 0x406c], 0
sub esp, 4
mov edx, eax
mov eax, dword [esp + 0x1c]
sub ebp, dword [esp + 0x18]
sub eax, 8
sub eax, edx
add ebp, eax
mov eax, dword [ebx + 0x24]
mov dword [ebx + 4], ebp
mov dword [esp], eax
call esi
mov edi, dword [ebx + 4]
mov dword [0x41e040], eax
mov eax, dword [ebx + 0x1c]
sub esp, 4
mov dword [esp], eax
call esi
sub esp, 4
add edi, eax
mov dword [esp + 8], 0
mov dword [esp + 4], edi
mov eax, dword [ebx]
mov dword [esp], eax
call sub.msvcrt.dll_fseek
mov eax, dword [ebx + 0x20]
mov dword [esp], eax
call esi
sub esp, 4
mov dword [esp], eax
call sub.msvcrt.dll_malloc
mov dword [ebx + 8], eax
test eax, eax
je 0x401d86
mov eax, dword [ebx + 0x20]
mov edi, dword [ebx]
mov dword [esp], eax
call esi
sub esp, 4
mov dword [esp + 0xc], edi
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 0x401d52
mov eax, dword [ebx + 0x20]
mov edi, dword [ebx + 8]
mov dword [esp], eax
call esi
add edi, eax
mov eax, dword [ebx]
sub esp, 4
mov dword [ebx + 0xc], edi
mov dword [esp], eax
call sub.msvcrt.dll_ferror
mov esi, eax
test eax, eax
jne 0x401d70
mov eax, dword [ebx]
test eax, eax
je 0x401b71
mov dword [esp], eax
call sub.msvcrt.dll_fclose
mov dword [ebx], 0
mov eax, esi
add esp, 0x9c
pop ebx
pop esi
pop edi
pop ebp
ret
movzx eax, byte [esp + 0x2f]
cmp al, 1
je 0x401d48
cmp al, 2
jne 0x401ac9
mov eax, 0xa8
add eax, dword [esp + 0x30]
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 + 0xc], eax
mov eax, dword [esp + 0x18]
mov dword [esp], eax
call sub.msvcrt.dll_fread
mov eax, dword [esp + 0x30]
mov dword [esp + 0x1c], eax
test eax, eax
je 0x401ac9
jg 0x401af1
jmp 0x401ac9
lea eax, [ebx + 0x68]
mov dword [esp + 4], 0x416064
mov dword [esp], eax
call fcn.00403590
mov dword [ebx], eax
test eax, eax
jne 0x4019eb
jmp 0x401b6c
mov eax, 0x98
jmp 0x401cc2
mov dword [esp + 4], str.Could_not_read_from_file.
mov esi, 0xffffffff
mov dword [esp], str.fread
call fcn.004022e0
jmp 0x401b71
mov dword [esp], str.Error_on_file_n.
mov esi, 0xffffffff
call fcn.00402180
jmp 0x401b71
mov dword [esp + 4], str.Could_not_allocate_buffer_for_TOC.
or esi, 0xffffffff
mov dword [esp], 0x4161bf
call fcn.004022e0
jmp 0x401b71