Function at 0x4ad620
Capabilities:
Read file on windows

Disassembly:
push esi
push ebx
sub esp, 0x14
mov eax, dword [0x5cf3c0]
test eax, eax
je 0x4ad646
sub esp, 0xc
push str.pak_init_already_initialized_
call fcn.004bc700
xor eax, eax
add esp, 0x10
add esp, 0x14
pop ebx
pop esi
ret
call fcn.004ad5f0
test eax, eax
je 0x4ad661
mov dword [0x5cf3c0], 1
xor eax, eax
add esp, 0x14
pop ebx
pop esi
ret
mov dword [0x5cf510], 0x4ad5d0
mov dword [0x5cf520], 0x4ad350
mov dword [0x5cf530], 0x4ad090
mov dword [0x5cf540], 0x4ad140
push esi
push 0x309
push 0x8000
push str.bor.pak
call sub.msvcrt.dll__open
add esp, 0x10
mov dword [0x5cf410], eax
test eax, eax
js 0x4ad8de
push edx
push 2
push 0
push eax
call sub.msvcrt.dll__lseek
mov dword [0x5cf420], eax
pop eax
mov eax, dword [0x5cf410]
push eax
call sub.msvcrt.dll__close
add esp, 0xc
push 0x309
push 0x8000
push str.bor.pak
call sub.msvcrt.dll__open
add esp, 0xc
mov dword [0x5cf410], eax
push 4
lea edx, [esp + 0x18]
push edx
push eax
call sub.msvcrt.dll__read
add esp, 0x10
cmp eax, 4
jne 0x4ad710
mov eax, dword [esp + 0x10]
cmp eax, 0x4b434150
je 0x4ad72a
cmp eax, 0x4b415053
je 0x4ad72a
sub esp, 0xc
mov eax, dword [0x5cf410]
push eax
call sub.msvcrt.dll__close
add esp, 0x10
or eax, 0xffffffff
add esp, 0x14
pop ebx
pop esi
ret
push esi
push 4
lea eax, [esp + 0x14]
mov ebx, dword [0x5cf410]
push eax
push ebx
call sub.msvcrt.dll__read
add esp, 0x10
cmp eax, 4
jne 0x4ad710
mov eax, dword [esp + 0xc]
test eax, eax
je 0x4ad755
cmp eax, 0x10000000
jne 0x4ad710
mov dword [0x5cf280], 0
cmp dword [esp + 0x10], 0x4b415053
jne 0x4ad774
cmp eax, 0x10000000
je 0x4ad969
sub esp, 0xc
push 0x1000
call sub.msvcrt.dll_malloc
add esp, 0x10
mov esi, eax
test eax, eax
je 0x4ad926
mov ebx, dword [0x5cf420]
mov ecx, 2
sub ebx, 4
mov edx, ebx
sar edx, 0xb
call fcn.004ac770
test eax, eax
jle 0x4ad93d
and ebx, 0x7ff
sub esp, 0xc
lea eax, [ebx + esi]
push eax
call fcn.004bbfd0
mov dword [esp], esi
mov dword [0x5cf4d0], eax
call sub.msvcrt.dll_free
mov edx, dword [0x5cf4d0]
mov ecx, dword [0x5cf420]
add esp, 0x10
cmp edx, ecx
jge 0x4ad90f
test edx, edx
js 0x4ad90f
mov esi, edx
lea ebx, [ecx + 0x7ff]
and esi, 0xfffff800
mov eax, ecx
sub ebx, esi
sub eax, edx
and ebx, 0xfffff800
mov dword [0x5cf4e0], eax
cmp ebx, 0x80000
jg 0x4ad954
sub esp, 0xc
push ebx
call sub.msvcrt.dll_malloc
add esp, 0x10
mov dword [0x5cf4f0], eax
test eax, eax
je 0x4ad998
sar ebx, 0xb
sar esi, 0xb
mov ecx, ebx
mov edx, esi
call fcn.004ac770
cmp ebx, eax
jne 0x4ad9af
mov edx, dword [0x5cf4d0]
mov eax, dword [0x5cf4f0]
and edx, 0x7ff
add edx, eax
mov eax, dword [0x5cf4e0]
mov dword [0x5cf500], edx
cmp eax, 3
jle 0x4ad876
sub eax, 4
mov dword [0x5cf4e0], eax
mov byte [edx + eax], 0
mov dword [0x5cf430], 0
mov eax, 1
mov dword [eax*4 + 0x5cf430], 0
inc eax
cmp eax, 8
jne 0x4ad885
mov edx, dword [0x5cf420]
sub esp, 0xc
add edx, 0x7ff
mov eax, edx
push 8
sar eax, 0x1f
push 0x60
shr eax, 0x15
push 0x8000
add eax, edx
sar eax, 0xb
push eax
mov eax, dword [0x5cf410]
push eax
call fcn.004addf0
mov eax, 0x300040
add esp, 0x20
mov dword [0x5cf3c0], 1
jmp 0x4ad640
call sub.msvcrt.dll__errno
sub esp, 0xc
mov ebx, dword [eax]
push ebx
call sub.msvcrt.dll_strerror
mov ecx, dword [0x5cf410]
push eax
push ecx
push str.bor.pak
push str.error_opening__s___d____could_not_get_a_valid_device_descriptor._n_s_n
call fcn.004bc700
xor eax, eax
add esp, 0x20
jmp 0x4ad640
sub esp, 0xc
push str.invalid_pak_header_pointer_n
call fcn.004bc700
xor eax, eax
add esp, 0x10
jmp 0x4ad640
sub esp, 0xc
push str.sector_malloc_failed_n
call fcn.004bc700
xor eax, eax
add esp, 0x10
jmp 0x4ad640
sub esp, 0xc
push str.unable_to_read_pak_header_pointer_n
call fcn.004bc700
xor eax, eax
add esp, 0x10
jmp 0x4ad640
push eax
push eax
push ebx
push str.Warning:_pak_header_is_too_large:__d___524288_n
call fcn.004bc700
add esp, 0x10
jmp 0x4ad817
mov edx, dword [0x5cf410]
push ecx
push 4
push 0x5cf290
push edx
call sub.msvcrt.dll__read
add esp, 0x10
cmp eax, 4
jne 0x4ad710
mov dword [0x5cf280], 1
jmp 0x4ad774
sub esp, 0xc
push str.pak_cdheader_malloc_failed_n
call fcn.004bc700
xor eax, eax
add esp, 0x10
jmp 0x4ad640
sub esp, 0xc
push str.unable_to_read_pak_header_n
call fcn.004bc700
xor eax, eax
add esp, 0x10
jmp 0x4ad640