Function at 0x652303
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
mov eax, dword [0x6fe1c0]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 0xc]
xor eax, eax
push esi
push edi
mov edi, dword [ebp + 8]
mov esi, 0x8000
movzx edx, word [ebx + 0xa]
mov dword [ebp - 0x10], eax
mov dword [ebp - 0xc], eax
movzx ecx, word [edi + 0xa]
mov dword [ebp - 8], eax
mov eax, edx
xor eax, ecx
mov dword [ebp - 0x24], edi
and eax, esi
mov dword [ebp - 0x28], eax
lea eax, [esi - 1]
and ecx, eax
and edx, eax
lea eax, [edx + ecx]
movzx esi, ax
mov eax, 0x7fff
mov dword [ebp - 0x14], esi
cmp cx, ax
jae 0x65251e
cmp dx, ax
jae 0x65251e
mov eax, 0xbffd
cmp si, ax
ja 0x65251e
mov eax, 0x3fbf
cmp si, ax
jbe 0x652518
mov eax, SysReAllocString
test cx, cx
jne 0x6523ac
inc esi
mov dword [ebp - 0x14], esi
test dword [edi + 8], eax
jne 0x6523ac
cmp dword [edi + 4], 0
jne 0x6523ac
cmp dword [edi], 0
jne 0x6523ac
xor eax, eax
mov word [edi + 0xa], ax
jmp 0x65253c
test dx, dx
jne 0x6523c9
inc esi
mov dword [ebp - 0x14], esi
test dword [ebx + 8], eax
jne 0x6523c9
cmp dword [ebx + 4], 0
jne 0x6523c9
cmp dword [ebx], 0
je 0x652518
mov esi, dword [ebp + 0xc]
lea ebx, [ebp - 0xc]
push 5
xor ecx, ecx
pop eax
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x2c], eax
lea eax, [esi + 8]
mov esi, dword [ebp - 0x2c]
mov dword [ebp - 0x30], eax
lea eax, [edi + ecx*2]
mov edi, dword [ebp - 0x30]
mov dword [ebp - 0x18], eax
movzx ecx, word [eax]
lea edx, [ebx - 4]
movzx eax, word [edi]
imul ecx, eax
push edx
push ecx
push dword [edx]
call fcn.006522dd
test eax, eax
je 0x65240b
inc word [ebx]
mov eax, dword [ebp - 0x18]
sub edi, 2
add eax, 2
dec esi
mov dword [ebp - 0x18], eax
test esi, esi
jg 0x6523ef
mov ecx, dword [ebp - 0x1c]
add ebx, 2
mov eax, dword [ebp - 0x20]
inc ecx
mov edi, dword [ebp - 0x24]
dec eax
mov esi, dword [ebp + 0xc]
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 0x20], eax
test eax, eax
jg 0x6523da
mov esi, dword [ebp - 0x14]
mov ebx, 0xffff
add esi, 0xc002
test si, si
jle 0x652468
test dword [ebp - 8], 0x80000000
jne 0x65249e
lea eax, [ebp - 0x10]
push eax
call fcn.006525db
add esi, ebx
movzx eax, si
test si, si
jg 0x65244a
mov esi, eax
add esi, ebx
test si, si
jns 0x65249e
neg esi
movzx ebx, si
xor esi, esi
mov edi, esi
test byte [ebp - 0x10], 1
je 0x65247f
inc edi
lea eax, [ebp - 0x10]
push eax
call fcn.00652609
sub ebx, 1
jne 0x652478
test edi, edi
mov ebx, 0xffff
mov edi, dword [ebp - 0x24]
je 0x65249e
or word [ebp - 0x10], 1
mov ecx, 0x8000
cmp word [ebp - 0x10], cx
ja 0x6524b8
mov eax, dword [ebp - 0x10]
and eax, 0x1ffff
cmp eax, 0x18000
jne 0x6524f2
mov eax, dword [ebp - 0xe]
cmp eax, 0xffffffff
jne 0x6524ee
and dword [ebp - 0xe], 0
mov eax, dword [ebp - 0xa]
cmp eax, 0xffffffff
jne 0x6524e8
mov ax, word [ebp - 6]
and dword [ebp - 0xa], 0
cmp ax, bx
jne 0x6524e0
mov word [ebp - 6], cx
inc esi
jmp 0x6524f2
inc ax
mov word [ebp - 6], ax
jmp 0x6524f2
inc eax
mov dword [ebp - 0xa], eax
jmp 0x6524f2
inc eax
mov dword [ebp - 0xe], eax
mov eax, 0x7fff
cmp si, ax
jae 0x65251e
mov ax, word [ebp - 0xe]
or esi, dword [ebp - 0x28]
mov word [edi], ax
mov eax, dword [ebp - 0xc]
mov dword [edi + 2], eax
mov eax, dword [ebp - 8]
mov dword [edi + 6], eax
mov word [edi + 0xa], si
jmp 0x65253c
and dword [edi + 8], 0
jmp 0x652535
xor eax, eax
cmp word [ebp - 0x28], ax
sete al
dec eax
and eax, 0x80000000
add eax, 0x7fff8000
mov dword [edi + 8], eax
and dword [edi + 4], 0
and dword [edi], 0
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040548e
leave
ret 8