Function at 0x401720
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 0x401756
lea eax, [ebx + 0x70]
push 0x423210
push eax
call fcn.00402ae0
mov ebp, eax
add esp, 8
mov dword [esp + 0x10], ebp
mov dword [ebx], ebp
test ebp, ebp
je 0x4018bc
xorps xmm0, xmm0
push 0x2000
movlpd qword [esp + 0x18], xmm0
call fcn.0040ee40
mov edx, eax
add esp, 4
mov dword [esp + 0x20], edx
test edx, edx
je 0x401881
push 2
push 0
push 0
push ebp
call fcn.0040b869
add esp, 0x10
test eax, eax
js 0x40187d
push ebp
call fcn.0040be55
add esp, 4
mov esi, eax
test edx, edx
jne 0x4017cf
cmp esi, 8
jb 0x40187d
nop dword [eax]
test edx, edx
jne 0x4017cf
cmp esi, 0x2000
jae 0x4017cf
xorps xmm0, xmm0
movlpd qword [esp + 0x14], xmm0
mov ebp, dword [esp + 0x18]
mov edi, dword [esp + 0x14]
jmp 0x4017dc
mov edi, esi
mov ebp, edx
add edi, 0xffffe000
adc ebp, 0xffffffff
sub esi, edi
cmp esi, 8
jb 0x401855
push 0
push ebp
push edi
push dword [esp + 0x1c]
call fcn.0040b869
add esp, 0x10
test eax, eax
js 0x401855
push dword [esp + 0x10]
push esi
push 1
push dword [esp + 0x2c]
call fcn.0040b472
add esp, 0x10
cmp eax, esi
jne 0x401855
add esi, 0xfffffff9
je 0x40183b
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]
jne 0x401835
mov eax, dword [ecx + 4]
cmp eax, dword [0x4231e8]
je 0x40186c
dec ecx
sub esi, 1
jne 0x401820
mov esi, edi
mov edx, ebp
add esi, 7
adc edx, 0
test ebp, ebp
jne 0x4017b0
test edi, edi
jne 0x4017b0
push dword [esp + 0x20]
call fcn.0040ee25
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 0x401889
mov edx, dword [esp + 0x20]
mov edi, dword [esp + 0x18]
mov esi, dword [esp + 0x14]
push edx
call fcn.0040ee25
mov eax, esi
add esp, 4
or eax, edi
je 0x4018bc
push 0
push edi
push esi
push dword [ebx]
call fcn.0040b869
add esp, 0x10
test eax, eax
jns 0x4018c7
push str.Failed_to_seek_to_cookie_position__n
push str.fseek
call fcn.00401bf0
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.0040b472
add esp, 0x10
cmp eax, 1
jae 0x4018fb
push str.Failed_to_read_cookie__n
push str.fread
call fcn.00401bf0
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 + 0x5074], 0
mov dword [0x430a64], 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.0040b869
push dword [ebx + 0x28]
call fcn.0040ee40
add esp, 0x14
mov dword [ebx + 0x10], eax
test eax, eax
jne 0x401980
push str.Could_not_allocate_buffer_for_TOC__n
push str.malloc
call fcn.00401bf0
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.0040b472
add esp, 0x10
cmp eax, 1
jae 0x40199f
push str.Could_not_read_full_TOC__n
jmp 0x4018e3
mov eax, dword [ebx + 0x28]
add eax, dword [ebx + 0x10]
push dword [ebx]
mov dword [ebx + 0x14], eax
call fcn.0040b260
add esp, 4
test eax, eax
je 0x4019ce
push str.Error_on_file._n
call fcn.00401c10
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 0x401a20
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 0x401a13
cmp edx, dword [ebx + 0x14]
jb 0x4019d6
push ebx
call fcn.00401260
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.00401c10
add esp, 4
push ebx
call fcn.00401260
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret