Function at 0x401890
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x3c
mov ebx, dword [ebp + 8]
mov eax, dword [ebx]
test eax, eax
je 0x401bc0
mov dword [ebp - 0x1c], 0
mov dword [esp + 8], 0
lea esi, [ebp - 0x1e]
mov dword [esp + 4], 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 [ebp - 0x1e], 0x4d
jne 0x401975
cmp byte [ebp - 0x1d], 0x5a
jne 0x401975
mov dword [esp + 8], 0
mov dword [esp + 4], 0x3c
lea edi, [ebp - 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 dword [esp + 8], 0
mov eax, dword [ebp - 0x1c]
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], esi
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fread
cmp byte [ebp - 0x1e], 0xb
je 0x401a40
mov dword [esp + 8], 2
mov dword [esp + 4], 0
mov eax, dword [ebx]
mov dword [esp], eax
call sub.msvcrt.dll_fseek
mov eax, dword [ebx]
mov dword [esp], eax
call sub.msvcrt.dll_ftell
sub eax, 0x60
mov dword [ebp - 0x2c], esp
mov edi, eax
mov dword [ebp - 0x34], eax
mov eax, 0x60
call fcn.0040a610
sub esp, eax
lea eax, [esp + 0x10]
lea edx, [esp + 0x18]
mov dword [ebp - 0x38], eax
mov dword [ebp - 0x30], edx
mov esi, eax
mov dword [esp + 8], 0
mov dword [esp + 4], edi
mov eax, dword [ebx]
mov dword [esp], eax
call sub.msvcrt.dll_fseek
test eax, eax
jne 0x401a2b
mov eax, dword [ebx]
mov dword [esp + 8], 1
mov dword [esp + 4], 0x60
mov dword [esp], esi
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fread
test eax, eax
je 0x401a2b
mov edx, dword [ebp - 0x30]
lea eax, [esp + 0xf]
mov dword [ebp + 8], ebx
lea esi, [esi]
lea edi, [edi]
mov esi, str.MEI_f_v_n_v
mov edi, edx
mov ecx, 8
repe cmpsb byte [esi], byte es:[edi]
je 0x401ab0
sub edx, 1
cmp edx, eax
jne 0x401a10
mov esp, dword [ebp - 0x2c]
mov esi, 0xffffffff
lea esp, [ebp - 0xc]
mov eax, esi
pop ebx
pop esi
pop edi
pop ebp
ret
movzx eax, byte [ebp - 0x1d]
cmp al, 1
je 0x401be2
cmp al, 2
jne 0x401975
mov eax, 0xa8
mov dword [esp + 8], 0
add eax, dword [ebp - 0x1c]
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 eax, dword [ebp - 0x1c]
cmp eax, 0
je 0x401975
jg 0x401999
jmp 0x401975
mov ebx, dword [ebp + 8]
mov eax, dword [edx]
mov esi, edx
lea edi, [ebx + 0x14]
lea ecx, [ebx + 0x10]
mov dword [ebx + 0x10], eax
mov eax, dword [edx + 0x54]
and edi, 0xfffffffc
sub ecx, edi
sub esi, ecx
add ecx, 0x58
mov dword [ebx + 0x64], eax
shr ecx, 2
mov dword [ebp - 0x30], edx
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 edi, dword [ebp - 0x34]
mov edx, dword [ebp - 0x30]
sub esp, 4
sub edx, dword [ebp - 0x38]
sub edi, eax
lea eax, [edi + edx + 0x58]
mov dword [ebx + 4], eax
mov edi, dword [ebx + 4]
mov esp, dword [ebp - 0x2c]
mov eax, dword [ebx + 0x1c]
mov dword [ebx + 0x406c], 0
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
test eax, eax
mov dword [ebx + 8], eax
je 0x401c18
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 0x401bec
mov edi, dword [ebx + 8]
mov eax, dword [ebx + 0x20]
mov dword [esp], eax
call esi
add eax, edi
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 0x401c02
mov eax, dword [ebx]
test eax, eax
je 0x401a33
mov dword [esp], eax
call sub.msvcrt.dll_fclose
mov dword [ebx], 0
lea esp, [ebp - 0xc]
mov eax, esi
pop ebx
pop esi
pop edi
pop ebp
ret
lea eax, [ebx + 0x68]
mov dword [esp + 4], 0x40c020
mov dword [esp], eax
call fcn.00402ef0
test eax, eax
mov dword [ebx], eax
jne 0x4018a6
jmp 0x401a2e
mov eax, 0x98
jmp 0x401a59
mov dword [esp], str.Could_not_read_from_file.
mov esi, 0xffffffff
call fcn.00401e20
jmp 0x401a33
mov dword [esp], str.Error_on_file
mov esi, 0xffffffff
call fcn.00401e20
jmp 0x401a33
mov dword [esp], str.Could_not_allocate_buffer_for_TOC.
mov esi, 0xffffffff
call fcn.00401e20
jmp 0x401a33