Function at 0x46d640
Capabilities:
Encrypt data using rc4 prga

Disassembly:
sub esp, 0x14
push ebx
mov ebx, dword [esp + 0x24]
mov eax, ecx
push ebp
push esi
mov esi, dword [esp + 0x28]
xor ecx, ecx
mov dword [eax], ebx
push edi
mov dword [esp + 0x18], eax
movzx edx, word [esi]
mov byte [esp + 0x10], 1
test dx, dx
je 0x46d68a
mov edi, 0xff
jmp 0x46d670
cmp dx, di
ja 0x46d682
movzx edx, word [esi + ecx*2 + 2]
inc ecx
test dx, dx
jne 0x46d670
jmp 0x46d68a
mov cl, byte [esi + ecx*2 + 1]
mov byte [esp + 0x10], cl
mov ecx, dword [eax + 0x10]
xor ebp, ebp
mov dl, byte [esp + 0x10]
mov edi, dword [esp + 0x28]
mov dword [esp + 0x14], ebp
mov byte [ebx + ecx], dl
mov ecx, dword [eax + 0x10]
inc ecx
lea edx, [edi + 1]
mov dword [eax + 0xc], ecx
inc ecx
mov dword [eax + 0x10], ecx
lea esp, [esp]
mov cl, byte [edi]
inc edi
test cl, cl
jne 0x46d6b0
sub edi, edx
mov dword [esp + 0x1c], edi
cmp word [esi], bp
je 0x46d8fc
lea edi, [esi + ebp*2]
mov cl, byte [edi + 1]
mov dl, byte [edi]
mov byte [esp + 0x13], cl
mov byte [esp + 0x11], dl
cmp ebp, dword [esp + 0x1c]
jae 0x46d81b
mov eax, dword [esp + 0x28]
xor ebx, ebx
add eax, ebp
mov esi, edi
mov dword [esp + 0x20], eax
mov edi, edi
movzx ecx, word [esi]
test cx, cx
je 0x46d70c
movsx edx, byte [eax + ebx]
cmp ecx, edx
jne 0x46d70c
inc ebx
add esi, 2
cmp ebx, 0x81
jl 0x46d6f0
mov eax, dword [esp + 0x18]
cmp ebx, 2
jl 0x46d764
add ebp, ebx
cmp dword [eax + 8], 8
mov dword [esp + 0x14], ebp
jne 0x46d73d
mov esi, dword [eax + 0xc]
mov edx, dword [eax]
mov cl, byte [eax + 4]
mov byte [esi + edx], cl
mov ecx, dword [eax + 0x10]
mov dword [eax + 0xc], ecx
inc ecx
mov dword [eax + 0x10], ecx
mov dword [eax + 8], 0
mov cl, byte [eax + 4]
sub bl, 2
mov edx, dword [esp + 0x30]
add dword [eax + 8], 2
shl cl, 2
or cl, 3
mov byte [eax + 4], cl
mov ecx, dword [eax + 0x10]
mov byte [edx + ecx], bl
mov ebx, edx
inc dword [eax + 0x10]
jmp 0x46d8ed
mov ebp, dword [esp + 0x20]
mov cl, byte [esp + 0x11]
sub cl, byte [ebp]
xor ebx, ebx
mov byte [esp + 0x12], cl
mov al, cl
movzx esi, word [edi]
test si, si
je 0x46d7a5
mov ecx, esi
shr ecx, 8
cmp cl, byte [esp + 0x10]
jne 0x46d7a5
movsx edx, byte [ebx + ebp]
movzx ecx, al
add edx, ecx
xor edx, esi
test dl, dl
jne 0x46d7a5
inc ebx
add edi, 2
cmp ebx, 0x81
jl 0x46d777
mov eax, dword [esp + 0x18]
mov ebp, dword [esp + 0x14]
cmp ebx, 2
jl 0x46d813
add ebp, ebx
cmp dword [eax + 8], 8
mov dword [esp + 0x14], ebp
jne 0x46d7da
mov esi, dword [eax + 0xc]
mov edx, dword [eax]
mov cl, byte [eax + 4]
mov byte [esi + edx], cl
mov ecx, dword [eax + 0x10]
mov dword [eax + 0xc], ecx
inc ecx
mov dword [eax + 0x10], ecx
mov dword [eax + 8], 0
mov cl, byte [eax + 4]
sub bl, 2
mov edx, dword [esp + 0x30]
or bl, 0x80
add dword [eax + 8], 2
shl cl, 2
or cl, 3
mov byte [eax + 4], cl
mov ecx, dword [eax + 0x10]
mov byte [edx + ecx], bl
inc dword [eax + 0x10]
mov ecx, dword [eax + 0x10]
mov ebx, dword [esp + 0x30]
mov dl, byte [esp + 0x12]
mov byte [ecx + ebx], dl
inc dword [eax + 0x10]
jmp 0x46d8ed
mov ebx, dword [esp + 0x30]
mov cl, byte [esp + 0x13]
test cl, cl
jne 0x46d858
cmp dword [eax + 8], 8
jne 0x46d841
mov esi, dword [eax + 0xc]
mov edx, dword [eax]
mov cl, byte [eax + 4]
mov byte [esi + edx], cl
mov ecx, dword [eax + 0x10]
mov dword [eax + 0xc], ecx
inc ecx
mov dword [eax + 0x10], ecx
mov dword [eax + 8], 0
mov ecx, dword [eax + 0x10]
add dword [eax + 8], 2
mov dl, byte [esp + 0x11]
shl byte [eax + 4], 2
mov byte [ebx + ecx], dl
jmp 0x46d8e5
cmp cl, byte [esp + 0x10]
jne 0x46d89c
cmp dword [eax + 8], 8
jne 0x46d880
mov esi, dword [eax + 0xc]
mov edx, dword [eax]
mov cl, byte [eax + 4]
mov byte [esi + edx], cl
mov ecx, dword [eax + 0x10]
mov dword [eax + 0xc], ecx
inc ecx
mov dword [eax + 0x10], ecx
mov dword [eax + 8], 0
mov cl, byte [eax + 4]
add dword [eax + 8], 2
mov dl, byte [esp + 0x11]
shl cl, 2
or cl, 1
mov byte [eax + 4], cl
mov ecx, dword [eax + 0x10]
mov byte [ebx + ecx], dl
jmp 0x46d8e5
cmp dword [eax + 8], 8
jne 0x46d8be
mov esi, dword [eax + 0xc]
mov edx, dword [eax]
mov cl, byte [eax + 4]
mov byte [esi + edx], cl
mov ecx, dword [eax + 0x10]
mov dword [eax + 0xc], ecx
inc ecx
mov dword [eax + 0x10], ecx
mov dword [eax + 8], 0
mov cl, byte [eax + 4]
add dword [eax + 8], 2
mov dl, byte [esp + 0x11]
shl cl, 2
or cl, 2
mov byte [eax + 4], cl
mov ecx, dword [eax + 0x10]
mov byte [ebx + ecx], dl
inc dword [eax + 0x10]
mov ecx, dword [eax + 0x10]
mov dl, byte [esp + 0x13]
mov byte [ecx + ebx], dl
inc dword [eax + 0x10]
inc ebp
mov dword [esp + 0x14], ebp
mov esi, dword [esp + 0x2c]
cmp word [esi + ebp*2], 0
jne 0x46d6c6
mov dl, byte [eax + 4]
mov ecx, 8
sub ecx, dword [eax + 8]
shl dl, cl
mov ecx, dword [eax + 0xc]
pop edi
pop esi
pop ebp
mov byte [ebx + ecx], dl
mov eax, dword [eax + 0x10]
pop ebx
add esp, 0x14
ret 0xc