Function at 0x401990
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x10
mov eax, dword [0x437034]
xor eax, esp
mov dword [esp + 0xc], eax
push ebx
push esi
mov esi, dword [esp + 0x1c]
push edi
mov dword [esp + 0xc], 0xffffffff
lea ebx, [esi + 0x68]
push ebx
push str.LOADER:_archivename_is__s_n
call fcn.00402760
push 0x428580
push ebx
call fcn.00403c10
mov edi, eax
add esp, 0x10
test edi, edi
jne 0x4019f2
push ebx
push str.LOADER:_Cannot_open_archive:__s_n
call fcn.00402760
add esp, 8
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0xc]
xor ecx, esp
call fcn.0040b4e7
add esp, 0x10
ret
mov ecx, dword [0x42afc4]
mov eax, dword [0x42afc8]
mov dword [esp + 0x10], ecx
mov dword [esp + 0x14], eax
push ebp
shrd ecx, eax, 0x18
push 8
lea eax, [esp + 0x18]
add cl, 0xc
push eax
push edi
mov byte [esp + 0x23], cl
call fcn.00407f60
mov ebp, edx
add esp, 0xc
mov ebx, eax
or eax, ebp
jne 0x401a3b
push str.LOADER:_Cannot_find_cookie__n
call fcn.00402760
add esp, 4
jmp 0x401b9d
push ebp
push ebx
push str.LOADER:_Cookie_found_at_offset_0x_llX_n
call fcn.00402760
push 0
push ebp
push ebx
push edi
call fcn.0040f0d6
add esp, 0x1c
test eax, eax
jns 0x401a6f
push str.Failed_to_seek_to_cookie_position__n
push str.fseek
call fcn.00402520
add esp, 8
jmp 0x401b9d
push edi
push 1
lea eax, [esi + 0x10]
push 0x58
push eax
call fcn.0040ecb2
add esp, 0x10
cmp eax, 1
jae 0x401a9c
push str.Failed_to_read_cookie__n
push str.fread
call fcn.00402520
add esp, 8
jmp 0x401b9d
mov eax, dword [esi + 0x1c]
mov ecx, dword [esi + 0x18]
bswap eax
mov dword [esi + 0x1c], eax
mov eax, dword [esi + 0x20]
bswap ecx
sub ebx, ecx
mov dword [esi + 0x18], ecx
bswap eax
sbb ebp, 0
mov dword [esi + 0x20], eax
mov eax, dword [esi + 0x24]
add ebx, 0x58
bswap eax
adc ebp, 0
mov dword [esi + 0x24], eax
mov dword [esi], ebx
mov dword [esi + 4], ebp
mov dword [esi + 0x5070], 0
mov dword [0x437adc], eax
xor eax, eax
mov ecx, dword [esi + 0x1c]
add ecx, dword [esi]
push 0
adc eax, dword [esi + 4]
push eax
push ecx
push edi
call fcn.0040f0d6
push dword [esi + 0x20]
call fcn.00412db9
add esp, 0x14
mov dword [esi + 8], eax
test eax, eax
jne 0x401b18
push str.Could_not_allocate_buffer_for_TOC__n
push str.malloc
call fcn.00402520
add esp, 8
jmp 0x401b9d
push edi
push 1
push dword [esi + 0x20]
push eax
call fcn.0040ecb2
add esp, 0x10
cmp eax, 1
jae 0x401b40
push str.Could_not_read_full_TOC__n
push str.fread
call fcn.00402520
add esp, 8
jmp 0x401b9d
mov eax, dword [esi + 0x20]
add eax, dword [esi + 8]
push edi
mov dword [esi + 0xc], eax
call fcn.0040eaad
add esp, 4
test eax, eax
je 0x401b65
push str.Error_on_file._n
call fcn.00402680
add esp, 4
jmp 0x401b9d
mov eax, dword [esi + 8]
cmp eax, dword [esi + 0xc]
jae 0x401b95
nop dword [eax]
mov ecx, dword [eax + 4]
mov edx, dword [eax]
bswap ecx
mov dword [eax + 4], ecx
mov ecx, dword [eax + 8]
bswap ecx
mov dword [eax + 8], ecx
mov ecx, dword [eax + 0xc]
bswap edx
bswap ecx
mov dword [eax], edx
mov dword [eax + 0xc], ecx
add eax, edx
cmp eax, dword [esi + 0xc]
jb 0x401b70
mov dword [esp + 0x10], 0
push edi
call fcn.0040ea51
mov ecx, dword [esp + 0x20]
add esp, 4
mov eax, dword [esp + 0x10]
pop ebp
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0040b4e7
add esp, 0x10
ret