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 0x406db4
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 0x406930
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 0x4068db
add ecx, dword [ebp - 0x14]
mov esi, dword [ebp - 0x10]
mov edi, dword [ebp - 0x1c]
mov dword [esi + 0x16bc], ecx
dec eax
je 0x406aba
jmp 0x40688d
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 0x4068c9
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 0x406d55
test dl, dl
je 0x40696f
mov edx, dword [ebp - 0x24]
lea esi, [edx + 1]
mov ebx, eax
cmp edx, dword [ebp + 8]
mov edx, esi
jne 0x406930
jmp 0x406db4
cmp eax, dword [ebp - 0x14]
jge 0x40698f
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]
jmp 0x40688d
mov ecx, dword [ebp - 0x1c]
test ecx, ecx
mov ebx, dword [ebp - 0x10]
jne 0x406a0b
mov ecx, dword [ebx + 0x16bc]
movzx eax, word [ebx + 0x16b8]
mov esi, dword [ebp - 0x18]
cmp esi, 9
jg 0x406aed
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 0x406b9a
add edx, dword [ebp - 0x14]
mov edi, dword [ebp - 0x1c]
mov dword [ebx + 0x16bc], edx
add esi, 0xfffe
cmp edx, 0xe
jge 0x406cfd
mov ecx, edx
shl esi, cl
or eax, esi
mov word [ebx + 0x16b8], ax
add edx, 3
jmp 0x406ab4
cmp ecx, edi
je 0x406dbc
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 0x406ca5
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 0x406bf3
add edx, dword [ebp - 0x18]
mov dword [ebx + 0x16bc], edx
add esi, 0xfffd
cmp edx, 0xf
mov edi, dword [ebp - 0x1c]
jge 0x406d5c
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 0x406adc
xor ecx, ecx
cmp edi, edx
sete cl
mov edx, 4
sub edx, ecx
mov dword [ebp - 0x14], edx
xor ecx, 7
jmp 0x40695b
mov ecx, 0x8a
mov dword [ebp - 0x14], 3
jmp 0x40695b
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 0x406c4c
add edx, dword [ebp - 0x14]
mov edi, dword [ebp - 0x1c]
mov dword [ebx + 0x16bc], edx
add esi, 0xfff6
cmp edx, 0xa
jge 0x406b42
mov ecx, edx
shl esi, cl
or eax, esi
mov word [ebx + 0x16b8], ax
add edx, 7
jmp 0x406ab4
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 0x406ab4
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 0x4069de
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 0x406a8c
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 0x406b19
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 0x406a52
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 0x406ab4
xor edx, edx
jmp 0x406957
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 0x406ab4
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 0x406a5d