Function at 0x4ca5e0
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x1c
mov ebx, dword [ebp + 0xc]
test ebx, ebx
je 0x4ca751
movzx eax, word [ebp + 8]
mov dword [ecx], 0
test al, 1
jne 0x4ca762
xor edi, edi
movzx eax, ax
shr eax, 1
inc edi
mov edx, eax
test al, 1
je 0x4ca608
mov dword [ebp - 0x18], ecx
mov dword [ebp - 0x24], edx
bsr ecx, edx
xor ecx, 0x1f
mov edx, 0x20
sub edx, ecx
imul edx, ebx
cmp edx, 0xde3
jg 0x4ca76c
xor esi, esi
inc esi
mov edx, esi
add esi, esi
cmp edx, ebx
jle 0x4ca639
mov dword [ebp - 0x1c], edi
mov esi, edx
sar esi, 2
mov dword [ebp - 0x10], esi
cmp edx, 4
mov esi, dword [ebp - 0x18]
movzx ebx, ax
jae 0x4ca7b2
xor edi, edi
xor edx, edx
mov eax, ebx
or eax, edi
je 0x4ca6a5
mov dword [ebp - 0x14], edx
xor eax, eax
mov esi, edi
mov edx, ebx
mov ecx, edi
mov edi, 0xfffffff
and edx, edi
mov edi, dword [ebp - 0x18]
mov dword [edi + eax*4 + 4], edx
mov edx, ecx
shld edx, ebx, 4
shr esi, 0x1c
inc eax
mov edi, 0xfffffff
cmp edi, ebx
mov ebx, 0
sbb ebx, ecx
mov ebx, edx
mov edi, esi
jb 0x4ca66c
mov esi, dword [ebp - 0x18]
mov word [esi], ax
mov edx, dword [ebp - 0x14]
test dl, 1
jne 0x4ca771
mov eax, dword [ebp - 0x10]
test eax, eax
mov edi, dword [ebp - 0x1c]
mov ebx, dword [ebp + 0xc]
jne 0x4ca780
movsx ecx, word [esi]
mov dword [ebp - 0x10], ecx
test ecx, ecx
je 0x4ca747
imul edi, ebx
mov ecx, 0x92492493
mov eax, edi
imul ecx
add edx, edi
mov eax, edx
shr eax, 0x1f
sar edx, 4
add edx, eax
add word [esi + 2], dx
mov eax, dword [ebp - 0x10]
cmp ax, 0x7f
jg 0x4ca76c
test ax, ax
jle 0x4ca747
lea eax, [edx + edx*8]
lea eax, [eax + eax*2]
add eax, edx
sub edi, eax
mov dword [ebp - 0x1c], edi
mov eax, 0x1c
sub eax, edi
mov dword [ebp - 0x14], eax
xor ebx, ebx
mov eax, esi
xor esi, esi
mov edi, ebx
mov edx, dword [eax + esi*4 + 4]
mov ebx, edx
mov ecx, dword [ebp - 0x14]
shr ebx, cl
mov ecx, dword [ebp - 0x1c]
shl edx, cl
add edx, edi
and edx, 0xfffffff
mov dword [eax + esi*4 + 4], edx
inc esi
cmp dword [ebp - 0x10], esi
jne 0x4ca710
test ebx, ebx
je 0x4ca747
mov ecx, eax
mov eax, dword [ebp - 0x10]
mov dword [ecx + eax*4 + 4], ebx
mov eax, dword [ecx]
inc eax
mov word [ecx], ax
add esp, 0x1c
pop esi
pop edi
pop ebx
pop ebp
ret 8
mov word [ecx + 2], 0
mov dword [ecx + 4], 1
xor eax, eax
jmp 0x4ca743
movzx edx, ax
xor edi, edi
jmp 0x4ca614
call fcn.0063e370
mov ecx, esi
push dword [ebp - 0x24]
call fcn.004ca500
jmp 0x4ca6ae
mov ecx, esi
mov edi, eax
call fcn.0068f260
mov esi, edi
test edi, ebx
je 0x4ca79a
mov ecx, dword [ebp - 0x18]
push dword [ebp - 0x24]
call fcn.004ca500
mov eax, esi
sar eax, 1
cmp esi, 1
mov esi, dword [ebp - 0x18]
mov edi, dword [ebp - 0x1c]
mov ebx, dword [ebp + 0xc]
jbe 0x4ca6bf
jmp 0x4ca780
or ecx, 0x20
xor edx, edx
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x28], ebx
xor edi, edi
mov dword [ebp - 0x14], edx
mov esi, edi
imul esi, ebx
mov eax, ebx
mul ebx
add edx, esi
add edx, esi
mov edi, edx
mov ebx, eax
mov eax, dword [ebp - 0x20]
test dword [ebp + 0xc], eax
je 0x4ca818
mov eax, ebx
shrd eax, edi, cl
mov esi, edi
shr esi, cl
test cl, 0x20
cmovne eax, esi
mov edx, 0
cmovne esi, edx
or esi, eax
setne byte [ebp - 0x10]
mov eax, dword [ebp - 0x28]
mov edx, 1
cmovne eax, edx
imul edi, eax
mul ebx
add edi, edx
mov edx, dword [ebp - 0x14]
or dl, byte [ebp - 0x10]
mov dword [ebp - 0x14], edx
mov ebx, eax
mov edx, dword [ebp - 0x20]
mov eax, edx
sar eax, 1
mov dword [ebp - 0x10], eax
cmp edx, 2
jae 0x4ca832
mov esi, dword [ebp - 0x18]
mov edx, dword [ebp - 0x14]
jmp 0x4ca65f
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x20], eax
test edi, edi
mov esi, dword [ebp - 0x18]
mov edx, dword [ebp - 0x14]
jne 0x4ca65f
jmp 0x4ca7c2