Function at 0x401690
Capabilities:
Read file on windows

Disassembly:
sub esp, 0xc
push ebx
mov ebx, dword [esp + 0x14]
push ebp
push esi
push edi
mov ebp, dword [ebx]
mov dword [esp + 0x10], ebp
test ebp, ebp
jne 0x4016c6
lea eax, [ebx + 0x70]
push 0x42220c
push eax
call fcn.004029a0
mov ebp, eax
add esp, 8
mov dword [esp + 0x10], ebp
mov dword [ebx], ebp
test ebp, ebp
je 0x40182c
xorps xmm0, xmm0
push 0x2000
movlpd qword [esp + 0x18], xmm0
call fcn.0040a18f
mov edx, eax
add esp, 4
mov dword [esp + 0x20], edx
test edx, edx
je 0x4017f1
push 2
push 0
push 0
push ebp
call fcn.0040a8ca
add esp, 0x10
test eax, eax
js 0x4017ed
push ebp
call fcn.0040aebf
add esp, 4
mov esi, eax
test edx, edx
jne 0x40173f
cmp esi, 8
jb 0x4017ed
nop dword [eax]
test edx, edx
jne 0x40173f
cmp esi, 0x2000
jae 0x40173f
xorps xmm0, xmm0
movlpd qword [esp + 0x14], xmm0
mov ebp, dword [esp + 0x18]
mov edi, dword [esp + 0x14]
jmp 0x40174c
mov edi, esi
mov ebp, edx
add edi, 0xffffe000
adc ebp, 0xffffffff
sub esi, edi
cmp esi, 8
jb 0x4017c5
push 0
push ebp
push edi
push dword [esp + 0x1c]
call fcn.0040a8ca
add esp, 0x10
test eax, eax
js 0x4017c5
push dword [esp + 0x10]
push esi
push 1
push dword [esp + 0x2c]
call fcn.0040a4d3
add esp, 0x10
cmp eax, esi
jne 0x4017c5
add esi, 0xfffffff9
je 0x4017ab
mov edx, dword [esp + 0x20]
lea ecx, [edx - 1]
add ecx, esi
nop dword [eax]
mov eax, dword [ecx]
cmp eax, dword [str.MEI_f_v_n_v]
jne 0x4017a5
mov eax, dword [ecx + 4]
cmp eax, dword [0x4221e4]
je 0x4017dc
dec ecx
sub esi, 1
jne 0x401790
mov esi, edi
mov edx, ebp
add esi, 7
adc edx, 0
test ebp, ebp
jne 0x401720
test edi, edi
jne 0x401720
push dword [esp + 0x20]
call fcn.0040a174
add esp, 4
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
add esi, edi
mov edi, 0
adc edi, ebp
add esi, 0xffffffff
adc edi, 0xffffffff
jmp 0x4017f9
mov edx, dword [esp + 0x20]
mov edi, dword [esp + 0x18]
mov esi, dword [esp + 0x14]
push edx
call fcn.0040a174
mov eax, esi
add esp, 4
or eax, edi
je 0x40182c
push 0
push edi
push esi
push dword [ebx]
call fcn.0040a8ca
add esp, 0x10
test eax, eax
jns 0x401837
push str.failed_to_seek_to_cookie_position.
push str.fseek
call fcn.00401b20
add esp, 8
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0xc
ret
push dword [ebx]
lea eax, [ebx + 0x18]
push 1
push 0x58
push eax
call fcn.0040a4d3
add esp, 0x10
cmp eax, 1
jae 0x40186b
push str.failed_to_read_cookie.
push str.fread
call fcn.00401b20
add esp, 8
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
mov eax, dword [ebx + 0x24]
mov ecx, dword [ebx + 0x20]
bswap eax
mov dword [ebx + 0x24], eax
mov eax, dword [ebx + 0x28]
bswap ecx
sub esi, ecx
mov dword [ebx + 0x20], ecx
bswap eax
sbb edi, 0
mov dword [ebx + 0x28], eax
mov eax, dword [ebx + 0x2c]
add esi, 0x58
bswap eax
adc edi, 0
mov dword [ebx + 0x2c], eax
mov dword [ebx + 8], esi
mov dword [ebx + 0xc], edi
mov dword [ebx + 0x4074], 0
mov dword [0x42e964], eax
xor eax, eax
mov ecx, dword [ebx + 0x24]
add ecx, dword [ebx + 8]
push 0
adc eax, dword [ebx + 0xc]
push eax
push ecx
push dword [ebx]
call fcn.0040a8ca
push dword [ebx + 0x28]
call fcn.0040a18f
add esp, 0x14
mov dword [ebx + 0x10], eax
test eax, eax
jne 0x4018f0
push str.Could_not_allocate_buffer_for_TOC.
push str.malloc
call fcn.00401b20
add esp, 8
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
push dword [ebx]
push 1
push dword [ebx + 0x28]
push eax
call fcn.0040a4d3
add esp, 0x10
cmp eax, 1
jae 0x40190f
push str.Could_not_read_from_file.
jmp 0x401853
mov eax, dword [ebx + 0x28]
add eax, dword [ebx + 0x10]
push dword [ebx]
mov dword [ebx + 0x14], eax
call fcn.0040a2c1
add esp, 4
test eax, eax
je 0x40193e
push str.Error_on_file_n.
call fcn.00401b40
add esp, 4
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
mov edx, dword [ebx + 0x10]
cmp edx, dword [ebx + 0x14]
jae 0x401990
mov eax, dword [edx + 4]
mov ecx, dword [edx]
bswap eax
mov dword [edx + 4], eax
mov eax, dword [edx + 8]
bswap eax
mov dword [edx + 8], eax
mov eax, dword [edx + 0xc]
bswap ecx
bswap eax
mov dword [edx], ecx
mov dword [edx + 0xc], eax
add edx, ecx
cmp edx, dword [ebx + 0x10]
jb 0x401983
cmp edx, dword [ebx + 0x14]
jb 0x401946
push ebx
call fcn.00401250
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
push str.Cannot_read_Table_of_Contents._n
call fcn.00401b40
add esp, 4
push ebx
call fcn.00401250
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret