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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
mov edx, dword [ebp + 0xc]
xorps xmm0, xmm0
mov eax, dword [ebp + 0x10]
push ebx
mov ebx, edx
movlpd qword [ebp - 0x10], xmm0
shld eax, ebx, 5
push esi
mov esi, dword [ebp + 8]
mov ecx, esi
shl ebx, 5
mov dword [ebp - 4], eax
mov dword [ebp - 8], ebx
push edi
mov edi, dword [ebp + 0x24]
test eax, eax
jb 0x50666d
ja 0x506628
test ebx, ebx
je 0x50666d
mov esi, dword [ebp - 0xc]
mov edx, dword [ebp - 0x10]
nop
movzx eax, byte [ecx]
lea ecx, [ecx + 4]
mov dword [edi], eax
movzx eax, byte [ecx - 3]
shl eax, 8
or dword [edi], eax
movzx eax, byte [ecx - 2]
shl eax, 0x10
or dword [edi], eax
movzx eax, byte [ecx - 1]
shl eax, 0x18
or dword [edi], eax
add edx, 1
adc esi, 0
add edi, 4
cmp esi, dword [ebp - 4]
jb 0x506630
ja 0x506667
cmp edx, ebx
jb 0x506630
mov esi, dword [ebp + 8]
mov edx, dword [ebp + 0xc]
xor ecx, ecx
mov eax, 1
cmp ecx, dword [ebp + 0x18]
ja 0x5066c2
jb 0x506680
cmp eax, dword [ebp + 0x14]
jae 0x5066c2
mov ecx, edx
mov esi, eax
shl ecx, 7
xor ebx, ebx
mov dword [ebp - 0x18], ecx
nop dword [eax]
push dword [ebp + 0x10]
mov eax, edi
push edx
sub eax, ecx
push eax
push edi
call fcn.00506200
mov ecx, dword [ebp - 0x18]
add esp, 0x10
mov edx, dword [ebp + 0xc]
add esi, 1
adc ebx, 0
add edi, ecx
cmp ebx, dword [ebp + 0x18]
jb 0x506690
ja 0x5066bc
cmp esi, dword [ebp + 0x14]
jb 0x506690
mov esi, dword [ebp + 8]
mov ebx, dword [ebp - 8]
mov eax, dword [ebp + 0x14]
mov ecx, dword [ebp + 0xc]
dec eax
push dword [ebp + 0x10]
mov edi, dword [ebp + 0x1c]
imul eax, ecx
push ecx
shl eax, 7
add eax, dword [ebp + 0x24]
push eax
push edi
call fcn.00506200
mov edx, dword [ebp + 0x18]
add esp, 0x10
xorps xmm0, xmm0
movlpd qword [ebp - 0x10], xmm0
test edx, edx
jb 0x5067bc
mov ecx, dword [ebp + 0x14]
ja 0x506703
test ecx, ecx
je 0x5067bc
mov eax, dword [ebp + 0xc]
add edi, 0xffffffc0
mov esi, dword [ebp - 4]
shl eax, 7
add edi, eax
mov eax, dword [ebp - 0xc]
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x18], edi
mov dword [ebp - 0xc], eax
push edx
push ecx
push 0
push dword [edi]
call fcn.0055e6c0
mov edi, eax
xorps xmm0, xmm0
mov eax, dword [ebp + 0xc]
imul edi, eax
movlpd qword [ebp - 0x20], xmm0
shl edi, 7
add edi, dword [ebp + 0x24]
test esi, esi
jb 0x506779
ja 0x50674b
test ebx, ebx
je 0x506779
mov edx, dword [ebp - 0x1c]
mov ecx, dword [ebp - 0x20]
mov eax, dword [ebp + 0x1c]
lea edi, [edi + 4]
mov ebx, dword [ebp + 0x20]
mov eax, dword [eax + ecx*4]
xor eax, dword [edi - 4]
mov dword [ebx + ecx*4], eax
add ecx, 1
mov ebx, dword [ebp - 8]
adc edx, 0
cmp edx, esi
jb 0x506751
ja 0x506776
cmp ecx, ebx
jb 0x506751
mov eax, dword [ebp + 0xc]
push dword [ebp + 0x10]
mov edi, dword [ebp + 0x1c]
push eax
push dword [ebp + 0x20]
push edi
call fcn.00506200
mov eax, dword [ebp - 0xc]
add esp, 0x10
mov ecx, dword [ebp - 0x14]
add eax, 1
mov edx, dword [ebp + 0x18]
mov edi, dword [ebp - 0x18]
adc ecx, 0
mov dword [ebp - 0x14], ecx
cmp ecx, edx
mov ecx, dword [ebp + 0x14]
mov dword [ebp - 0xc], eax
jb 0x506720
ja 0x5067b9
cmp eax, ecx
jb 0x506720
mov esi, dword [ebp + 8]
cmp dword [ebp - 4], 0
xorps xmm0, xmm0
movlpd qword [ebp - 0x10], xmm0
jb 0x506809
ja 0x5067d0
test ebx, ebx
je 0x506809
mov edi, dword [ebp - 0xc]
mov edx, dword [ebp - 0x10]
mov eax, dword [ebp + 0x1c]
lea esi, [esi + 4]
mov ecx, dword [eax + edx*4]
mov eax, ecx
shr eax, 8
mov byte [esi - 4], cl
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 [ebp - 4]
jb 0x5067d6
ja 0x506809
cmp edx, ebx
jb 0x5067d6
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret