Function at 0x462770
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 0x4627ba
mov edi, 0xff
jmp 0x4627a0
cmp dx, di
ja 0x4627b2
movzx edx, word [esi + ecx*2 + 2]
inc ecx
test dx, dx
jne 0x4627a0
jmp 0x4627ba
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 0x4627e0
sub edi, edx
mov dword [esp + 0x1c], edi
cmp word [esi], bp
je 0x462a2c
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 0x46294b
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 0x46283c
movsx edx, byte [eax + ebx]
cmp ecx, edx
jne 0x46283c
inc ebx
add esi, 2
cmp ebx, 0x81
jl 0x462820
mov eax, dword [esp + 0x18]
cmp ebx, 2
jl 0x462894
add ebp, ebx
cmp dword [eax + 8], 8
mov dword [esp + 0x14], ebp
jne 0x46286d
mov edx, dword [eax + 0xc]
mov esi, 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 0x462a1d
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 0x4628d5
mov ecx, esi
shr ecx, 8
cmp cl, byte [esp + 0x10]
jne 0x4628d5
movsx edx, byte [ebx + ebp]
movzx ecx, al
add edx, ecx
xor edx, esi
test dl, dl
jne 0x4628d5
inc ebx
add edi, 2
cmp ebx, 0x81
jl 0x4628a7
mov eax, dword [esp + 0x18]
mov ebp, dword [esp + 0x14]
cmp ebx, 2
jl 0x462943
add ebp, ebx
cmp dword [eax + 8], 8
mov dword [esp + 0x14], ebp
jne 0x46290a
mov edx, dword [eax + 0xc]
mov esi, 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 0x462a1d
mov ebx, dword [esp + 0x30]
mov cl, byte [esp + 0x13]
test cl, cl
jne 0x462988
cmp dword [eax + 8], 8
jne 0x462971
mov edx, dword [eax + 0xc]
mov esi, 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 0x462a15
cmp cl, byte [esp + 0x10]
jne 0x4629cc
cmp dword [eax + 8], 8
jne 0x4629b0
mov edx, dword [eax + 0xc]
mov esi, 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 0x462a15
cmp dword [eax + 8], 8
jne 0x4629ee
mov edx, dword [eax + 0xc]
mov esi, 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 0x4627f6
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