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

Disassembly:
mov eax, 0x540438
call fcn.0050bac0
sub esp, 0x47c
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
test edi, edi
mov dword [ebp - 0x10], ecx
je 0x4e0c15
call fcn.004dfc1a
mov ecx, dword [ebp - 0x10]
lea eax, [ebp - 0x78]
push eax
call fcn.004dfbe4
mov eax, dword [eax]
and dword [ebp - 4], 0
lea ecx, [ebp - 0x108]
push 0xa
push ecx
push eax
call fcn.004dfab4
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.00402735
mov esi, dword [sym.imp.MSVCRT.dll_sprintf]
or dword [ebp - 4], 0xffffffff
lea eax, [ebp - 0x108]
mov ebx, 0x595820
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 0x585294
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
add esp, 0x18
mov dword [ebp - 0x14], eax
test eax, eax
jne 0x4e0a4b
push 0x1fd
lea eax, [ebp - 0x288]
push str.D:CQ2ClientCn_15.3.53DRoleChatLog.cpp
push eax
push str.ERROR:_file__s_not_found_at__s___d
call fcn.005079e3
add esp, 0x10
jmp 0x4e0c15
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 0x58ea40
push esi
call sub.MSVCRT.dll_strcpy
add esp, 0x28
lea eax, [ebp - 0x488]
mov ecx, edi
push eax
call fcn.00490f20
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 0x4e0b28
push str.D:CQ2ClientCn_15.3.53DRoleChatLog.cpp
push 0x222
push 0x5851c8
call fcn.005079e3
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.00434588
push edi
push 0x421
call fcn.004b8e8e
lea eax, [ebp - 0x2c]
push 0x591088
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 0x4e0b8a
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 + 0x595820]
xor byte [esi], cl
inc edi
cmp edi, eax
jl 0x4e0ba9
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.004b8e8e
add esp, 0x1c
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
leave
ret 4