Function at 0x5217c0
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xb8
mov eax, dword [0x6baac0]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
mov edx, ecx
mov ecx, dword [ebp + 0x10]
push ebx
mov ebx, dword [ebp + 8]
cmp dword [edx + 0x40], 3
push esi
mov esi, dword [ebp + 0x1c]
push edi
mov edi, dword [ebp + 0x14]
mov dword [ebp - 0xa4], ebx
mov dword [ebp - 0xa0], eax
mov dword [ebp - 0xac], ecx
mov dword [ebp - 0xb0], edi
mov dword [ebp - 0xb8], esi
jne 0x521830
push dword [ebp + 0x20]
push esi
push dword [ebp + 0x18]
push edi
push ecx
push eax
push ebx
mov ecx, edx
call fcn.005215f0
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.005ebe04
mov esp, ebp
pop ebp
ret 0x1c
push ecx
call fcn.0040fab0
mov ecx, dword [ebp + 0x18]
add esp, 4
add ecx, 0x14
mov dword [ebp - 0x9c], eax
add ecx, eax
cmp ecx, 0x80
ja 0x521a7c
mov ecx, dword [ebp - 0xa0]
push dword [ebp - 0x9c]
push dword [ebp - 0xac]
lea eax, [ecx + 1]
cdq
sub eax, edx
mov edi, eax
lea eax, [ebp - 0x84]
sar edi, 1
sub ecx, edi
mov dword [ebp - 0xa8], edi
add ecx, ebx
push eax
mov dword [ebp - 0xa0], ecx
call sub.VCRUNTIME140.dll_memcpy
push dword [ebp + 0x18]
mov eax, dword [ebp - 0x9c]
lea ecx, [ebp - 0x84]
push dword [ebp - 0xb0]
add eax, ecx
push eax
call sub.VCRUNTIME140.dll_memcpy
lea eax, [ebp - 0x94]
push eax
mov eax, dword [ebp - 0x9c]
add eax, dword [ebp + 0x18]
push eax
lea eax, [ebp - 0x84]
push eax
push edi
push ebx
call fcn.00498af0
mov ebx, dword [ebp + 0x20]
add esp, 0x2c
test ebx, ebx
jle 0x521988
mov ecx, dword [ebp - 0x9c]
mov eax, 0x10
sub eax, esi
add ecx, 0x10
add ecx, dword [ebp + 0x18]
mov edi, esi
mov dword [ebp - 0xac], eax
lea eax, [ebx - 1]
shr eax, 4
inc eax
mov dword [ebp - 0xb4], ecx
mov esi, eax
nop
lea eax, [ebp - 0x18]
push eax
push ecx
lea eax, [ebp - 0x94]
push eax
push dword [ebp - 0xa8]
push dword [ebp - 0xa4]
call fcn.00498af0
lea eax, [ebp - 0x94]
push eax
push 0x10
push eax
push dword [ebp - 0xa8]
push dword [ebp - 0xa4]
call fcn.00498af0
mov eax, dword [ebp - 0xac]
add esp, 0x28
add eax, edi
cmp eax, ebx
jle 0x52195b
mov eax, ebx
and eax, reloc.WS2_32.dll_ntohs
jns 0x521955
dec eax
or eax, 0xfffffff0
inc eax
test eax, eax
jle 0x52196e
jmp 0x521960
mov eax, 0x10
push eax
lea eax, [ebp - 0x18]
push eax
push edi
call sub.VCRUNTIME140.dll_memcpy
add esp, 0xc
mov ecx, dword [ebp - 0xb4]
add edi, 0x10
sub esi, 1
jne 0x521900
mov esi, dword [ebp - 0xb8]
mov edi, dword [ebp - 0xa8]
lea eax, [ebp - 0x98]
push eax
mov eax, dword [ebp - 0x9c]
add eax, dword [ebp + 0x18]
push eax
lea eax, [ebp - 0x84]
push eax
push edi
push dword [ebp - 0xa0]
call fcn.00498b10
add esp, 0x14
test ebx, ebx
jle 0x521a7c
mov ecx, dword [ebp - 0x9c]
mov eax, dword [ebp + 0x18]
add ecx, 0x14
add eax, ecx
lea ecx, [ebx - 1]
mov dword [ebp - 0xb8], eax
mov eax, 0x14
sub eax, esi
mov dword [ebp - 0xb4], eax
mov eax, 0xcccccccd
mul ecx
mov eax, edx
shr eax, 4
inc eax
mov dword [ebp - 0xa4], eax
nop
lea eax, [ebp - 0x18]
push eax
push dword [ebp - 0xb8]
lea eax, [ebp - 0x98]
push eax
push edi
push dword [ebp - 0xa0]
call fcn.00498b10
lea eax, [ebp - 0x98]
push eax
push 0x14
push eax
push edi
push dword [ebp - 0xa0]
call fcn.00498b10
mov eax, dword [ebp - 0xb4]
add esp, 0x28
add eax, esi
cmp eax, ebx
jle 0x521a4f
mov eax, 0x66666667
imul ebx
sar edx, 3
mov eax, edx
shr eax, 0x1f
add eax, edx
mov edx, ebx
lea eax, [eax + eax*4]
shl eax, 2
sub edx, eax
jmp 0x521a54
mov edx, 0x14
xor eax, eax
test edx, edx
jle 0x521a6c
nop word [eax + eax]
mov cl, byte [ebp + eax - 0x18]
xor byte [esi + eax], cl
inc eax
cmp eax, edx
jl 0x521a60
add esi, 0x14
sub dword [ebp - 0xa4], 1
jne 0x5219f0
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.005ebe04
mov esp, ebp
pop ebp
ret 0x1c