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

Disassembly:
mov eax, 0x20
call fcn.0059eec0
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 0x5869c4
ja 0x586966
test ebp, ebp
je 0x5869c4
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 0x586972
ja 0x5869b8
cmp esi, ebp
jb 0x586972
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 0x586a20
jb 0x5869d9
cmp edi, dword [esp + 0x40]
jae 0x586a20
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.005867e0
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 0x5869e4
ja 0x586a12
cmp edi, dword [esp + 0x40]
jb 0x5869e4
mov esi, dword [esp + 0x34]
mov ebp, dword [esp + 0x24]
mov ecx, dword [esp + 0x38]
jmp 0x586a24
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.005867e0
mov ecx, dword [esp + 0x54]
add esp, 0x10
xorps xmm0, xmm0
movlpd qword [esp + 0x18], xmm0
test ecx, ecx
jb 0x586b37
ja 0x586a6b
test edi, edi
je 0x586b37
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.0059f2d0
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 0x586aec
ja 0x586abc
test ebp, ebp
je 0x586aec
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 0x586ac4
ja 0x586ae8
cmp ecx, ebp
jb 0x586ac4
mov edi, dword [esp + 0x40]
push dword [esp + 0x3c]
push dword [esp + 0x3c]
push dword [esp + 0x54]
push ebx
call fcn.005867e0
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 0x586a90
ja 0x586b33
cmp eax, edi
jb 0x586a90
mov esi, dword [esp + 0x34]
cmp dword [esp + 0x14], 0
xorps xmm0, xmm0
movlpd qword [esp + 0x18], xmm0
jb 0x586b86
ja 0x586b4d
test ebp, ebp
je 0x586b86
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 0x586b55
ja 0x586b86
cmp edx, ebp
jb 0x586b55
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret