Function at 0x406850
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x18
mov ebp, dword [ecx]
xor eax, eax
cmp byte [ebp], 0x22
jne 0x406af0
mov esi, ebp
jmp 0x40687f
lea esi, [ebx + 2]
mov dword [ecx], esi
cmp byte [ebx + 2], 0
je 0x406af0
mov ebx, esi
inc esi
mov dword [ecx], esi
movzx edi, byte [ebx + 1]
cmp edi, 0x5c
je 0x406870
test edi, edi
je 0x406af0
cmp edi, 0x22
jne 0x40687f
mov dword [esp + 8], edx
add ebx, 2
mov dword [ecx], ebx
mov esi, ebp
sub ebx, ebp
lea eax, [ebx - 1]
push eax
call dword [0x449008]
add esp, 4
mov dword [esp], eax
test eax, eax
je case.0x40692f.35
inc esi
mov dword [esp + 4], esi
movzx eax, byte [esi]
mov esi, dword [esp]
test al, al
je 0x406aa6
add ebx, 0xfffffffe
mov ebp, dword [esp + 4]
mov ecx, ebp
not ecx
mov dword [esp + 0xc], ecx
mov esi, dword [esp]
jmp 0x406900
mov byte [esi], 0xa
nop
nop
nop
nop
nop
nop
nop
inc esi
movzx eax, byte [edi + 1]
inc edi
mov ebp, edi
test al, al
je 0x406aa6
mov ecx, ebp
and ecx, dword [esp + 0xc]
mov edx, ebp
not edx
and edx, dword [esp + 4]
sub ecx, edx
cmp ecx, ebx
jae 0x406aa6
cmp al, 0x5c
jne 0x406940
movzx eax, byte [ebp + 1]
add eax, 0xffffffde
cmp eax, 0x53
ja case.0x40692f.35
lea edi, [ebp + 1]
jmp dword [eax*4 + 0x44698c]
mov byte [esi], 0x22
jmp 0x4068f0
cmp al, 0x20
jb case.0x40692f.35
mov byte [esi], al
mov edi, ebp
jmp 0x4068f0
mov byte [esi], 0x2f
jmp 0x4068f0
mov byte [esi], 8
jmp 0x4068f0
lea ecx, [ebp + 2]
lea edx, [esp + 0x14]
call fcn.00406b00
test eax, eax
jne case.0x40692f.35
mov edx, dword [esp + 0x14]
cmp edx, 0x7f
ja 0x406999
mov byte [esi], dl
jmp 0x4069e6
mov byte [esi], 0x5c
jmp 0x4068f0
mov byte [esi], 0xd
jmp 0x4068f0
mov byte [esi], 0xc
jmp 0x4068f0
mov byte [esi], 9
jmp 0x4068f0
cmp edx, 0x7ff
ja 0x4069b6
mov eax, edx
shr eax, 6
or al, 0xc0
mov byte [esi], al
and dl, 0x3f
or dl, 0x80
mov byte [esi + 1], dl
inc esi
jmp 0x4069e6
lea eax, [edx - 0xe000]
cmp eax, 0xfffff7ff
ja 0x4069f5
mov eax, edx
shr eax, 0xc
and al, 0xf
or al, 0xe0
mov byte [esi], al
mov eax, edx
shr eax, 6
and al, 0x3f
or al, 0x80
mov byte [esi + 1], al
and dl, 0x3f
or dl, 0x80
mov byte [esi + 2], dl
add esi, 2
mov eax, 1
add edi, eax
add edi, 3
jmp 0x4068f0
cmp edx, 0xdbff
ja case.0x40692f.35
cmp byte [ebp + 6], 0x5c
jne case.0x40692f.35
cmp byte [ebp + 7], 0x75
jne case.0x40692f.35
add ebp, 8
mov ecx, ebp
mov ebp, edx
lea edx, [esp + 0x10]
call fcn.00406b00
test eax, eax
jne case.0x40692f.35
mov eax, dword [esp + 0x10]
cmp eax, 0xdc00
jb case.0x40692f.35
cmp eax, 0xdfff
ja case.0x40692f.35
mov edx, ebp
shl edx, 0xa
and edx, 0xffc00
mov ecx, eax
and ecx, 0x3ff
add ecx, edx
add ecx, 0x10000
mov edx, ecx
shr edx, 0x12
or dl, 0xf0
mov byte [esi], dl
mov edx, ecx
shr edx, 0xc
and dl, 0x3f
or dl, 0x80
mov byte [esi + 1], dl
shr ecx, 6
mov edx, ecx
xor edx, 0x40
or ecx, 0x3f
and ecx, edx
or cl, 0x80
mov byte [esi + 2], cl
and al, 0x3f
or al, 0x80
mov byte [esi + 3], al
add esi, 3
mov eax, 7
add edi, eax
add edi, 3
jmp 0x4068f0
mov byte [esi], 0
sub esi, dword [esp]
lea edi, [esi + 1]
push edi
call dword [0x449008]
add esp, 4
test eax, eax
je case.0x40692f.35
push edi
mov ebx, dword [esp + 4]
push ebx
push eax
mov edi, eax
call fcn.0040ceb0
add esp, 0xc
mov eax, dword [esp + 8]
mov dword [eax], esi
push ebx
call dword [0x449004]
add esp, 4
mov eax, edi
jmp 0x406af0
push dword [esp]
call dword [0x449004]
add esp, 4
xor eax, eax
add esp, 0x18
pop esi
pop edi
pop ebx
pop ebp
ret