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

Disassembly:
push ebp
mov ebp, esp
push ebx
mov ebx, dword [ebp + 0x10]
push esi
mov esi, dword [ebp + 8]
push edi
mov eax, dword [esi + 0x1e4]
mov edi, dword [esi + 0xa94]
add eax, 0x355
and edi, dword [ebp + 0x18]
shl eax, 4
add eax, edi
mov dword [ebp + 8], edi
lea ecx, [esi + eax*2]
mov eax, dword [esi + 0x20]
cmp ebx, 0xffffffff
jne 0x50b0f1
mov ebx, dword [ebp + 0xc]
mov dword [esi + eax*4 + 0x28], 0
mov eax, dword [esi + 0x20]
mov dword [esi + eax*4 + 0xfc], ecx
inc dword [esi + 0x20]
mov edi, dword [ebx]
mov eax, edi
mov edx, dword [ebx + 0x18]
sub eax, edx
mov ecx, dword [ebx + 0x14]
mov dword [ebp + 8], edx
movzx edx, byte [eax + ecx - 1]
mov ecx, 8
sub cl, byte [esi + 0xa98]
mov eax, dword [esi + 0xa9c]
and eax, dword [ebp + 0x18]
shr edx, cl
mov ecx, dword [esi + 0xa98]
shl eax, cl
lea ecx, [esi + 0xaa0]
add edx, eax
imul eax, edx, 0x600
mov edx, dword [ebx + 0x14]
add ecx, eax
mov eax, edi
sub eax, dword [ebx + 0x18]
cmp dword [esi + 0x1e4], 7
mov dword [ebp + 0x18], ecx
movzx edx, byte [eax + edx]
jge 0x50b048
push edx
push 8
push ecx
push esi
call fcn.0050c480
add esp, 0x10
jmp 0x50b0a6
sub edi, dword [esi + 0x1e8]
sub edi, dword [ebp + 8]
mov eax, dword [ebx + 0x14]
mov ebx, 0x100
add edx, ebx
movzx edi, byte [edi + eax - 1]
mov eax, dword [esi + 0x20]
mov ecx, edx
shr ecx, 7
add edi, edi
and ecx, 1
mov dword [esi + eax*4 + 0x28], ecx
mov ecx, ebx
and ecx, edi
mov eax, edx
shr eax, 8
add ecx, ebx
add eax, ecx
add edx, edx
mov ecx, dword [ebp + 0x18]
lea ecx, [ecx + eax*2]
mov eax, dword [esi + 0x20]
mov dword [esi + eax*4 + 0xfc], ecx
mov eax, edi
inc dword [esi + 0x20]
xor eax, edx
not eax
and ebx, eax
cmp edx, 0x10000
jb 0x50b060
mov ebx, dword [ebp + 0xc]
mov eax, dword [esi + 0x1e4]
cmp eax, 3
jg 0x50b0c4
xor eax, eax
mov dword [esi + 0x1e4], eax
mov eax, dword [ebp + 0x14]
sub dword [ebx + 0x18], eax
pop edi
pop esi
pop ebx
pop ebp
ret
cmp eax, 9
jg 0x50b0dd
add eax, 0xfffffffd
mov dword [esi + 0x1e4], eax
mov eax, dword [ebp + 0x14]
sub dword [ebx + 0x18], eax
pop edi
pop esi
pop ebx
pop ebp
ret
add eax, 0xfffffffa
mov dword [esi + 0x1e4], eax
mov eax, dword [ebp + 0x14]
sub dword [ebx + 0x18], eax
pop edi
pop esi
pop ebx
pop ebp
ret
mov dword [esi + eax*4 + 0x28], 1
mov eax, dword [esi + 0x20]
mov dword [esi + eax*4 + 0xfc], ecx
inc dword [esi + 0x20]
mov edx, dword [esi + 0x1e4]
mov eax, dword [esi + 0x20]
add edx, 0x3610
lea ecx, [esi + eax*4]
lea edx, [esi + edx*2]
cmp ebx, 4
jae 0x50b2c9
mov dword [ecx + 0x28], 1
mov eax, dword [esi + 0x20]
mov dword [esi + eax*4 + 0xfc], edx
inc dword [esi + 0x20]
mov eax, dword [esi + 0x20]
lea edx, [esi + eax*4]
test ebx, ebx
jne 0x50b197
mov eax, dword [esi + 0x1e4]
add eax, 0x361c
mov dword [edx + 0x28], ebx
mov ebx, dword [ebp + 0x14]
lea ecx, [esi + eax*2]
mov eax, dword [esi + 0x20]
mov dword [esi + eax*4 + 0xfc], ecx
inc dword [esi + 0x20]
mov eax, dword [esi + 0x1e4]
mov edx, dword [esi + 0x20]
add eax, 0x364
shl eax, 4
add eax, edi
lea ecx, [esi + eax*2]
xor eax, eax
cmp ebx, 1
setne al
mov dword [esi + edx*4 + 0x28], eax
mov eax, dword [esi + 0x20]
mov dword [esi + eax*4 + 0xfc], ecx
inc dword [esi + 0x20]
jmp 0x50b261
mov eax, dword [esi + ebx*4 + 0x1e8]
mov dword [ebp + 0x18], eax
mov eax, dword [esi + 0x1e4]
add eax, 0x361c
mov dword [edx + 0x28], 1
lea ecx, [esi + eax*2]
mov eax, dword [esi + 0x20]
mov dword [esi + eax*4 + 0xfc], ecx
inc dword [esi + 0x20]
mov edx, dword [esi + 0x1e4]
mov eax, dword [esi + 0x20]
add edx, 0x3628
lea ecx, [esi + eax*4]
lea edx, [esi + edx*2]
cmp ebx, 1
jne 0x50b1f3
mov dword [ecx + 0x28], 0
mov eax, dword [esi + 0x20]
mov dword [esi + eax*4 + 0xfc], edx
inc dword [esi + 0x20]
jmp 0x50b249
mov dword [ecx + 0x28], 1
mov eax, dword [esi + 0x20]
mov dword [esi + eax*4 + 0xfc], edx
inc dword [esi + 0x20]
mov eax, dword [esi + 0x1e4]
mov ecx, dword [esi + 0x20]
add eax, 0x3634
lea edx, [esi + eax*2]
lea eax, [ebx - 2]
mov dword [esi + ecx*4 + 0x28], eax
mov eax, dword [esi + 0x20]
mov dword [esi + eax*4 + 0xfc], edx
inc dword [esi + 0x20]
cmp ebx, 3
jne 0x50b23d
mov eax, dword [esi + 0x1f0]
mov dword [esi + 0x1f4], eax
mov eax, dword [esi + 0x1ec]
mov dword [esi + 0x1f0], eax
mov eax, dword [esi + 0x1e8]
mov ebx, dword [ebp + 0x14]
mov dword [esi + 0x1ec], eax
mov eax, dword [ebp + 0x18]
mov dword [esi + 0x1e8], eax
cmp ebx, 1
jne 0x50b28a
xor eax, eax
cmp dword [esi + 0x1e4], 7
pop edi
setge al
lea eax, [eax*2 + 9]
mov dword [esi + 0x1e4], eax
mov eax, dword [ebp + 0xc]
pop esi
sub dword [eax + 0x18], ebx
pop ebx
pop ebp
ret
movzx eax, byte [esi + 0xa90]
push eax
push ebx
push edi
lea eax, [esi + 0xb94c]
push eax
push esi
call fcn.0050b300
add esp, 0x14
mov eax, 0xb
cmp dword [esi + 0x1e4], 7
mov ecx, 8
cmovl eax, ecx
mov dword [esi + 0x1e4], eax
mov eax, dword [ebp + 0xc]
pop edi
pop esi
sub dword [eax + 0x18], ebx
pop ebx
pop ebp
ret
mov edi, dword [ebp + 0x14]
mov dword [ecx + 0x28], 0
mov eax, dword [esi + 0x20]
push edi
mov dword [esi + eax*4 + 0xfc], edx
lea eax, [ebx - 4]
inc dword [esi + 0x20]
push eax
push dword [ebp + 8]
push esi
call fcn.0050c330
mov eax, dword [ebp + 0xc]
add esp, 0x10
sub dword [eax + 0x18], edi
pop edi
pop esi
pop ebx
pop ebp
ret