Function at 0x5218c0
Capabilities:
Encode data using xor

Disassembly:
mov eax, 0x1c
call fcn.005650a0
push ebx
push ebp
push esi
push edi
mov eax, dword [esp + 0x44]
movzx ecx, byte [eax]
movzx edx, byte [eax + 1]
inc eax
shl edx, 8
or ecx, edx
movzx edx, byte [eax + 1]
inc eax
shl edx, 0x10
or ecx, edx
movzx edx, byte [eax + 1]
inc eax
shl edx, 0x18
or ecx, edx
inc eax
movzx edx, byte [eax + 1]
inc eax
mov dword [esp + 0x14], ecx
movzx ecx, byte [eax - 1]
shl edx, 8
or ecx, edx
movzx edx, byte [eax + 2]
inc eax
movzx eax, byte [eax]
shl edx, 8
or edx, eax
mov eax, dword [esp + 0x48]
shl edx, 0x10
or ecx, edx
movzx edx, byte [eax + 1]
inc eax
mov dword [esp + 0x18], ecx
movzx ecx, byte [eax - 1]
shl edx, 8
or ecx, edx
movzx edx, byte [eax + 1]
inc eax
shl edx, 0x10
or ecx, edx
movzx edx, byte [eax + 1]
inc eax
shl edx, 0x18
inc eax
or ecx, edx
movzx edx, byte [eax]
inc eax
movzx esi, byte [eax]
shl esi, 8
or edx, esi
movzx esi, byte [eax + 2]
inc eax
movzx eax, byte [eax]
shl esi, 8
or esi, eax
shl esi, 0x10
or edx, esi
cmp dword [esp + 0x4c], 0
mov dword [esp + 0x48], ecx
mov dword [esp + 0x10], edx
je 0x521bbe
mov ecx, dword [esp + 0x40]
movzx eax, byte [ecx]
lea edx, [ecx + 1]
movzx ecx, byte [edx]
shl ecx, 8
or eax, ecx
movzx ecx, byte [edx + 1]
mov dword [esp + 0x1c], edx
inc edx
shl ecx, 0x10
or eax, ecx
movzx ecx, byte [edx + 1]
inc edx
mov ebp, dword [esp + 0x38]
mov edi, dword [esp + 0x30]
shl ecx, 0x18
inc edx
movzx esi, byte [edx + 1]
or eax, ecx
movzx ecx, byte [edx]
inc edx
shl esi, 8
or ecx, esi
movzx esi, byte [edx + 2]
inc edx
movzx edx, byte [edx]
shl esi, 8
or esi, edx
shl esi, 0x10
or ecx, esi
add ebp, 0xfffffff8
mov esi, dword [esp + 0x34]
js 0x521aab
lea edx, [ebp + 8]
shr edx, 3
mov dword [esp + 0x44], edx
neg edx
lea edx, [ebp + edx*8]
mov dword [esp + 0x38], edx
movzx edx, byte [edi]
movzx ebx, byte [edi + 1]
inc edi
shl ebx, 8
or edx, ebx
movzx ebx, byte [edi + 1]
inc edi
shl ebx, 0x10
or edx, ebx
movzx ebx, byte [edi + 1]
inc edi
shl ebx, 0x18
or edx, ebx
movzx ebx, byte [edi + 1]
inc edi
movzx ebp, byte [edi + 1]
inc edi
shl ebp, 8
or ebx, ebp
movzx ebp, byte [edi + 1]
inc edi
shl ebp, 0x10
or ebx, ebp
movzx ebp, byte [edi + 1]
inc edi
shl ebp, 0x18
or ebx, ebp
xor edx, eax
mov eax, dword [esp + 0x3c]
xor edx, dword [esp + 0x14]
xor ebx, ecx
xor ebx, dword [esp + 0x18]
push 1
push eax
lea ecx, [esp + 0x2c]
push ecx
inc edi
mov dword [esp + 0x30], edx
mov dword [esp + 0x34], ebx
call fcn.004e4920
mov eax, dword [esp + 0x30]
xor eax, dword [esp + 0x54]
inc esi
mov byte [esi - 1], al
inc esi
mov edx, eax
shr edx, 8
mov byte [esi - 1], dl
mov ecx, eax
shr ecx, 0x10
mov byte [esi], cl
mov ecx, dword [esp + 0x34]
xor ecx, dword [esp + 0x1c]
inc esi
mov edx, eax
shr edx, 0x18
mov byte [esi], dl
inc esi
mov byte [esi], cl
inc esi
mov edx, ecx
shr edx, 8
mov byte [esi], dl
inc esi
mov edx, ecx
shr edx, 0x10
mov byte [esi], dl
inc esi
mov edx, ecx
shr edx, 0x18
mov byte [esi], dl
add esp, 0xc
inc esi
sub dword [esp + 0x44], 1
jne 0x5219e7
mov ebp, dword [esp + 0x38]
cmp ebp, 0xfffffff8
je 0x521b7e
lea edi, [edi + ebp + 8]
add ebp, 7
xor ebx, ebx
xor edx, edx
cmp ebp, 7
ja case.default.0x521ac4
jmp dword [ebp*4 + 0x521e34]
movzx ebx, byte [edi - 1]
dec edi
shl ebx, 0x18
movzx edx, byte [edi - 1]
dec edi
shl edx, 0x10
or ebx, edx
movzx edx, byte [edi - 1]
dec edi
shl edx, 8
or ebx, edx
movzx edx, byte [edi - 1]
dec edi
or ebx, edx
movzx edx, byte [edi - 1]
dec edi
shl edx, 0x18
movzx ebp, byte [edi - 1]
dec edi
shl ebp, 0x10
or edx, ebp
movzx ebp, byte [edi - 1]
dec edi
shl ebp, 8
or edx, ebp
movzx edi, byte [edi - 1]
or edx, edi
xor edx, eax
mov eax, dword [esp + 0x3c]
xor edx, dword [esp + 0x14]
xor ebx, ecx
xor ebx, dword [esp + 0x18]
push 1
push eax
lea ecx, [esp + 0x2c]
push ecx
mov dword [esp + 0x30], edx
mov dword [esp + 0x34], ebx
call fcn.004e4920
mov eax, dword [esp + 0x30]
xor eax, dword [esp + 0x54]
inc esi
mov byte [esi - 1], al
mov edx, eax
shr edx, 8
mov byte [esi], dl
inc esi
mov ecx, eax
shr ecx, 0x10
mov byte [esi], cl
mov ecx, dword [esp + 0x34]
xor ecx, dword [esp + 0x1c]
inc esi
mov edx, eax
shr edx, 0x18
mov byte [esi], dl
inc esi
mov byte [esi], cl
inc esi
mov edx, ecx
shr edx, 8
mov byte [esi], dl
inc esi
mov edx, ecx
shr edx, 0x10
mov byte [esi], dl
mov edx, ecx
add esp, 0xc
shr edx, 0x18
mov byte [esi + 1], dl
mov edx, dword [esp + 0x40]
mov esi, dword [esp + 0x1c]
mov byte [edx], al
mov edx, eax
shr edx, 8
mov byte [esi], dl
inc esi
mov edx, eax
shr edx, 0x10
mov byte [esi], dl
inc esi
shr eax, 0x18
mov byte [esi], al
inc esi
mov byte [esi], cl
inc esi
mov eax, ecx
shr eax, 8
mov byte [esi], al
inc esi
mov edx, ecx
shr edx, 0x10
pop edi
mov byte [esi], dl
shr ecx, 0x18
mov byte [esi + 1], cl
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret
mov eax, dword [esp + 0x40]
movzx ebx, byte [eax]
movzx edx, byte [eax + 1]
inc eax
shl edx, 8
mov dword [esp + 0x1c], eax
or ebx, edx
movzx edx, byte [eax + 1]
inc eax
shl edx, 0x10
inc eax
or ebx, edx
movzx edx, byte [eax]
mov edi, dword [esp + 0x34]
inc eax
movzx esi, byte [eax + 1]
shl edx, 0x18
or ebx, edx
movzx edx, byte [eax]
inc eax
shl esi, 8
or edx, esi
movzx esi, byte [eax + 2]
inc eax
movzx eax, byte [eax]
shl esi, 8
or esi, eax
mov eax, dword [esp + 0x38]
shl esi, 0x10
or edx, esi
mov esi, dword [esp + 0x30]
add eax, 0xfffffff8
mov dword [esp + 0x44], edx
mov dword [esp + 0x38], eax
test eax, eax
jle 0x521d15
lea edx, [eax - 1]
shr edx, 3
inc edx
mov dword [esp + 0x20], edx
neg edx
lea edx, [eax + edx*8]
mov dword [esp + 0x38], edx
lea esp, [esp]
movzx ebp, byte [esi]
movzx eax, byte [esi + 1]
inc esi
movzx edx, byte [esi + 1]
shl eax, 8
or ebp, eax
inc esi
movzx eax, byte [esi + 1]
inc esi
shl edx, 0x10
shl eax, 0x18
or ebp, edx
or ebp, eax
movzx eax, byte [esi + 1]
inc esi
inc esi
mov edx, ebp
xor edx, ecx
movzx ecx, byte [esi]
mov dword [esp + 0x24], edx
movzx edx, byte [esi + 1]
inc esi
shl ecx, 8
or eax, ecx
movzx ecx, byte [esi + 1]
inc esi
shl edx, 0x10
or eax, edx
mov edx, dword [esp + 0x3c]
shl ecx, 0x18
or eax, ecx
mov dword [esp + 0x4c], eax
xor eax, dword [esp + 0x10]
push 0
mov dword [esp + 0x2c], eax
push edx
lea eax, [esp + 0x2c]
push eax
inc esi
call fcn.004e4920
mov ecx, dword [esp + 0x50]
xor ecx, dword [esp + 0x34]
mov eax, ebx
xor eax, dword [esp + 0x30]
xor ecx, dword [esp + 0x24]
xor eax, dword [esp + 0x20]
inc edi
mov byte [edi - 1], al
mov edx, eax
shr edx, 8
mov byte [edi], dl
inc edi
mov edx, eax
shr edx, 0x10
mov byte [edi], dl
inc edi
shr eax, 0x18
mov byte [edi], al
mov byte [edi + 1], cl
inc edi
inc edi
mov eax, ecx
shr eax, 8
mov byte [edi], al
mov eax, dword [esp + 0x58]
mov edx, ecx
inc edi
shr edx, 0x10
mov byte [edi], dl
inc edi
shr ecx, 0x18
mov byte [edi], cl
mov ecx, dword [esp + 0x54]
add esp, 0xc
inc edi
sub dword [esp + 0x20], 1
mov ebx, ebp
mov dword [esp + 0x44], eax
jne 0x521c40
mov edx, eax
mov eax, dword [esp + 0x38]
cmp eax, 0xfffffff8
je 0x521df4
movzx ebp, byte [esi]
movzx edx, byte [esi + 1]
inc esi
movzx eax, byte [esi + 1]
shl edx, 8
or ebp, edx
inc esi
movzx edx, byte [esi + 1]
shl eax, 0x10
inc esi
or ebp, eax
shl edx, 0x18
or ebp, edx
mov eax, ebp
xor eax, ecx
mov dword [esp + 0x24], eax
movzx eax, byte [esi + 1]
inc esi
movzx ecx, byte [esi + 1]
inc esi
movzx edx, byte [esi + 2]
shl ecx, 8
or eax, ecx
movzx ecx, byte [esi + 1]
inc esi
shl edx, 8
or edx, ecx
shl edx, 0x10
or eax, edx
mov edx, dword [esp + 0x3c]
mov dword [esp + 0x4c], eax
xor eax, dword [esp + 0x10]
push 0
mov dword [esp + 0x2c], eax
push edx
lea eax, [esp + 0x2c]
push eax
call fcn.004e4920
mov eax, dword [esp + 0x50]
mov ecx, dword [esp + 0x44]
xor ebx, dword [esp + 0x30]
xor eax, dword [esp + 0x34]
xor ebx, dword [esp + 0x20]
xor eax, dword [esp + 0x24]
lea edi, [edi + ecx + 8]
add ecx, 7
add esp, 0xc
cmp ecx, 7
ja case.default.0x521dad
jmp dword [ecx*4 + 0x521e54]
dec edi
mov ecx, eax
shr ecx, 0x18
mov byte [edi], cl
dec edi
mov edx, eax
shr edx, 0x10
mov byte [edi], dl
dec edi
mov ecx, eax
shr ecx, 8
mov byte [edi], cl
dec edi
mov byte [edi], al
dec edi
mov edx, ebx
shr edx, 0x18
mov byte [edi], dl
dec edi
mov eax, ebx
shr eax, 0x10
mov byte [edi], al
dec edi
mov ecx, ebx
shr ecx, 8
mov byte [edi], cl
mov byte [edi - 1], bl
mov edx, dword [esp + 0x4c]
mov ebx, ebp
mov dword [esp + 0x44], edx
mov eax, dword [esp + 0x40]
mov byte [eax], bl
mov eax, dword [esp + 0x1c]
mov ecx, ebx
shr ecx, 8
mov byte [eax], cl
inc eax
mov ecx, ebx
shr ecx, 0x10
mov byte [eax], cl
inc eax
shr ebx, 0x18
mov byte [eax], bl
inc eax
mov byte [eax], dl
mov ecx, edx
shr ecx, 8
inc eax
mov byte [eax], cl
pop edi
mov ecx, edx
inc eax
pop esi
shr ecx, 0x10
shr edx, 0x18
pop ebp
mov byte [eax], cl
mov byte [eax + 1], dl
pop ebx
add esp, 0x1c
ret