Function at 0x401f00
Capabilities:
Read file on windows

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x3c
mov esi, dword [esp + 0x50]
mov dword [esp + 4], 0x419161
lea eax, [esi + 0x68]
mov dword [esp], eax
call fcn.004047f0
test eax, eax
je 0x402156
mov ebx, eax
mov eax, dword [0x41b608]
mov edi, 0xffffffff
mov dword [esp + 8], 8
mov dword [esp], ebx
mov edx, dword [0x41b60c]
mov dword [esp + 0x28], eax
shr eax, 0x18
add eax, 0xc
mov dword [esp + 0x2c], edx
mov byte [esp + 0x2b], al
lea eax, [esp + 0x28]
mov dword [esp + 4], eax
call fcn.004090f0
mov ebp, edx
or ebp, eax
jne 0x401f80
mov dword [esp], ebx
call sub.msvcrt.dll_fclose
add esp, 0x3c
mov eax, edi
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 8], 0
mov dword [esp + 4], eax
mov dword [esp], ebx
mov dword [esp + 0x14], edx
mov dword [esp + 0x10], eax
call fcn.0040fc80
mov edx, dword [esp + 0x10]
mov ecx, dword [esp + 0x14]
test eax, eax
js 0x402100
lea eax, [esi + 0x10]
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 1
mov dword [esp + 4], 0x58
mov dword [esp], eax
mov dword [esp + 0x10], edx
mov dword [esp + 0x14], ecx
call sub.msvcrt.dll_fread
mov edx, dword [esp + 0x10]
mov ecx, dword [esp + 0x14]
test eax, eax
je 0x402120
mov ebp, dword [esi + 0x1c]
mov eax, dword [esi + 0x18]
add edx, 0x58
mov dword [esp + 0x1c], 0
mov dword [esi + 0x5070], 0
adc ecx, 0
bswap ebp
mov dword [esi + 0x1c], ebp
bswap eax
mov dword [esp + 0x10], ebp
mov ebp, dword [esi + 0x20]
mov dword [esi + 0x18], eax
mov dword [esp + 0x18], eax
bswap ebp
mov eax, edx
sub eax, dword [esp + 0x18]
mov dword [esi + 0x20], ebp
mov ebp, dword [esi + 0x24]
mov edx, ecx
mov dword [esi], eax
sbb edx, dword [esp + 0x1c]
add eax, dword [esp + 0x10]
mov dword [esi + 4], edx
bswap ebp
mov dword [esi + 0x24], ebp
mov dword [esp + 8], 0
mov dword [esp + 4], eax
mov dword [esp], ebx
mov dword [0x422040], ebp
call fcn.0040fc80
mov ebp, dword [esi + 0x20]
mov dword [esp], ebp
call sub.msvcrt.dll_malloc
mov dword [esi + 8], eax
test eax, eax
je 0x402160
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 1
mov dword [esp + 4], ebp
mov dword [esp], eax
call sub.msvcrt.dll_fread
test eax, eax
je 0x4020e0
mov eax, dword [esi + 0x20]
add eax, dword [esi + 8]
mov dword [esi + 0xc], eax
mov dword [esp], ebx
call sub.msvcrt.dll_ferror
mov edi, eax
test eax, eax
jne 0x402140
mov eax, dword [esi + 8]
mov esi, dword [esi + 0xc]
cmp eax, esi
jae 0x401f68
lea esi, [esi]
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 esi, eax
ja 0x4020b0
jmp 0x401f68
mov dword [esp + 4], str.Could_not_read_full_TOC__n
mov dword [esp], str.fread
call fcn.00403190
jmp 0x401f68
mov dword [esp + 4], str.Failed_to_seek_to_cookie_position__n
mov dword [esp], str.fseek
call fcn.00403190
jmp 0x401f68
mov dword [esp + 4], str.Failed_to_read_cookie__n
mov dword [esp], str.fread
call fcn.00403190
jmp 0x401f68
mov dword [esp], str.Error_on_file._n
mov edi, 0xffffffff
call fcn.00403030
jmp 0x401f68
mov edi, 0xffffffff
jmp 0x401f70
mov dword [esp + 4], str.Could_not_allocate_buffer_for_TOC__n
mov dword [esp], str.malloc
call fcn.00403190
jmp 0x401f68