Function at 0x4c9fa4
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x20
push ebx
push esi
mov esi, ecx
xor eax, eax
mov ecx, dword [esp + 0x2c]
mov dword [esp + 0x1c], eax
xor ebx, ebx
mov dword [esp + 0x20], eax
push ecx
mov ecx, esi
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x28], eax
call fcn.004c9e20
cmp eax, ebx
mov dword [esp + 0x24], eax
jne 0x4c9fd9
pop esi
xor eax, eax
pop ebx
add esp, 0x20
ret 4
lea edx, [esi + 0x4f4]
xor eax, eax
mov dword [0x56f1e0], edx
mov dword [esp + 0xc], eax
movsx ecx, word [esi + 0x92]
mov dword [esp + 0x10], eax
lea edx, [esi + 0x8c]
push ebp
mov ebp, dword [sym.imp.MSVCRT.dll_ftell]
mov dword [esp + 0x18], eax
push edi
mov dword [esp + 0x10], ebx
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x34], edx
mov eax, dword [esp + 0x34]
movsx ecx, word [eax]
push ecx
call fcn.004caa90
add esp, 4
cmp eax, 0xffffffff
je 0x4ca078
push eax
call fcn.004caaa0
add esp, 4
test eax, eax
jle 0x4ca078
mov edx, dword [0x659a18]
add eax, 0x22
push 0
push eax
push edx
call dword [sym.imp.MSVCRT.dll_fseek]
mov eax, dword [0x659a18]
lea edi, [esp + ebx + 0x1c]
push eax
push 1
push 2
push edi
call dword [sym.imp.MSVCRT.dll_fread]
mov ecx, dword [0x659a18]
push ecx
call ebp
mov dx, word [edi]
add esp, 0x20
add word [esi + 0x92], dx
mov dword [esp + ebx + 0x20], eax
mov edx, dword [esp + 0x34]
add ebx, 4
add edx, 2
cmp ebx, 0xc
mov dword [esp + 0x34], edx
jl 0x4ca014
mov edi, dword [esi + 8]
push esi
or edi, 2
mov dword [esi + 8], edi
call fcn.004caa70
xor ebx, ebx
add esp, 4
cmp word [esi + 0x92], bx
je 0x4ca123
xor eax, eax
mov dword [esp + 0x34], eax
mov ecx, dword [esp + eax + 0x10]
lea edi, [esp + eax + 0x10]
test ecx, ecx
je 0x4ca117
mov eax, dword [esp + eax + 0x20]
mov ecx, dword [0x659a18]
push 0
push eax
push ecx
call dword [sym.imp.MSVCRT.dll_fseek]
mov edx, dword [edi]
add esp, 0xc
shl edx, 3
push edx
mov ecx, 0x6af5d8
call fcn.004a7db0
mov ecx, dword [edi]
mov ebp, eax
mov eax, dword [0x659a18]
push eax
push ecx
push 8
push ebp
call dword [sym.imp.MSVCRT.dll_fread]
mov edi, dword [edi]
add esp, 0x10
add edi, ebx
mov ecx, esi
push edi
push ebx
push ebp
call fcn.004c5690
push ebp
mov ecx, 0x6af5d8
mov ebx, edi
call fcn.004a7de0
mov eax, dword [esp + 0x34]
add eax, 4
cmp eax, 0x10
mov dword [esp + 0x34], eax
jl 0x4ca0ae
cmp dword [0x659958], 6
jl 0x4ca1b7
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x2c]
mov edi, dword [sym.imp.MSVCRT.dll_fseek]
push 0
lea ecx, [eax + edx*8]
mov edx, dword [0x659a18]
push ecx
push edx
mov byte [esp + 0x40], 0
call edi
mov eax, dword [0x659a18]
mov ebx, dword [sym.imp.MSVCRT.dll_fread]
push eax
push 1
lea ecx, [esp + 0x48]
push 1
push ecx
call ebx
mov al, byte [esp + 0x50]
add esp, 0x1c
test al, al
je 0x4ca17c
mov eax, dword [esi + 8]
or al, 4
mov dword [esi + 8], eax
cmp dword [0x659958], 0x1a
jl 0x4ca1b7
mov edx, dword [0x659a18]
push 1
push 1
push edx
call edi
mov eax, dword [0x659a18]
lea edi, [esi + 0x94]
push eax
push 1
push 2
push edi
call ebx
mov al, byte [edi]
add esp, 0x1c
test al, 4
je 0x4ca1b7
mov eax, dword [esi + 8]
or ah, 1
mov dword [esi + 8], eax
mov edx, dword [esi]
mov ecx, esi
call dword [edx + 0xa4]
mov ax, word [esi + 0x8a]
cmp ax, word [0x57aa18]
jne 0x4ca204
mov ax, word [0x57aa1a]
test ax, ax
jle 0x4ca204
movsx ecx, ax
lea ebx, [esi + 0x58]
mov dword [esi + 0x4f0], ecx
mov edi, dword [ebx]
cmp ebx, edi
je 0x4ca204
mov eax, dword [esi + 0x4f0]
mov edx, dword [edi - 0x50]
lea ecx, [edi - 0x50]
push eax
call dword [edx + 0x5c]
mov edi, dword [edi]
cmp ebx, edi
jne 0x4ca1ee
mov ecx, esi
call fcn.004c9f60
mov edx, dword [esi]
mov ecx, esi
call dword [edx + 0xc]
mov ecx, esi
call fcn.004ca320
mov ecx, esi
call fcn.004ca4c0
push 0x102
push esi
call fcn.00475740
add esp, 8
mov ecx, esi
call fcn.004c7e10
mov eax, dword [esi + 8]
mov ecx, esi
and al, 0xfd
mov dword [esi + 8], eax
mov dword [0x56f1e0], 0
call fcn.004ca8b0
pop edi
pop ebp
pop esi
mov eax, 1
pop ebx
add esp, 0x20
ret 4