Function at 0x401d60
Capabilities:
Read file on windows

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x2c
mov ebx, dword [esp + 0x40]
mov eax, dword [ebx]
test eax, eax
je 0x401f20
mov edx, dword [0x41a520]
mov dword [esp + 8], 8
mov dword [esp], eax
mov ecx, dword [0x41a524]
mov dword [esp + 0x18], edx
shr edx, 0x18
add edx, 0xc
mov dword [esp + 0x1c], ecx
mov byte [esp + 0x1b], dl
lea edx, [esp + 0x18]
mov dword [esp + 4], edx
call fcn.004072a0
mov esi, eax
mov eax, edx
mov edi, edx
or eax, esi
je 0x401f54
mov dword [esp + 8], 0
mov dword [esp + 4], esi
mov eax, dword [ebx]
mov dword [esp], eax
call fcn.0040dbe0
test eax, eax
js 0x401f7f
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 0x401f40
mov edx, dword [ebx + 0x24]
mov eax, dword [ebx + 0x20]
add esi, 0x58
mov dword [ebx + 0x5074], 0
adc edi, 0
bswap edx
mov dword [ebx + 0x24], edx
mov ebp, edx
mov edx, dword [ebx + 0x28]
bswap eax
mov dword [ebx + 0x20], eax
bswap edx
mov dword [ebx + 0x28], edx
mov edx, dword [ebx + 0x2c]
bswap edx
mov dword [ebx + 0x2c], edx
mov ecx, edx
xor edx, edx
sub esi, eax
mov dword [0x422040], ecx
sbb edi, edx
add ebp, esi
mov dword [ebx + 8], esi
mov dword [ebx + 0xc], edi
mov dword [esp + 8], 0
mov dword [esp + 4], ebp
mov eax, dword [ebx]
mov dword [esp], eax
call fcn.0040dbe0
mov esi, dword [ebx + 0x28]
mov dword [esp], esi
call sub.msvcrt.dll_malloc
mov dword [ebx + 0x10], eax
test eax, eax
je 0x401f95
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 0x401f5b
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 0x401f71
mov eax, dword [ebx + 0x10]
mov edi, dword [ebx + 0x14]
lea esi, [esi]
cmp eax, edi
jae 0x401f00
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 0x401ec0
mov dword [esp], str.Cannot_read_Table_of_Contents._n
call fcn.00402350
mov eax, dword [ebx + 0x14]
mov edi, eax
cmp eax, edi
jb 0x401ec4
nop
mov eax, dword [ebx]
test eax, eax
je 0x401f14
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.00403610
mov dword [ebx], eax
test eax, eax
jne 0x401d75
jmp 0x401f54
mov dword [esp + 4], str.Failed_to_read_cookie__n
mov dword [esp], str.fread
call fcn.004023a0
mov esi, 0xffffffff
jmp 0x401f14
mov dword [esp + 4], str.Could_not_read_full_TOC__n
mov dword [esp], str.fread
call fcn.004023a0
jmp 0x401f54
mov dword [esp], str.Error_on_file._n
call fcn.00402350
jmp 0x401f54
mov dword [esp + 4], str.Failed_to_seek_to_cookie_position__n
mov dword [esp], str.fseek
call fcn.004023a0
jmp 0x401f54
mov dword [esp + 4], str.Could_not_allocate_buffer_for_TOC__n
mov dword [esp], str.malloc
call fcn.004023a0
jmp 0x401f54