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

Disassembly:
mov eax, 0x574670
call fcn.0051f140
sub esp, 0x514
mov al, byte [0x5d8050]
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 0x4ed5c2
push 1
pop edi
jmp 0x4ed3bf
mov esi, dword [ebp - 0x20]
mov esi, dword [esi]
mov eax, dword [ebp - 0x1c]
mov esi, dword [esi + eax*4]
test esi, esi
je 0x4ed5a3
cmp dword [edx + 0x138], 0
je 0x4ed595
mov ecx, edx
call fcn.004ec34d
mov ecx, dword [ebp - 0x28]
lea eax, [ebp - 0x50]
push eax
call fcn.004ec317
mov eax, dword [eax]
and dword [ebp - 4], 0
lea ecx, [ebp - 0xa0]
push 0xa
push ecx
push eax
call fcn.00483e3c
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.00402751
mov ebx, dword [sym.imp.MSVCRT.dll_sprintf]
or dword [ebp - 4], 0xffffffff
lea eax, [ebp - 0xa0]
push eax
push 0x5def58
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 0x4ed4be
cmp dword [ebp - 0x14], 0
je 0x4ed48a
push dword [ebp - 0x14]
call dword [sym.imp.MSVCRT.dll_fclose]
pop ecx
lea eax, [ebp - 0x1a0]
push 0x5ccf34
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
pop ecx
mov dword [ebp - 0x14], eax
test eax, eax
pop ecx
je 0x4ed5dd
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 0x5dac58
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 0x4ed50e
push 2
pop ebx
push 0x5def58
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 + 0x5def58]
xor byte [edi], cl
inc dword [ebp - 0x18]
cmp dword [ebp - 0x18], eax
jl 0x4ed531
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 0x4ed3bc
cmp dword [ebp - 0x14], 0
je 0x4ed5bf
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.004a6e61
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
leave
ret
push 0x25b
lea eax, [ebp - 0x1a0]
push str.E:CQ2ClientRelease_17.1.93DRoleChatLog.cpp
push eax
push str.ERROR:_file__s_not_found_at__s___d
call fcn.005185c3
add esp, 0x10
jmp 0x4ed5ce