Function at 0x4c6bd2
Capabilities:
Encode data using xor
Write file on windows

Disassembly:
mov eax, 0x522604
call fcn.004efe80
sub esp, 0x514
mov al, byte [0x56ab48]
push ebx
push esi
push edi
mov edx, ecx
push 0x3f
mov byte [ebp - 0x2a0], al
pop ecx
mov ebx, dword [edx + 0x130]
xor eax, eax
sub ebx, dword [edx + 0x12c]
lea edi, [ebp - 0x29f]
lea esi, [edx + 0x12c]
and dword [ebp - 0x14], 0
rep stosd dword es:[edi], eax
and dword [ebp - 0x1c], 0
mov dword [ebp - 0x28], edx
stosw word es:[edi], ax
sar ebx, 2
test ebx, ebx
mov dword [ebp - 0x20], esi
mov dword [ebp - 0x2c], ebx
stosb byte es:[edi], al
jle 0x4c6e3b
push 1
pop edi
jmp 0x4c6c38
mov esi, dword [ebp - 0x20]
mov esi, dword [esi]
mov eax, dword [ebp - 0x1c]
mov esi, dword [esi + eax*4]
test esi, esi
je 0x4c6e1c
cmp dword [edx + 0x138], 0
je 0x4c6e0e
mov ecx, edx
call fcn.004c5bd0
mov ecx, dword [ebp - 0x28]
lea eax, [ebp - 0x50]
push eax
call fcn.004c5b9a
mov eax, dword [eax]
and dword [ebp - 4], 0
lea ecx, [ebp - 0xa0]
push 0xa
push ecx
push eax
call fcn.00434ca9
pop ecx
push 0
push eax
call dword [sym.imp.MSVCRT.dll__i64toa]
add esp, 0x10
lea ecx, [ebp - 0x50]
mov dword [ebp - 4], edi
call fcn.00407dc8
mov ebx, dword [sym.imp.MSVCRT.dll_sprintf]
or dword [ebp - 4], 0xffffffff
lea eax, [ebp - 0xa0]
push eax
push 0x5716dc
lea eax, [ebp - 0x320]
push str.LOG__s__s_CHAT
push eax
call ebx
add esp, 0x10
lea eax, [ebp - 0x320]
push dword [esi + 8]
push dword [esi + 4]
push dword [esi]
push eax
lea eax, [ebp - 0x1a0]
push str._s__d__d__d.log
push eax
call ebx
lea eax, [ebp - 0x1a0]
push eax
lea eax, [ebp - 0x2a0]
push eax
call sub.MSVCRT.dll_strcmp
add esp, 0x20
test eax, eax
je 0x4c6d37
cmp dword [ebp - 0x14], 0
je 0x4c6d03
push dword [ebp - 0x14]
call dword [sym.imp.MSVCRT.dll_fclose]
pop ecx
lea eax, [ebp - 0x1a0]
push 0x5612c4
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
pop ecx
mov dword [ebp - 0x14], eax
test eax, eax
pop ecx
je 0x4c6e56
lea eax, [ebp - 0x1a0]
push eax
lea eax, [ebp - 0x2a0]
push eax
call sub.MSVCRT.dll_strcpy
pop ecx
pop ecx
lea eax, [esi + 0xc]
push eax
lea eax, [ebp - 0x60]
push eax
call sub.MSVCRT.dll_strcpy
push dword [ebp - 0x14]
lea eax, [ebp - 0x60]
push 0x10
push edi
push eax
call dword [sym.imp.MSVCRT.dll_fwrite]
lea eax, [esi + 0x1c]
push eax
lea eax, [ebp - 0x520]
push eax
call sub.MSVCRT.dll_strcpy
lea eax, [ebp - 0x44]
push 0x56d134
push eax
call sub.MSVCRT.dll_strcpy
lea eax, [ebp - 0x44]
push eax
call sub.MSVCRT.dll_strlen
mov ebx, eax
add esp, 0x2c
cmp ebx, edi
jg 0x4c6d87
push 2
pop ebx
push 0x5716dc
call sub.MSVCRT.dll_strlen
and dword [ebp - 0x18], 0
dec eax
mov dword [ebp - 0x34], eax
dec ebx
mov dword [ebp - 0x24], edi
lea eax, [ebp - 0x520]
sub dword [ebp - 0x24], eax
pop ecx
mov dword [ebp - 0x30], ebx
mov eax, dword [ebp - 0x18]
lea edi, [ebp + eax - 0x520]
mov eax, dword [ebp - 0x24]
lea ecx, [eax + edi]
mov eax, 0x5baacfb
cdq
idiv ecx
mov ecx, 0x100
cdq
idiv ecx
mov eax, dword [ebp - 0x18]
mov ecx, edx
cdq
idiv dword [ebp - 0x30]
mov eax, dword [ebp - 0x18]
add cl, byte [ebp + edx - 0x44]
cdq
idiv dword [ebp - 0x34]
mov eax, 0x200
add cl, byte [edx + 0x5716dc]
xor byte [edi], cl
inc dword [ebp - 0x18]
cmp dword [ebp - 0x18], eax
jl 0x4c6daa
push dword [ebp - 0x14]
push eax
push 1
pop edi
lea eax, [ebp - 0x520]
push edi
push eax
call dword [sym.imp.MSVCRT.dll_fwrite]
mov ebx, dword [ebp - 0x2c]
add esp, 0x10
push esi
call sub.MFC42.DLL_operatordelete
or dword [ebp - 4], 0xffffffff
mov edx, dword [ebp - 0x28]
pop ecx
inc dword [ebp - 0x1c]
cmp dword [ebp - 0x1c], ebx
jl 0x4c6c35
cmp dword [ebp - 0x14], 0
je 0x4c6e38
push dword [ebp - 0x14]
call dword [sym.imp.MSVCRT.dll_fclose]
pop ecx
mov esi, dword [ebp - 0x20]
push dword [esi + 4]
mov ecx, esi
push dword [esi]
call fcn.004874df
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
leave
ret
push 0x25c
lea eax, [ebp - 0x1a0]
push str.D:CQ2ClientRelease_12.14.23DRoleChatLog.cpp
push eax
push str.ERROR:_file__s_not_found_at__s___d
call fcn.004ebdbb
add esp, 0x10
jmp 0x4c6e47