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

Disassembly:
mov eax, 0x520614
call fcn.004edf30
sub esp, 0x47c
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
test edi, edi
mov dword [ebp - 0x10], ecx
je 0x4c5a3b
call fcn.004c4a4a
mov ecx, dword [ebp - 0x10]
lea eax, [ebp - 0x78]
push eax
call fcn.004c4a14
mov eax, dword [eax]
and dword [ebp - 4], 0
lea ecx, [ebp - 0x108]
push 0xa
push ecx
push eax
call fcn.004c48e4
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, 0x56f64c
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 0x55f2bc
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
add esp, 0x18
mov dword [ebp - 0x14], eax
test eax, eax
jne 0x4c5871
push 0x1fe
lea eax, [ebp - 0x288]
push str.D:CQ2ClientRelease_11.17.103DRoleChatLog.cpp
push eax
push str.ERROR:_file__s_not_found_at__s___d
call fcn.004e9e6f
add esp, 0x10
jmp 0x4c5a3b
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 0x568b08
push esi
call sub.MSVCRT.dll_strcpy
add esp, 0x28
lea eax, [ebp - 0x488]
mov ecx, edi
push eax
call fcn.0047aeb8
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 0x4c594e
push str.D:CQ2ClientRelease_11.17.103DRoleChatLog.cpp
push 0x223
push 0x55f1ec
call fcn.004e9e6f
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.004c5d97
push edi
push 0x421
call fcn.004a2911
lea eax, [ebp - 0x2c]
push 0x56b0dc
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 0x4c59b0
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 + 0x56f64c]
xor byte [esi], cl
inc edi
cmp edi, eax
jl 0x4c59cf
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.004a2911
add esp, 0x1c
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
leave
ret 4