Function at 0x401630
Capabilities:
Read file on windows

Disassembly:
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x14]
mov ebp, dword [edi]
test ebp, ebp
jne 0x40165b
lea eax, [edi + 0x68]
push 0x42121c
push eax
call fcn.00402a60
mov ebp, eax
add esp, 8
mov dword [edi], ebp
test ebp, ebp
je 0x401763
push 0x2000
xor esi, esi
call fcn.0040a0df
mov ebx, eax
add esp, 4
mov dword [esp + 0x14], ebx
test ebx, ebx
je 0x401733
push 2
push esi
push ebp
call fcn.0040a81a
add esp, 0xc
test eax, eax
js 0x401733
push ebp
call fcn.0040ae36
mov esi, eax
add esp, 4
cmp esi, 8
jb 0x401731
xor eax, eax
lea ebx, [esi - 0x2000]
cmp esi, 0x2000
cmovb ebx, eax
sub esi, ebx
cmp esi, 8
jb 0x401712
push eax
push ebx
push ebp
call fcn.0040a81a
add esp, 0xc
test eax, eax
js 0x401712
push ebp
push esi
push 1
push dword [esp + 0x20]
call fcn.0040a423
add esp, 0x10
cmp eax, esi
jne 0x401712
lea edx, [esi - 7]
test edx, edx
je 0x40170b
mov ecx, dword [esp + 0x14]
dec ecx
add ecx, edx
nop dword [eax]
mov eax, dword [ecx]
cmp eax, dword [str.MEI_f_v_n_v]
jne 0x401705
mov eax, dword [ecx + 4]
cmp eax, dword [0x4211f4]
je 0x401726
dec ecx
sub edx, 1
jne 0x4016f0
lea esi, [ebx + 7]
test ebx, ebx
jne 0x4016a0
push dword [esp + 0x14]
call fcn.0040a0c4
add esp, 4
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
ret
lea esi, [ebx - 1]
mov ebx, dword [esp + 0x14]
add esi, edx
jmp 0x401733
xor esi, esi
push ebx
call fcn.0040a0c4
add esp, 4
test esi, esi
je 0x401763
push 0
push esi
push dword [edi]
call fcn.0040a81a
add esp, 0xc
test eax, eax
jns 0x40176b
push str.failed_to_seek_to_cookie_position.
push str.fseek
call fcn.004019f0
add esp, 8
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
ret
push dword [edi]
lea eax, [edi + 0x10]
push 1
push 0x58
push eax
call fcn.0040a423
add esp, 0x10
cmp eax, 1
jae 0x40179c
push str.failed_to_read_cookie.
push str.fread
call fcn.004019f0
add esp, 8
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
ret
mov ecx, dword [edi + 0x18]
bswap ecx
mov dword [edi + 0x18], ecx
sub esi, ecx
mov eax, dword [edi + 0x1c]
add esi, 0x58
bswap eax
mov dword [edi + 0x1c], eax
mov eax, dword [edi + 0x20]
bswap eax
mov dword [edi + 0x20], eax
mov eax, dword [edi + 0x24]
bswap eax
mov dword [edi + 0x24], eax
mov dword [edi + 4], esi
mov dword [edi + 0x406c], 0
mov dword [0x42d954], eax
mov eax, dword [edi + 0x1c]
add eax, dword [edi + 4]
push 0
push eax
push dword [edi]
call fcn.0040a81a
push dword [edi + 0x20]
call fcn.0040a0df
add esp, 0x10
mov dword [edi + 8], eax
test eax, eax
jne 0x40180f
push str.Could_not_allocate_buffer_for_TOC.
push str.malloc
call fcn.004019f0
add esp, 8
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
ret
push dword [edi]
push 1
push dword [edi + 0x20]
push eax
call fcn.0040a423
add esp, 0x10
cmp eax, 1
jae 0x40182e
push str.Could_not_read_from_file.
jmp 0x401787
mov eax, dword [edi + 0x20]
add eax, dword [edi + 8]
push dword [edi]
mov dword [edi + 0xc], eax
call fcn.0040a211
add esp, 4
test eax, eax
je 0x40185a
push str.Error_on_file_n.
call fcn.00401b50
add esp, 4
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
ret
mov edx, dword [edi + 8]
cmp edx, dword [edi + 0xc]
jae 0x4018b9
mov esi, dword [0x436a50]
cmp esi, 2
jl 0x40187e
movups xmm0, xmmword [edx]
pshufb xmm0, xmmword [0x4215c0]
movups xmmword [edx], xmm0
jmp 0x40188e
xor eax, eax
mov ecx, dword [edx + eax*4]
bswap ecx
mov dword [edx + eax*4], ecx
inc eax
cmp eax, 4
jl 0x401880
add edx, dword [edx]
mov ecx, dword [edi + 0xc]
cmp edx, dword [edi + 8]
jb 0x4018ac
cmp edx, ecx
jb 0x401868
push edi
call fcn.00401230
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
ret
push str.Cannot_read_Table_of_Contents._n
call fcn.00401b50
add esp, 4
push edi
call fcn.00401230
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
ret