Function at 0x401e40
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 0x402000
lea edx, [esp + 0x18]
mov dword [esp + 8], 8
mov esi, dword [0x41a4d4]
mov dword [esp + 4], edx
mov edi, dword [0x41a4d8]
mov dword [esp], eax
mov dword [esp + 0x18], esi
mov dword [esp + 0x1c], edi
add byte [esp + 0x1b], 0xc
call fcn.004072e0
mov esi, eax
mov eax, edx
mov edi, edx
or eax, esi
je 0x402034
mov dword [esp + 8], 0
mov dword [esp + 4], esi
mov eax, dword [ebx]
mov dword [esp], eax
call fcn.0040dc90
test eax, eax
js 0x40205f
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 0x402020
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 [0x422048], 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.0040dc90
mov esi, dword [ebx + 0x28]
mov dword [esp], esi
call sub.msvcrt.dll_malloc
mov dword [ebx + 0x10], eax
test eax, eax
je 0x402075
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 0x40203b
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 0x402051
mov eax, dword [ebx + 0x10]
mov edi, dword [ebx + 0x14]
lea esi, [esi]
cmp eax, edi
jae 0x401fe0
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 0x401f98
mov dword [esp], str.Cannot_read_Table_of_Contents._n
call fcn.00402430
mov eax, dword [ebx + 0x14]
mov edi, eax
cmp eax, edi
jb 0x401f9c
lea esi, [esi]
lea esi, [esi]
mov eax, dword [ebx]
test eax, eax
je 0x401ff4
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.004036e0
mov dword [ebx], eax
test eax, eax
jne 0x401e55
jmp 0x402034
mov dword [esp + 4], str.Failed_to_read_cookie__n
mov dword [esp], str.fread
call fcn.00402480
mov esi, 0xffffffff
jmp 0x401ff4
mov dword [esp + 4], str.Could_not_read_full_TOC__n
mov dword [esp], str.fread
call fcn.00402480
jmp 0x402034
mov dword [esp], str.Error_on_file._n
call fcn.00402430
jmp 0x402034
mov dword [esp + 4], str.Failed_to_seek_to_cookie_position__n
mov dword [esp], str.fseek
call fcn.00402480
jmp 0x402034
mov dword [esp + 4], str.Could_not_allocate_buffer_for_TOC__n
mov dword [esp], 0x4180d2
call fcn.00402480
jmp 0x402034