Function at 0x406840
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x20
mov dword [ebp - 0x2c], edx
mov dword [ebp - 0x10], ecx
cmp dword [ebp + 8], 0
js 0x406db0
mov eax, dword [ebp - 0x2c]
movzx ecx, word [eax + 2]
xor eax, eax
mov dword [ebp - 0x28], ecx
test ecx, ecx
sete al
mov edx, 0x8a
mov ecx, 7
cmove ecx, edx
mov edx, 4
sub edx, eax
mov dword [ebp - 0x14], edx
xor edi, edi
dec edi
xor edx, edx
xor ebx, ebx
jmp 0x4068b3
mov ecx, 0x8a
mov dword [ebp - 0x14], 3
nop word cs:[eax + eax]
mov edx, dword [ebp - 0x24]
lea esi, [edx + 1]
mov ebx, eax
cmp edx, dword [ebp + 8]
mov edx, esi
je 0x406db0
mov esi, dword [ebp - 0x28]
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x24], edx
movzx edx, word [eax + edx*4 + 6]
mov dword [ebp - 0x18], ebx
lea eax, [ebx + 1]
mov dword [ebp - 0x28], edx
mov dword [ebp - 0x1c], esi
cmp esi, edx
sete dl
cmp eax, ecx
jge 0x406d51
test dl, dl
jne 0x4068a0
cmp eax, dword [ebp - 0x14]
jge 0x406998
mov esi, dword [ebp - 0x10]
mov ecx, dword [esi + 0x16bc]
movzx edx, word [esi + 0x16b8]
mov dword [ebp - 0x18], edx
mov edi, dword [ebp - 0x1c]
movzx edx, word [esi + edi*4 + 0xa7e]
mov ebx, edi
mov edi, esi
movzx esi, word [esi + ebx*4 + 0xa7c]
mov dword [ebp - 0x20], esi
shl esi, cl
mov ebx, dword [ebp - 0x18]
or ebx, esi
mov esi, 0x10
mov dword [ebp - 0x14], edx
sub esi, edx
mov dword [ebp - 0x18], ebx
mov word [edi + 0x16b8], bx
cmp ecx, esi
jg 0x40694b
add ecx, dword [ebp - 0x14]
mov esi, dword [ebp - 0x10]
mov dword [esi + 0x16bc], ecx
dec eax
mov edi, dword [ebp - 0x1c]
je 0x406ac6
jmp 0x4068fd
mov esi, dword [ebp - 0x10]
mov edx, dword [esi + 8]
mov edi, dword [esi + 0x14]
lea ecx, [edi + 1]
mov dword [esi + 0x14], ecx
mov ecx, dword [ebp - 0x18]
mov byte [edx + edi], cl
mov bl, byte [esi + 0x16b9]
mov edx, dword [esi + 8]
mov edi, dword [esi + 0x14]
lea ecx, [edi + 1]
mov dword [esi + 0x14], ecx
mov byte [edx + edi], bl
mov edx, dword [esi + 0x16bc]
mov cl, 0x10
sub cl, dl
mov ebx, dword [ebp - 0x20]
shr ebx, cl
mov ecx, dword [ebp - 0x14]
add ecx, edx
add ecx, 0xfffffff0
mov word [esi + 0x16b8], bx
mov dword [ebp - 0x18], ebx
jmp 0x406936
mov ecx, dword [ebp - 0x1c]
test ecx, ecx
jne 0x406a14
mov ebx, dword [ebp - 0x10]
mov ecx, dword [ebx + 0x16bc]
movzx eax, word [ebx + 0x16b8]
mov esi, dword [ebp - 0x18]
cmp esi, 9
jg 0x406aec
movzx edi, word [ebx + 0xac2]
movzx edx, word [ebx + 0xac0]
mov dword [ebp - 0x20], edx
shl edx, cl
or eax, edx
mov edx, ecx
mov ecx, 0x10
mov dword [ebp - 0x14], edi
sub ecx, edi
cmp edx, ecx
jg 0x406b96
add edx, dword [ebp - 0x14]
mov edi, dword [ebp - 0x1c]
mov dword [ebx + 0x16bc], edx
add esi, 0xfffe
cmp edx, 0xe
jge 0x406cf9
mov ecx, edx
shl esi, cl
or eax, esi
mov word [ebx + 0x16b8], ax
add edx, 3
jmp 0x406ac0
cmp ecx, edi
mov ebx, dword [ebp - 0x10]
je 0x406db8
movzx esi, word [ebx + ecx*4 + 0xa7e]
mov eax, dword [ebx + 0x16bc]
mov edx, 0x10
sub edx, esi
movzx edi, word [ebx + ecx*4 + 0xa7c]
mov dword [ebp - 0x20], edi
mov ecx, eax
shl edi, cl
or di, word [ebx + 0x16b8]
mov dword [ebp - 0x14], edi
mov word [ebx + 0x16b8], di
cmp eax, edx
jg 0x406ca1
add eax, esi
mov esi, dword [ebp - 0x18]
mov ecx, eax
mov dword [ebx + 0x16bc], eax
movzx edi, word [ebx + 0xabe]
movzx edx, word [ebx + 0xabc]
mov dword [ebp - 0x20], edx
shl edx, cl
mov eax, dword [ebp - 0x14]
or eax, edx
mov edx, ecx
mov ecx, 0x10
mov dword [ebp - 0x18], edi
sub ecx, edi
cmp edx, ecx
jg 0x406bef
add edx, dword [ebp - 0x18]
mov edi, dword [ebp - 0x1c]
mov dword [ebx + 0x16bc], edx
add esi, 0xfffd
cmp edx, 0xf
jge 0x406d58
mov ecx, edx
shl esi, cl
or eax, esi
mov word [ebx + 0x16b8], ax
add edx, 2
mov dword [ebx + 0x16bc], edx
xor eax, eax
mov edx, dword [ebp - 0x28]
test edx, edx
je 0x40688a
xor ecx, ecx
cmp edi, edx
sete cl
mov edx, 4
sub edx, ecx
mov dword [ebp - 0x14], edx
xor ecx, 7
jmp 0x4068a0
movzx edi, word [ebx + 0xac6]
movzx edx, word [ebx + 0xac4]
mov dword [ebp - 0x20], edx
shl edx, cl
or eax, edx
mov edx, ecx
mov ecx, 0x10
mov dword [ebp - 0x14], edi
sub ecx, edi
cmp edx, ecx
jg 0x406c48
add edx, dword [ebp - 0x14]
mov edi, dword [ebp - 0x1c]
mov dword [ebx + 0x16bc], edx
add esi, 0xfff6
cmp edx, 0xa
jge 0x406b3e
mov ecx, edx
shl esi, cl
or eax, esi
mov word [ebx + 0x16b8], ax
add edx, 7
jmp 0x406ac0
movzx ecx, si
mov dword [ebp - 0x18], ecx
mov ecx, edx
shl esi, cl
or eax, esi
mov word [ebx + 0x16b8], ax
mov ecx, dword [ebx + 8]
mov edx, dword [ebx + 0x14]
lea esi, [edx + 1]
mov dword [ebx + 0x14], esi
mov byte [ecx + edx], al
mov cl, byte [ebx + 0x16b9]
mov edx, dword [ebx + 8]
mov esi, dword [ebx + 0x14]
lea edi, [esi + 1]
mov dword [ebx + 0x14], edi
mov edi, dword [ebp - 0x1c]
mov byte [edx + esi], cl
mov edx, dword [ebx + 0x16bc]
mov cl, 0x10
sub cl, dl
mov eax, dword [ebp - 0x18]
shr eax, cl
mov word [ebx + 0x16b8], ax
add edx, 0xfffffff7
jmp 0x406ac0
mov word [ebx + 0x16b8], ax
mov edi, dword [ebx + 8]
mov edx, dword [ebx + 0x14]
lea ebx, [edx + 1]
mov ecx, dword [ebp - 0x10]
mov dword [ecx + 0x14], ebx
mov byte [edi + edx], al
mov ecx, dword [ebp - 0x10]
mov al, byte [ecx + 0x16b9]
mov ecx, dword [ebp - 0x10]
mov edi, dword [ecx + 8]
mov ecx, dword [ebp - 0x10]
mov ebx, dword [ecx + 0x14]
lea ecx, [ebx + 1]
mov edx, dword [ebp - 0x10]
mov dword [edx + 0x14], ecx
mov byte [edi + ebx], al
mov ebx, dword [ebp - 0x10]
mov edx, dword [ebx + 0x16bc]
mov cl, 0x10
sub cl, dl
mov eax, dword [ebp - 0x14]
add edx, eax
add edx, 0xfffffff0
mov eax, dword [ebp - 0x20]
shr eax, cl
jmp 0x4069e7
mov word [ebx + 0x16b8], ax
mov edi, dword [ebx + 8]
mov edx, dword [ebx + 0x14]
lea ebx, [edx + 1]
mov ecx, dword [ebp - 0x10]
mov dword [ecx + 0x14], ebx
mov byte [edi + edx], al
mov ecx, dword [ebp - 0x10]
mov al, byte [ecx + 0x16b9]
mov ecx, dword [ebp - 0x10]
mov edi, dword [ecx + 8]
mov ecx, dword [ebp - 0x10]
mov ebx, dword [ecx + 0x14]
lea ecx, [ebx + 1]
mov edx, dword [ebp - 0x10]
mov dword [edx + 0x14], ecx
mov byte [edi + ebx], al
mov ebx, dword [ebp - 0x10]
mov edx, dword [ebx + 0x16bc]
mov cl, 0x10
sub cl, dl
mov eax, dword [ebp - 0x18]
add edx, eax
add edx, 0xfffffff0
mov eax, dword [ebp - 0x20]
shr eax, cl
jmp 0x406a98
mov word [ebx + 0x16b8], ax
mov edi, dword [ebx + 8]
mov edx, dword [ebx + 0x14]
lea ebx, [edx + 1]
mov ecx, dword [ebp - 0x10]
mov dword [ecx + 0x14], ebx
mov byte [edi + edx], al
mov ecx, dword [ebp - 0x10]
mov al, byte [ecx + 0x16b9]
mov ecx, dword [ebp - 0x10]
mov edi, dword [ecx + 8]
mov ecx, dword [ebp - 0x10]
mov ebx, dword [ecx + 0x14]
lea ecx, [ebx + 1]
mov edx, dword [ebp - 0x10]
mov dword [edx + 0x14], ecx
mov byte [edi + ebx], al
mov ebx, dword [ebp - 0x10]
mov edx, dword [ebx + 0x16bc]
mov cl, 0x10
sub cl, dl
mov eax, dword [ebp - 0x14]
add edx, eax
add edx, 0xfffffff0
mov eax, dword [ebp - 0x20]
shr eax, cl
jmp 0x406b18
mov edi, dword [ebx + 8]
mov edx, dword [ebx + 0x14]
lea ebx, [edx + 1]
mov ecx, dword [ebp - 0x10]
mov dword [ecx + 0x14], ebx
mov eax, dword [ebp - 0x14]
mov byte [edi + edx], al
mov ecx, dword [ebp - 0x10]
mov al, byte [ecx + 0x16b9]
mov ecx, dword [ebp - 0x10]
mov edi, dword [ecx + 8]
mov ecx, dword [ebp - 0x10]
mov ebx, dword [ecx + 0x14]
lea ecx, [ebx + 1]
mov edx, dword [ebp - 0x10]
mov dword [edx + 0x14], ecx
mov byte [edi + ebx], al
mov ebx, dword [ebp - 0x10]
mov edx, dword [ebx + 0x16bc]
mov cl, 0x10
sub cl, dl
lea eax, [esi + edx]
add eax, 0xfffffff0
mov edx, dword [ebp - 0x20]
shr edx, cl
mov ecx, edx
mov dword [ebp - 0x14], ecx
jmp 0x406a5e
movzx ecx, si
mov dword [ebp - 0x18], ecx
mov ecx, edx
shl esi, cl
or eax, esi
mov word [ebx + 0x16b8], ax
mov ecx, dword [ebx + 8]
mov edx, dword [ebx + 0x14]
lea esi, [edx + 1]
mov dword [ebx + 0x14], esi
mov byte [ecx + edx], al
mov cl, byte [ebx + 0x16b9]
mov edx, dword [ebx + 8]
mov esi, dword [ebx + 0x14]
lea edi, [esi + 1]
mov dword [ebx + 0x14], edi
mov edi, dword [ebp - 0x1c]
mov byte [edx + esi], cl
mov edx, dword [ebx + 0x16bc]
mov cl, 0x10
sub cl, dl
mov eax, dword [ebp - 0x18]
shr eax, cl
mov word [ebx + 0x16b8], ax
add edx, 0xfffffff3
jmp 0x406ac0
xor edx, edx
jmp 0x4068da
movzx ecx, si
mov dword [ebp - 0x18], ecx
mov ecx, edx
shl esi, cl
or eax, esi
mov word [ebx + 0x16b8], ax
mov ecx, dword [ebx + 8]
mov edx, dword [ebx + 0x14]
lea esi, [edx + 1]
mov dword [ebx + 0x14], esi
mov byte [ecx + edx], al
mov cl, byte [ebx + 0x16b9]
mov edx, dword [ebx + 8]
mov esi, dword [ebx + 0x14]
lea edi, [esi + 1]
mov dword [ebx + 0x14], edi
mov edi, dword [ebp - 0x1c]
mov byte [edx + esi], cl
mov edx, dword [ebx + 0x16bc]
mov cl, 0x10
sub cl, dl
mov eax, dword [ebp - 0x18]
shr eax, cl
mov word [ebx + 0x16b8], ax
add edx, 0xfffffff2
jmp 0x406ac0
add esp, 0x20
pop esi
pop edi
pop ebx
pop ebp
ret
mov ecx, dword [ebx + 0x16bc]
movzx edx, word [ebx + 0x16b8]
mov dword [ebp - 0x14], edx
mov esi, eax
jmp 0x406a69