Function at 0x516160
Capabilities:
Encode data using xor
Encrypt data using rc4 prga

Disassembly:
mov eax, 0x20
call fcn.00488be0
mov ecx, dword [esp + 0x28]
xorps xmm0, xmm0
mov edx, dword [esp + 0x2c]
mov eax, edx
push ebx
mov ebx, dword [esp + 0x44]
push ebp
mov ebp, ecx
movlpd qword [esp + 0x10], xmm0
shld eax, ebp, 5
push esi
mov esi, dword [esp + 0x30]
shl ebp, 5
mov dword [esp + 0x10], eax
mov dword [esp + 0x20], ebp
push edi
mov edi, esi
test eax, eax
jb 0x516204
ja 0x5161a6
test ebp, ebp
je 0x516204
mov eax, dword [esp + 0x1c]
mov esi, dword [esp + 0x18]
mov dword [esp + 0x10], eax
movzx eax, byte [edi]
lea edi, [edi + 4]
mov dword [ebx], eax
movzx ecx, byte [edi - 3]
shl ecx, 8
or ecx, eax
mov dword [ebx], ecx
movzx edx, byte [edi - 2]
shl edx, 0x10
or edx, ecx
mov dword [ebx], edx
movzx eax, byte [edi - 1]
shl eax, 0x18
or eax, edx
add esi, 1
mov dword [ebx], eax
mov eax, dword [esp + 0x10]
adc eax, 0
add ebx, 4
mov dword [esp + 0x10], eax
cmp eax, dword [esp + 0x14]
jb 0x5161b2
ja 0x5161f8
cmp esi, ebp
jb 0x5161b2
mov esi, dword [esp + 0x34]
mov ecx, dword [esp + 0x38]
mov edx, dword [esp + 0x3c]
xor eax, eax
mov edi, 1
cmp eax, dword [esp + 0x44]
ja 0x516260
jb 0x516219
cmp edi, dword [esp + 0x40]
jae 0x516260
mov ebp, ecx
mov dword [esp + 0x10], ecx
shl ebp, 7
xor esi, esi
push edx
push ecx
mov eax, ebx
sub eax, ebp
push eax
push ebx
call fcn.00516020
mov ecx, dword [esp + 0x48]
add esp, 0x10
mov edx, dword [esp + 0x3c]
add edi, 1
adc esi, 0
add ebx, ebp
cmp esi, dword [esp + 0x44]
jb 0x516224
ja 0x516252
cmp edi, dword [esp + 0x40]
jb 0x516224
mov esi, dword [esp + 0x34]
mov ebp, dword [esp + 0x24]
mov ecx, dword [esp + 0x38]
jmp 0x516264
mov dword [esp + 0x10], ecx
mov edi, dword [esp + 0x40]
mov eax, edi
push dword [esp + 0x3c]
mov ebx, dword [esp + 0x4c]
shl eax, 7
add eax, 0xffffff80
imul eax, dword [esp + 0x14]
push ecx
add eax, dword [esp + 0x58]
push eax
push ebx
call fcn.00516020
mov ecx, dword [esp + 0x54]
add esp, 0x10
xorps xmm0, xmm0
movlpd qword [esp + 0x18], xmm0
test ecx, ecx
jb 0x516377
ja 0x5162ab
test edi, edi
je 0x516377
mov edx, dword [esp + 0x10]
mov eax, dword [esp + 0x1c]
mov esi, dword [esp + 0x14]
shl edx, 7
add edx, 0xffffffc0
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x18]
add edx, ebx
mov dword [esp + 0x24], edx
mov dword [esp + 0x18], eax
nop
push ecx
push edi
push 0
push dword [edx]
call fcn.004894b0
mov edx, eax
xorps xmm0, xmm0
imul edx, dword [esp + 0x10]
movlpd qword [esp + 0x28], xmm0
shl edx, 7
add edx, dword [esp + 0x50]
test esi, esi
jb 0x51632c
ja 0x5162fc
test ebp, ebp
je 0x51632c
mov edi, dword [esp + 0x2c]
mov ecx, dword [esp + 0x28]
mov eax, dword [ebx + ecx*4]
lea edx, [edx + 4]
mov ebx, dword [esp + 0x4c]
xor eax, dword [edx - 4]
mov dword [ebx + ecx*4], eax
add ecx, 1
mov ebx, dword [esp + 0x48]
adc edi, 0
cmp edi, esi
jb 0x516304
ja 0x516328
cmp ecx, ebp
jb 0x516304
mov edi, dword [esp + 0x40]
push dword [esp + 0x3c]
push dword [esp + 0x3c]
push dword [esp + 0x54]
push ebx
call fcn.00516020
mov eax, dword [esp + 0x28]
add esp, 0x10
mov ecx, dword [esp + 0x20]
add eax, 1
mov edx, dword [esp + 0x24]
adc ecx, 0
mov dword [esp + 0x18], eax
cmp ecx, dword [esp + 0x44]
mov dword [esp + 0x20], ecx
mov ecx, dword [esp + 0x44]
jb 0x5162d0
ja 0x516373
cmp eax, edi
jb 0x5162d0
mov esi, dword [esp + 0x34]
cmp dword [esp + 0x14], 0
xorps xmm0, xmm0
movlpd qword [esp + 0x18], xmm0
jb 0x5163c6
ja 0x51638d
test ebp, ebp
je 0x5163c6
mov edi, dword [esp + 0x1c]
mov edx, dword [esp + 0x18]
mov ecx, dword [ebx + edx*4]
lea esi, [esi + 4]
mov byte [esi - 4], cl
mov eax, ecx
shr eax, 8
mov byte [esi - 3], al
mov eax, ecx
shr eax, 0x10
shr ecx, 0x18
add edx, 1
mov byte [esi - 2], al
adc edi, 0
mov byte [esi - 1], cl
cmp edi, dword [esp + 0x14]
jb 0x516395
ja 0x5163c6
cmp edx, ebp
jb 0x516395
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret