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

Disassembly:
mov eax, 0x5225e8
call fcn.004efe80
sub esp, 0x47c
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
test edi, edi
mov dword [ebp - 0x10], ecx
je 0x4c6bc1
call fcn.004c5bd0
mov ecx, dword [ebp - 0x10]
lea eax, [ebp - 0x78]
push eax
call fcn.004c5b9a
mov eax, dword [eax]
and dword [ebp - 4], 0
lea ecx, [ebp - 0x108]
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 - 0x78]
mov dword [ebp - 4], 1
call fcn.00407dc8
mov esi, dword [sym.imp.MSVCRT.dll_sprintf]
or dword [ebp - 4], 0xffffffff
lea eax, [ebp - 0x108]
mov ebx, 0x5716dc
push eax
push ebx
lea eax, [ebp - 0x188]
push str.LOG__s__s_CHAT
push eax
call esi
add esp, 0x10
lea eax, [ebp - 0x188]
push str.leavewordsystem.log
push eax
lea eax, [ebp - 0x288]
push str._s__s
push eax
call esi
lea eax, [ebp - 0x288]
push 0x5612c4
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
add esp, 0x18
mov dword [ebp - 0x14], eax
test eax, eax
jne 0x4c69f7
push 0x1fe
lea eax, [ebp - 0x288]
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 0x4c6bc1
lea eax, [edi + 4]
mov dword [ebp - 0x18], eax
push eax
lea eax, [ebp - 0x88]
push eax
call sub.MSVCRT.dll_strcpy
push dword [ebp - 0x14]
lea eax, [ebp - 0x88]
push 0x10
push 1
push eax
call dword [sym.imp.MSVCRT.dll_fwrite]
lea esi, [edi + 0x204]
lea eax, [ebp - 0xc8]
push esi
push eax
call sub.MSVCRT.dll_strcpy
push 0x56ab48
push esi
call sub.MSVCRT.dll_strcpy
add esp, 0x28
lea eax, [ebp - 0x488]
mov ecx, edi
push eax
call fcn.0047b4f9
lea esi, [ebp - 0xc8]
lea edi, [ebp - 0x6c]
movsd dword es:[edi], dword [esi]
lea esi, [ebp - 0xc4]
lea edi, [ebp - 0x67]
mov byte [ebp - 0x68], 0x2d
lea eax, [ebp - 0x6c]
movsw word es:[edi], word [esi]
lea esi, [ebp - 0xc2]
lea edi, [ebp - 0x64]
mov byte [ebp - 0x65], 0x2d
push eax
movsw word es:[edi], word [esi]
lea esi, [ebp - 0xc0]
lea edi, [ebp - 0x61]
mov byte [ebp - 0x62], 0x2d
lea eax, [ebp - 0x488]
movsw word es:[edi], word [esi]
lea esi, [ebp - 0xbe]
lea edi, [ebp - 0x5e]
mov byte [ebp - 0x5f], 0x2d
push eax
movsw word es:[edi], word [esi]
and byte [ebp - 0x5c], 0
call sub.MSVCRT.dll_strcat
push 0x210
call sub.MFC42.DLL_operatornew
xor edi, edi
add esp, 0xc
cmp eax, edi
mov dword [ebp + 8], eax
jne 0x4c6ad4
push str.D:CQ2ClientRelease_12.14.23DRoleChatLog.cpp
push 0x223
push 0x5611f4
call fcn.004ebdbb
add esp, 0xc
push dword [ebp - 0x18]
push dword [ebp + 8]
call sub.MSVCRT.dll_strcpy
lea eax, [ebp - 0x488]
push eax
mov eax, dword [ebp + 8]
add eax, 0x10
push eax
call sub.MSVCRT.dll_strcpy
add esp, 0x10
lea eax, [ebp + 8]
push eax
mov eax, dword [ebp - 0x10]
lea ecx, [eax + 0x120]
call fcn.004c3d17
push edi
push 0x421
call fcn.004a308a
lea eax, [ebp - 0x2c]
push 0x56d134
push eax
call sub.MSVCRT.dll_strcpy
lea eax, [ebp - 0x2c]
push eax
call sub.MSVCRT.dll_strlen
mov esi, eax
add esp, 0x14
cmp esi, 1
jg 0x4c6b36
push 2
pop esi
push ebx
call sub.MSVCRT.dll_strlen
dec eax
dec esi
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x10], 1
lea eax, [ebp - 0x488]
pop ecx
sub dword [ebp - 0x10], eax
mov dword [ebp - 0x18], esi
mov eax, dword [ebp - 0x10]
lea esi, [ebp + edi - 0x488]
lea ecx, [eax + esi]
mov eax, 0x5baacfb
cdq
idiv ecx
mov ecx, 0x100
cdq
idiv ecx
mov eax, edi
mov ecx, edx
cdq
idiv dword [ebp - 0x18]
mov eax, edi
add cl, byte [ebp + edx - 0x2c]
cdq
idiv dword [ebp - 0x1c]
mov eax, 0x200
add cl, byte [edx + 0x5716dc]
xor byte [esi], cl
inc edi
cmp edi, eax
jl 0x4c6b55
push dword [ebp - 0x14]
push eax
lea eax, [ebp - 0x488]
push 1
push eax
call dword [sym.imp.MSVCRT.dll_fwrite]
push dword [ebp - 0x14]
call dword [sym.imp.MSVCRT.dll_fclose]
push 0
push 0x421
call fcn.004a308a
add esp, 0x1c
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
leave
ret 4