Function at 0x401730
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 0x401766
lea eax, [ebx + 0x70]
push 0x423210
push eax
call fcn.00402b80
mov ebp, eax
add esp, 8
mov dword [esp + 0x10], ebp
mov dword [ebx], ebp
test ebp, ebp
je 0x4018cc
xorps xmm0, xmm0
push 0x2000
movlpd qword [esp + 0x18], xmm0
call fcn.0040bb9f
mov edx, eax
add esp, 4
mov dword [esp + 0x20], edx
test edx, edx
je 0x401891
push 2
push 0
push 0
push ebp
call fcn.0040b2f5
add esp, 0x10
test eax, eax
js 0x40188d
push ebp
call fcn.0040b8e1
add esp, 4
mov esi, eax
test edx, edx
jne 0x4017df
cmp esi, 8
jb 0x40188d
nop dword [eax]
test edx, edx
jne 0x4017df
cmp esi, 0x2000
jae 0x4017df
xorps xmm0, xmm0
movlpd qword [esp + 0x14], xmm0
mov ebp, dword [esp + 0x18]
mov edi, dword [esp + 0x14]
jmp 0x4017ec
mov edi, esi
mov ebp, edx
add edi, 0xffffe000
adc ebp, 0xffffffff
sub esi, edi
cmp esi, 8
jb 0x401865
push 0
push ebp
push edi
push dword [esp + 0x1c]
call fcn.0040b2f5
add esp, 0x10
test eax, eax
js 0x401865
push dword [esp + 0x10]
push esi
push 1
push dword [esp + 0x2c]
call fcn.0040aefe
add esp, 0x10
cmp eax, esi
jne 0x401865
add esi, 0xfffffff9
je 0x40184b
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 0x401845
mov eax, dword [ecx + 4]
cmp eax, dword [0x4231e8]
je 0x40187c
dec ecx
sub esi, 1
jne 0x401830
mov esi, edi
mov edx, ebp
add esi, 7
adc edx, 0
test ebp, ebp
jne 0x4017c0
test edi, edi
jne 0x4017c0
push dword [esp + 0x20]
call fcn.0040bb84
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 0x401899
mov edx, dword [esp + 0x20]
mov edi, dword [esp + 0x18]
mov esi, dword [esp + 0x14]
push edx
call fcn.0040bb84
mov eax, esi
add esp, 4
or eax, edi
je 0x4018cc
push 0
push edi
push esi
push dword [ebx]
call fcn.0040b2f5
add esp, 0x10
test eax, eax
jns 0x4018d7
push str.Failed_to_seek_to_cookie_position__n
push str.fseek
call fcn.00401bc0
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.0040aefe
add esp, 0x10
cmp eax, 1
jae 0x40190b
push str.Failed_to_read_cookie__n
push str.fread
call fcn.00401bc0
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 [0x430a74], 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.0040b2f5
push dword [ebx + 0x28]
call fcn.0040bb9f
add esp, 0x14
mov dword [ebx + 0x10], eax
test eax, eax
jne 0x401990
push str.Could_not_allocate_buffer_for_TOC__n
push str.malloc
call fcn.00401bc0
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.0040aefe
add esp, 0x10
cmp eax, 1
jae 0x4019af
push str.Could_not_read_full_TOC__n
jmp 0x4018f3
mov eax, dword [ebx + 0x28]
add eax, dword [ebx + 0x10]
push dword [ebx]
mov dword [ebx + 0x14], eax
call fcn.0040acec
add esp, 4
test eax, eax
je 0x4019de
push str.Error_on_file._n
call fcn.00401be0
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 0x401a30
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 0x401a23
cmp edx, dword [ebx + 0x14]
jb 0x4019e6
push ebx
call fcn.00401270
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.00401be0
add esp, 4
push ebx
call fcn.00401270
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret