Function at 0x401930
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 0x401c80
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 0x401a30
cmp byte [esp + 0x2f], 0x5a
jne 0x401a30
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 0x401c08
mov eax, dword [ebx]
lea esi, [esi]
nop
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 0x401acc
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 0x401acc
lea ebp, [esp + 0x38]
mov eax, str.MEI_f_v_n_v
lea edx, [esp + 0x2f]
nop
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 0x401ae0
sub ebp, 1
cmp ebp, edx
jne 0x401ab0
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 [0x412024], 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 0x401cec
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 0x401cb8
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 0x401cd6
mov eax, dword [ebx]
test eax, eax
je 0x401ad1
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 edx, byte [esp + 0x2f]
mov eax, dword [ebx]
cmp dl, 1
je 0x401ca8
cmp dl, 2
jne 0x401a30
mov edx, 0xa8
add edx, dword [esp + 0x30]
mov dword [esp + 8], 0
mov dword [esp + 4], edx
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]
test eax, eax
mov dword [esp + 0x1c], eax
mov eax, dword [ebx]
je 0x401a30
jg 0x401a58
jmp 0x401a30
lea eax, [ebx + 0x68]
mov dword [esp + 4], 0x40d020
mov dword [esp], eax
call fcn.00403180
mov dword [ebx], eax
test eax, eax
jne 0x40194b
jmp 0x401acc
mov edx, 0x98
jmp 0x401c26
mov dword [esp + 4], str.Could_not_read_from_file.
mov esi, 0xffffffff
mov dword [esp], str.fread
call fcn.00402090
jmp 0x401ad1
mov dword [esp], str.Error_on_file_n.
mov esi, 0xffffffff
call fcn.00402040
jmp 0x401ad1
mov dword [esp + 4], str.Could_not_allocate_buffer_for_TOC.
or esi, 0xffffffff
mov dword [esp], 0x40d17b
call fcn.00402090
jmp 0x401ad1