Function at 0x4018e0
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 0x401c40
mov dword [esp + 8], 0
mov dword [esp + 4], 0
lea esi, [esp + 0x2e]
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], esi
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fread
cmp byte [esp + 0x2e], 0x4d
mov eax, dword [ebx]
jne 0x4019e0
cmp byte [esp + 0x2f], 0x5a
jne 0x4019e0
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], esi
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fread
cmp byte [esp + 0x2e], 0xb
je 0x401bc0
mov eax, dword [ebx]
nop
lea esi, [esi]
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 [ebx]
mov edx, dword [esp + 0x1c]
mov dword [esp + 8], 0
mov dword [esp], eax
sub edx, 0x60
mov dword [esp + 4], edx
call sub.msvcrt.dll_fseek
test eax, eax
jne 0x401a77
mov eax, dword [ebx]
lea edi, [esp + 0x30]
mov dword [esp + 8], 1
mov dword [esp + 4], 0x60
mov dword [esp], edi
mov dword [esp + 0x18], edi
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fread
test eax, eax
je 0x401a77
lea ebp, [esp + 0x38]
mov eax, str.MEI_f_v_n_v
mov dword [esp + 0xb0], ebx
mov edx, edi
mov ecx, 8
mov esi, eax
mov edi, ebp
repe cmpsb byte [esi], byte es:[edi]
je 0x401a90
sub ebp, 1
cmp ebp, edx
jae 0x401a63
mov esi, 0xffffffff
add esp, 0x9c
mov eax, esi
pop ebx
pop esi
pop edi
pop ebp
ret
mov ebx, dword [esp + 0xb0]
mov eax, dword [ebp]
mov esi, ebp
lea edi, [ebx + 0x14]
lea ecx, [ebx + 0x10]
mov dword [ebx + 0x10], eax
mov eax, dword [ebp + 0x54]
and edi, 0xfffffffc
sub ecx, edi
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
sub esp, 4
mov dword [ebx + 0x406c], 0
sub ebp, dword [esp + 0x18]
mov edx, dword [esp + 0x1c]
sub edx, eax
lea eax, [edx + ebp - 8]
mov dword [ebx + 4], eax
mov eax, dword [ebx + 0x24]
mov dword [esp], eax
call esi
mov edi, dword [ebx + 4]
mov dword [0x414020], eax
sub esp, 4
mov eax, dword [ebx + 0x1c]
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 0x401ca0
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 0x401c6c
mov edi, dword [ebx + 8]
mov eax, dword [ebx + 0x20]
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
test eax, eax
mov esi, eax
jne 0x401c8a
mov eax, dword [ebx]
test eax, eax
je 0x401a7c
mov dword [esp], eax
call sub.msvcrt.dll_fclose
mov dword [ebx], 0
add esp, 0x9c
mov eax, esi
pop ebx
pop esi
pop edi
pop ebp
ret
movzx esi, byte [esp + 0x2f]
mov eax, dword [ebx]
mov edx, esi
cmp dl, 1
je 0x401c62
cmp dl, 2
mov ecx, 0xa8
jne 0x4019e0
add ecx, dword [esp + 0x30]
mov dword [esp + 8], 0
mov dword [esp], eax
mov dword [esp + 4], ecx
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]
cmp eax, 0
mov dword [esp + 0x1c], eax
mov eax, dword [ebx]
je 0x4019e0
jg 0x401a08
jmp 0x4019e0
lea eax, [ebx + 0x68]
mov dword [esp + 4], 0x40e020
mov dword [esp], eax
call fcn.00403470
test eax, eax
mov dword [ebx], eax
jne 0x4018fb
jmp 0x401a77
mov ecx, 0x98
jmp 0x401be0
mov dword [esp + 4], str.Could_not_read_from_file.
mov dword [esp], str.fread
mov esi, 0xffffffff
call fcn.00402190
jmp 0x401a7c
mov dword [esp], str.Error_on_file_n.
mov esi, 0xffffffff
call fcn.00402030
jmp 0x401a7c
mov dword [esp + 4], str.Could_not_allocate_buffer_for_TOC.
mov dword [esp], 0x40e17b
mov esi, 0xffffffff
call fcn.00402190
jmp 0x401a7c