Function at 0x401740
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 0x401776
lea eax, [ebx + 0x70]
push 0x426210
push eax
call fcn.00402b00
mov ebp, eax
add esp, 8
mov dword [esp + 0x10], ebp
mov dword [ebx], ebp
test ebp, ebp
je 0x4018dc
xorps xmm0, xmm0
push 0x2000
movlpd qword [esp + 0x18], xmm0
call fcn.00411473
mov edx, eax
add esp, 4
mov dword [esp + 0x20], edx
test edx, edx
je 0x4018a1
push 2
push 0
push 0
push ebp
call fcn.0040c6e5
add esp, 0x10
test eax, eax
js 0x40189d
push ebp
call fcn.0040cd0a
add esp, 4
mov esi, eax
test edx, edx
jne 0x4017ef
cmp esi, 8
jb 0x40189d
nop dword [eax]
test edx, edx
jne 0x4017ef
cmp esi, 0x2000
jae 0x4017ef
xorps xmm0, xmm0
movlpd qword [esp + 0x14], xmm0
mov ebp, dword [esp + 0x18]
mov edi, dword [esp + 0x14]
jmp 0x4017fc
mov edi, esi
mov ebp, edx
add edi, 0xffffe000
adc ebp, 0xffffffff
sub esi, edi
cmp esi, 8
jb 0x401875
push 0
push ebp
push edi
push dword [esp + 0x1c]
call fcn.0040c6e5
add esp, 0x10
test eax, eax
js 0x401875
push dword [esp + 0x10]
push esi
push 1
push dword [esp + 0x2c]
call fcn.0040c2cf
add esp, 0x10
cmp eax, esi
jne 0x401875
add esi, 0xfffffff9
je 0x40185b
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 0x401855
mov eax, dword [ecx + 4]
cmp eax, dword [0x4261e8]
je 0x40188c
dec ecx
sub esi, 1
jne 0x401840
mov esi, edi
mov edx, ebp
add esi, 7
adc edx, 0
test ebp, ebp
jne 0x4017d0
test edi, edi
jne 0x4017d0
push dword [esp + 0x20]
call fcn.00411458
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 0x4018a9
mov edx, dword [esp + 0x20]
mov edi, dword [esp + 0x18]
mov esi, dword [esp + 0x14]
push edx
call fcn.00411458
mov eax, esi
add esp, 4
or eax, edi
je 0x4018dc
push 0
push edi
push esi
push dword [ebx]
call fcn.0040c6e5
add esp, 0x10
test eax, eax
jns 0x4018e7
push str.Failed_to_seek_to_cookie_position__n
push str.fseek
call fcn.00401c10
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.0040c2cf
add esp, 0x10
cmp eax, 1
jae 0x40191b
push str.Failed_to_read_cookie__n
push str.fread
call fcn.00401c10
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 [0x433aac], 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.0040c6e5
push dword [ebx + 0x28]
call fcn.00411473
add esp, 0x14
mov dword [ebx + 0x10], eax
test eax, eax
jne 0x4019a0
push str.Could_not_allocate_buffer_for_TOC__n
push str.malloc
call fcn.00401c10
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.0040c2cf
add esp, 0x10
cmp eax, 1
jae 0x4019bf
push str.Could_not_read_full_TOC__n
jmp 0x401903
mov eax, dword [ebx + 0x28]
add eax, dword [ebx + 0x10]
push dword [ebx]
mov dword [ebx + 0x14], eax
call fcn.0040c0bd
add esp, 4
test eax, eax
je 0x4019ee
push str.Error_on_file._n
call fcn.00401c30
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 0x401a40
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 0x401a33
cmp edx, dword [ebx + 0x14]
jb 0x4019f6
push ebx
call fcn.00401280
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.00401c30
add esp, 4
push ebx
call fcn.00401280
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret