Function at 0x401e90
Capabilities:
Read file on windows

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x2c
mov ebx, dword [esp + 0x40]
mov edx, dword [ebx]
test edx, edx
je 0x402050
mov eax, dword [0x41a52c]
mov dword [esp + 8], 8
mov dword [esp], edx
mov ecx, dword [0x41a530]
mov dword [esp + 0x18], eax
shr eax, 0x18
add eax, 0xc
mov dword [esp + 0x1c], ecx
mov byte [esp + 0x1b], al
lea eax, [esp + 0x18]
mov dword [esp + 4], eax
call fcn.00408360
mov edi, edx
or edx, eax
mov esi, eax
je 0x40206f
mov dword [esp + 8], 0
mov dword [esp + 4], esi
mov eax, dword [ebx]
mov dword [esp], eax
call fcn.0040ec20
test eax, eax
js 0x4020bf
mov eax, dword [ebx]
mov dword [esp + 8], 1
mov dword [esp + 4], 0x58
mov dword [esp + 0xc], eax
lea eax, [ebx + 0x18]
mov dword [esp], eax
call sub.msvcrt.dll_fread
test eax, eax
je 0x402091
mov eax, dword [ebx + 0x20]
mov edx, dword [ebx + 0x28]
add esi, 0x58
mov dword [ebx + 0x5074], 0
mov ebp, dword [ebx + 0x24]
mov ecx, dword [ebx + 0x2c]
adc edi, 0
bswap eax
bswap edx
mov dword [ebx + 0x28], edx
xor edx, edx
sub esi, eax
bswap ebp
mov dword [ebx + 0x20], eax
bswap ecx
mov dword [ebx + 8], esi
sbb edi, edx
add esi, ebp
mov dword [ebx + 0x2c], ecx
mov dword [ebx + 0x24], ebp
mov dword [ebx + 0xc], edi
mov dword [esp + 4], esi
mov dword [esp + 8], 0
mov eax, dword [ebx]
mov dword [0x422040], ecx
mov dword [esp], eax
call fcn.0040ec20
mov esi, dword [ebx + 0x28]
mov dword [esp], esi
call sub.msvcrt.dll_malloc
mov dword [ebx + 0x10], eax
test eax, eax
je 0x4020d5
mov edx, dword [ebx]
mov dword [esp + 8], 1
mov dword [esp + 4], esi
mov dword [esp + 0xc], edx
mov dword [esp], eax
call sub.msvcrt.dll_fread
test eax, eax
je 0x402076
mov eax, dword [ebx + 0x28]
add eax, dword [ebx + 0x10]
mov dword [ebx + 0x14], eax
mov eax, dword [ebx]
mov dword [esp], eax
call sub.msvcrt.dll_ferror
mov esi, eax
test eax, eax
jne 0x4020ac
mov eax, dword [ebx + 0x10]
mov edi, dword [ebx + 0x14]
lea esi, [esi]
cmp eax, edi
jae 0x402030
mov ecx, dword [eax + 4]
mov edx, dword [eax]
bswap ecx
mov dword [eax + 4], ecx
mov ecx, dword [eax + 8]
bswap edx
mov dword [eax], edx
bswap ecx
mov dword [eax + 8], ecx
mov ecx, dword [eax + 0xc]
bswap ecx
mov dword [eax + 0xc], ecx
add eax, edx
cmp eax, dword [ebx + 0x10]
jae 0x401fe8
mov dword [esp], str.Cannot_read_Table_of_Contents._n
call fcn.00402f00
mov eax, dword [ebx + 0x14]
mov edi, eax
cmp eax, edi
jb 0x401fec
lea esi, [esi]
lea esi, [esi]
mov eax, dword [ebx]
test eax, eax
je 0x402044
mov dword [esp], eax
call sub.msvcrt.dll_fclose
mov dword [ebx], 0
add esp, 0x2c
mov eax, esi
pop ebx
pop esi
pop edi
pop ebp
ret
lea eax, [ebx + 0x70]
mov dword [esp + 4], 0x418184
mov dword [esp], eax
call fcn.00404700
mov dword [ebx], eax
mov edx, eax
test eax, eax
jne 0x401ea5
mov esi, 0xffffffff
jmp 0x402044
mov dword [esp + 4], str.Could_not_read_full_TOC__n
mov esi, 0xffffffff
mov dword [esp], str.fread
call fcn.00403060
jmp 0x402044
mov dword [esp + 4], str.Failed_to_read_cookie__n
mov esi, 0xffffffff
mov dword [esp], str.fread
call fcn.00403060
jmp 0x402044
mov dword [esp], str.Error_on_file._n
mov esi, 0xffffffff
call fcn.00402f00
jmp 0x402044
mov dword [esp + 4], str.Failed_to_seek_to_cookie_position__n
mov dword [esp], str.fseek
call fcn.00403060
jmp 0x40206f
mov dword [esp + 4], str.Could_not_allocate_buffer_for_TOC__n
or esi, 0xffffffff
mov dword [esp], 0x4180d2
call fcn.00403060
jmp 0x402044