Function at 0x46e910
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x2c
mov ebp, dword [esp + 0x4c]
mov edi, dword [esp + 0x48]
test ebp, ebp
jle 0x46eb7c
mov ebx, edi
sub ebp, 1
mov dword [esp + 0x10], 0
mov eax, dword [esp + 0x10]
mov edx, dword [esp + 0x10]
add eax, 1
cmp eax, dword [esp + 0x44]
jge 0x46e94e
add edx, 2
cmp dword [esp + 0x44], edx
jge 0x46e960
mov byte [ebx], 0
add esp, 0x2c
mov eax, edx
pop ebx
pop esi
pop edi
pop ebp
ret
mov esi, dword [esp + 0x40]
mov ecx, dword [esi + 0xc]
mov eax, dword [esi + 8]
mov dword [esp + 0x14], ecx
cmp eax, ecx
jae 0x46eae4
movzx esi, byte [eax]
add eax, 1
cmp eax, ecx
mov dword [esp + 0x18], esi
mov esi, dword [esp + 0x40]
mov dword [esi + 8], eax
jae 0x46eb09
xor esi, esi
cmp eax, dword [esp + 0x14]
jae 0x46e9a7
movzx esi, byte [eax]
add eax, 1
mov ecx, dword [esp + 0x40]
shl esi, 8
mov dword [ecx + 8], eax
or esi, dword [esp + 0x18]
lea ecx, [esi - 0xd800]
cmp ecx, 0x7ff
ja 0x46eb8f
add dword [esp + 0x10], 4
mov esi, dword [esp + 0x10]
cmp dword [esp + 0x44], esi
jge 0x46e9d5
mov edx, dword [esp + 0x10]
jmp 0x46e94e
mov edx, dword [esp + 0x14]
cmp eax, edx
jae 0x46eb2d
movzx esi, byte [eax]
add eax, 1
cmp eax, dword [esp + 0x14]
mov dword [esp + 0x18], esi
mov esi, dword [esp + 0x40]
mov dword [esi + 8], eax
jae 0x46eb5c
xor esi, esi
cmp eax, edx
jae 0x46ea12
movzx esi, byte [eax]
add eax, 1
mov edx, dword [esp + 0x40]
shl esi, 8
mov dword [edx + 8], eax
or esi, dword [esp + 0x18]
cmp esi, 0x3ff
ja 0x46e9cc
cmp ecx, 0x3ff
ja 0x46e9cc
shl ecx, 0xa
lea esi, [esi + ecx + 0x10000]
test esi, esi
je 0x46e9cc
cmp esi, 0x7f
ja 0x46ea51
mov eax, ebx
sub eax, edi
cmp eax, ebp
jge 0x46e934
mov ecx, esi
mov byte [ebx], cl
add ebx, 1
jmp 0x46e934
mov eax, esi
mov ecx, 0x23
or eax, 1
mov edx, 0x66666667
bsr eax, eax
xor eax, 0x1f
sub ecx, eax
mov eax, ecx
imul edx
sar ecx, 0x1f
sar edx, 1
sub edx, ecx
mov ecx, ebx
lea eax, [edx + edx*2 - 3]
sub ecx, edi
add eax, eax
cmp ecx, ebp
mov dword [esp + 0x14], eax
mov dword [esp + 8], eax
jge 0x46eaac
movzx ecx, byte [esp + 0x14]
mov eax, esi
shr eax, cl
mov ecx, edx
mov dword [esp + 0x1c], eax
mov eax, 0x100
sar eax, cl
mov edx, eax
neg edx
or dl, byte [esp + 0x1c]
mov byte [ebx], dl
add ebx, 1
cmp dword [esp + 0x14], 5
jle 0x46e934
mov ecx, dword [esp + 8]
nop
lea esi, [esi]
mov eax, ebx
sub ecx, 6
sub eax, edi
cmp ebp, eax
jle 0x46eada
mov eax, esi
shr eax, cl
and eax, 0x3f
or eax, 0xffffff80
mov byte [ebx], al
add ebx, 1
cmp ecx, 5
jg 0x46eac0
jmp 0x46e934
mov eax, esi
mov dword [esp + 0xc], edx
call fcn.0046b9b0
mov eax, dword [esi + 8]
mov ecx, dword [esi + 0xc]
mov edx, dword [esp + 0xc]
cmp eax, ecx
jb 0x46eb86
mov dword [esp + 0x18], 0
mov eax, dword [esp + 0x40]
mov dword [esp + 0xc], edx
call fcn.0046b9b0
mov esi, dword [esp + 0x40]
mov edx, dword [esp + 0xc]
mov ecx, dword [esi + 0xc]
mov eax, dword [esi + 8]
mov dword [esp + 0x14], ecx
jmp 0x46e98f
mov eax, dword [esp + 0x40]
mov dword [esp + 0xc], ecx
call fcn.0046b9b0
mov esi, dword [esp + 0x40]
mov ecx, dword [esp + 0xc]
mov edx, dword [esi + 0xc]
mov eax, dword [esi + 8]
mov dword [esp + 0x14], edx
cmp eax, edx
jb 0x46e9e1
mov dword [esp + 0x18], 0
mov eax, dword [esp + 0x40]
mov dword [esp + 0xc], ecx
call fcn.0046b9b0
mov esi, dword [esp + 0x40]
mov ecx, dword [esp + 0xc]
mov eax, dword [esi + 8]
mov edx, dword [esi + 0xc]
jmp 0x46e9fc
mov edx, 0xffffffea
jmp 0x46e951
mov dword [esp + 0x14], ecx
jmp 0x46e976
mov dword [esp + 0x10], edx
jmp 0x46ea30