Function at 0x401890
Capabilities:
Read file on windows

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x9c
mov ebp, dword [esp + 0xb0]
mov eax, dword [ebp]
test eax, eax
je 0x401bc4
mov dword [esp + 8], 0
mov dword [esp + 4], 0
lea ebx, [esp + 0x2e]
mov dword [esp], eax
mov dword [esp + 0x30], 0
call sub.msvcrt.dll_fseek
mov eax, dword [ebp]
mov dword [esp + 8], 2
mov dword [esp + 4], 1
mov dword [esp], ebx
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fread
cmp byte [esp + 0x2e], 0x4d
jne 0x40198f
cmp byte [esp + 0x2f], 0x5a
jne 0x40198f
mov dword [esp + 8], 0
mov dword [esp + 4], 0x3c
mov eax, dword [ebp]
mov dword [esp], eax
call sub.msvcrt.dll_fseek
mov eax, dword [ebp]
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 [ebp]
mov dword [esp], eax
call sub.msvcrt.dll_fseek
mov eax, dword [ebp]
mov dword [esp + 8], 1
mov dword [esp + 4], 2
mov dword [esp], ebx
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fread
cmp byte [esp + 0x2e], 0xb
je 0x401b50
mov dword [esp + 8], 2
mov dword [esp + 4], 0
mov eax, dword [ebp]
mov dword [esp], eax
call sub.msvcrt.dll_fseek
mov eax, dword [ebp]
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 [ebp]
mov dword [esp], eax
call sub.msvcrt.dll_fseek
test eax, eax
jne 0x401be2
mov eax, dword [ebp]
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 0x401be2
lea ebx, [esp + 0x38]
lea eax, [esp + 0x2f]
jmp 0x401a2b
sub ebx, 1
cmp ebx, eax
je 0x401be2
mov esi, str.MEI_f_v_n_v
mov edi, ebx
mov ecx, 8
repe cmpsb byte [esi], byte es:[edi]
jne 0x401a20
mov eax, dword [ebx]
lea edi, [ebp + 0x14]
lea ecx, [ebp + 0x10]
mov esi, ebx
and edi, 0xfffffffc
mov dword [ebp + 0x10], eax
mov eax, dword [ebx + 0x54]
sub ecx, edi
sub esi, ecx
add ecx, 0x58
shr ecx, 2
mov dword [ebp + 0x64], eax
rep movsd dword es:[edi], dword [esi]
mov esi, dword [sym.imp.WS2_32.dll_ntohl]
mov eax, dword [ebp + 0x18]
mov dword [esp], eax
call esi
sub esp, 4
mov dword [ebp + 0x406c], 0
sub ebx, dword [esp + 0x18]
mov edx, dword [esp + 0x1c]
sub edx, eax
mov eax, dword [ebp + 0x1c]
lea ebx, [edx + ebx - 8]
mov dword [ebp + 4], ebx
mov dword [esp], eax
call esi
sub esp, 4
add eax, ebx
mov dword [esp + 8], 0
mov dword [esp + 4], eax
mov eax, dword [ebp]
mov dword [esp], eax
call sub.msvcrt.dll_fseek
mov eax, dword [ebp + 0x20]
mov dword [esp], eax
call esi
sub esp, 4
mov dword [esp], eax
call sub.msvcrt.dll_malloc
test eax, eax
mov dword [ebp + 8], eax
je 0x401c2a
mov eax, dword [ebp + 0x20]
mov ebx, dword [ebp]
mov dword [esp], eax
call esi
sub esp, 4
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 1
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.msvcrt.dll_fread
test eax, eax
je 0x401bfe
mov ebx, dword [ebp + 8]
mov eax, dword [ebp + 0x20]
mov dword [esp], eax
call esi
add eax, ebx
sub esp, 4
mov dword [ebp + 0xc], eax
mov eax, dword [ebp]
mov dword [esp], eax
call sub.msvcrt.dll_ferror
test eax, eax
mov ebx, eax
jne 0x401c14
mov eax, dword [ebp]
test eax, eax
je 0x401b3a
mov dword [esp], eax
call sub.msvcrt.dll_fclose
mov dword [ebp], 0
add esp, 0x9c
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
movzx eax, byte [esp + 0x2f]
cmp al, 1
je 0x401bf4
cmp al, 2
jne 0x40198f
mov eax, 0xa8
add eax, dword [esp + 0x30]
mov dword [esp + 8], 0
mov dword [esp + 4], eax
mov eax, dword [ebp]
mov dword [esp], eax
call sub.msvcrt.dll_fseek
mov eax, dword [ebp]
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]
cmp eax, 0
mov dword [esp + 0x1c], eax
je 0x40198f
jg 0x4019b9
jmp 0x40198f
lea eax, [ebp + 0x68]
mov dword [esp + 4], 0x40c020
mov dword [esp], eax
call fcn.00402f00
test eax, eax
mov dword [ebp], eax
jne 0x4018ac
add esp, 0x9c
mov ebx, 0xffffffff
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, 0x98
jmp 0x401b6a
mov dword [esp], str.Could_not_read_from_file.
mov ebx, 0xffffffff
call fcn.00401e30
jmp 0x401b3a
mov dword [esp], str.Error_on_file
mov ebx, 0xffffffff
call fcn.00401e30
jmp 0x401b3a
mov dword [esp], str.Could_not_allocate_buffer_for_TOC.
mov ebx, 0xffffffff
call fcn.00401e30
jmp 0x401b3a