Function at 0x4f9aa0
Capabilities:
Get file size
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x53a619
mov eax, dword fs:[0]
push eax
sub esp, 0x38
mov eax, dword [0x59a0a0]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 4], 1
xor ebx, ebx
mov eax, dword [ebp + 8]
mov dword [ebp - 0x34], ebx
mov dword [ebp - 0x38], ebx
cmp dword [eax - 0xc], ebx
je 0x4f9d0f
cmp dword [ebp + 0x1c], ebx
sete cl
test cl, cl
je 0x4f9af7
mov ebx, str.channelId10004822
jmp 0x4f9b02
cmp dword [ebp + 0x20], 0x10
lea ebx, [ebp + 0xc]
cmovae ebx, dword [ebp + 0xc]
mov ecx, dword [eax - 8]
mov edx, 1
sub edx, dword [eax - 4]
or ecx, edx
jge 0x4f9b1e
push 0
lea ecx, [ebp + 8]
call fcn.00402c70
mov eax, dword [ebp + 8]
push 0
push 0x80
push 3
push 0
push 0
push 3
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
mov dword [ebp - 0x30], esi
cmp esi, 0xffffffff
je 0x4f9cf9
test esi, esi
je 0x4f9d09
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
mov dword [ebp - 0x3c], esi
cmp esi, 0xa00000
jb 0x4f9cf6
lea eax, [esi + 0xc8]
push eax
mov dword [ebp - 0x40], eax
call fcn.004a51f0
mov edi, eax
add esp, 4
test edi, edi
je 0x4f9cf6
lea eax, [esi + 0xc8]
push eax
push 0
push edi
call fcn.0049e130
add esp, 0xc
lea eax, [ebp - 0x34]
push 0
push eax
push esi
push edi
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4f9bf5
cmp dword [ebp - 0x34], esi
jne 0x4f9bf5
add esi, 0xffffff9c
cmp esi, dword [ebp - 0x3c]
jae 0x4f9bf5
cmp byte [esi + edi], 0x63
lea eax, [esi + edi]
jne 0x4f9bef
cmp byte [esi + edi + 1], 0x68
jne 0x4f9bef
cmp byte [esi + edi + 2], 0x61
jne 0x4f9bef
push eax
lea ecx, [ebp - 0x2c]
call fcn.00409230
push 0
push str.channelId
lea ecx, [ebp - 0x2c]
call fcn.004434f0
lea ecx, [ebp - 0x2c]
test eax, eax
je 0x4f9c06
call fcn.004062b0
inc esi
cmp esi, dword [ebp - 0x3c]
jb 0x4f9bb4
mov esi, dword [ebp - 0x30]
push edi
call fcn.004a51fb
add esp, 4
jmp 0x4f9cf9
push 0
push ebx
call fcn.004434f0
lea ecx, [ebp - 0x2c]
test eax, eax
jne 0x4f9c2b
call fcn.004062b0
mov esi, dword [ebp - 0x30]
push edi
call fcn.004a51fb
add esp, 4
jmp 0x4f9cf9
call fcn.004062b0
lea ecx, [esi + edi]
test ecx, ecx
je 0x4f9bf5
mov eax, dword [ebp - 0x40]
sub eax, esi
sub eax, 0xa
push eax
push 0
push ecx
call fcn.0049e130
mov ecx, ebx
add esp, 0xc
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4f9c50
sub ecx, edx
lea eax, [esi + edi]
push ecx
push ebx
push eax
call fcn.0049dbb0
add esp, 0xc
lea ecx, [ebx + 1]
nop word [eax + eax]
mov al, byte [ebx]
inc ebx
test al, al
jne 0x4f9c70
push dword [ebp - 0x30]
sub ebx, ecx
add ebx, esi
mov word [ebx + edi], 0xa0d
add ebx, 2
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp + 8]
mov edx, 1
sub edx, dword [eax - 4]
mov ecx, dword [eax - 8]
or ecx, edx
jge 0x4f9cac
push 0
lea ecx, [ebp + 8]
call fcn.00402c70
mov eax, dword [ebp + 8]
push 0
push 0x80
push 2
push 0
push 0
push 3
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x4f9bf8
push 0
lea eax, [ebp - 0x34]
push eax
push ebx
push edi
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
xor ecx, ecx
test eax, eax
mov eax, 1
cmovne ecx, eax
push edi
mov dword [ebp - 0x38], ecx
call fcn.004a51fb
add esp, 4
jmp 0x4f9cf9
mov esi, dword [ebp - 0x30]
test esi, esi
je 0x4f9d09
cmp esi, 0xffffffff
je 0x4f9d09
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ebx, dword [ebp - 0x38]
mov eax, dword [ebp + 8]
lea ecx, [eax - 0x10]
mov byte [ebp - 4], 0
or eax, 0xffffffff
lock xadd dword [ecx + 0xc], eax
dec eax
test eax, eax
jg 0x4f9d46
mov edx, dword [ecx]
push ecx
mov eax, dword [edx]
mov esi, dword [eax + 4]
cmp eax, vtable.ATL::CAtlStringMgr.0
jne 0x4f9d42
mov eax, dword [edx + 4]
push 0
push dword [eax + 4]
call dword [sym.imp.KERNEL32.dll_HeapFree]
jmp 0x4f9d46
mov ecx, edx
call esi
mov ecx, dword [ebp + 0x20]
cmp ecx, 0x10
jb 0x4f9d5b
inc ecx
push ecx
push dword [ebp + 0xc]
lea ecx, [ebp + 0xc]
call fcn.00405350
mov eax, ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.0049aa22
mov esp, ebp
pop ebp
ret 0x1c