Function at 0x646dec
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffff8
push ebx
push esi
push edi
mov dword [ebp - 4], ecx
mov esi, edx
mov ebx, eax
cmp byte [0x770e8c], 0
je 0x646f75
call fcn.00646bb8
test al, al
je 0x646f75
mov eax, dword [ebp - 4]
shl eax, 3
call fcn.0040279c
mov dword [ebp - 8], eax
mov eax, dword [ebp - 8]
mov ecx, dword [ebp - 4]
test ecx, ecx
jle 0x646e91
xor edx, edx
mov dl, byte [ebx]
mov di, 0xff
sub di, dx
mov edx, edi
shl edx, 8
add edx, edi
mov word [eax], dx
xor edx, edx
mov dl, byte [ebx + 1]
mov di, 0xff
sub di, dx
mov edx, edi
shl edx, 8
add edx, edi
mov word [eax + 2], dx
xor edx, edx
mov dl, byte [ebx + 2]
mov di, 0xff
sub di, dx
mov edx, edi
shl edx, 8
add edx, edi
mov word [eax + 4], dx
xor edx, edx
mov dl, byte [ebx + 3]
mov di, 0xff
sub di, dx
mov edx, edi
shl edx, 8
add edx, edi
mov word [eax + 6], dx
add eax, 8
add ebx, 4
dec ecx
jne 0x646e2e
mov eax, dword [ebp - 4]
shl eax, 3
call fcn.0040279c
mov edi, eax
mov ebx, edi
mov eax, dword [0x767d18]
mov eax, dword [eax + 4]
push eax
push edi
mov eax, dword [0x767d18]
mov eax, dword [eax + 8]
push eax
mov eax, dword [ebp - 4]
push eax
mov eax, dword [ebp - 8]
push eax
mov eax, dword [0x7710b8]
mov eax, dword [eax + 0x38]
push eax
mov eax, dword [0x767904]
mov eax, dword [eax]
call eax
cmp dword [ebp + 0xc], 0
jne 0x646f05
mov ecx, dword [ebp - 4]
test ecx, ecx
jle 0x646f61
movzx eax, word [ebx]
shr eax, 8
mov byte [esi + 2], al
movzx eax, word [ebx + 2]
shr eax, 8
mov byte [esi + 1], al
movzx eax, word [ebx + 4]
shr eax, 8
mov byte [esi], al
add ebx, 8
add esi, 3
dec ecx
jne 0x646ede
jmp 0x646f61
mov ecx, dword [ebp - 4]
test ecx, ecx
jle 0x646f61
movzx eax, word [ebx]
shr eax, 8
xor edx, edx
mov dl, byte [esi + 2]
sub eax, edx
mov edx, dword [ebp + 0xc]
imul dword [edx]
shr eax, 0x12
add byte [esi + 2], al
movzx eax, word [ebx + 2]
shr eax, 8
xor edx, edx
mov dl, byte [esi + 1]
sub eax, edx
mov edx, dword [ebp + 0xc]
imul dword [edx]
shr eax, 0x12
add byte [esi + 1], al
movzx eax, word [ebx + 4]
shr eax, 8
xor edx, edx
mov dl, byte [esi]
sub eax, edx
mov edx, dword [ebp + 0xc]
imul dword [edx]
shr eax, 0x12
add byte [esi], al
add ebx, 8
add esi, 3
add dword [ebp + 0xc], 4
dec ecx
jne 0x646f0c
mov eax, edi
call fcn.004027b4
mov eax, dword [ebp - 8]
call fcn.004027b4
jmp 0x647060
cmp dword [ebp + 0xc], 0
jne 0x646fda
mov ecx, dword [ebp - 4]
test ecx, ecx
jle 0x647060
xor eax, eax
mov al, byte [ebx + 3]
xor edx, edx
mov dl, byte [ebx]
imul edx
mov edi, 0xff
xor edx, edx
div edi
mov byte [esi + 2], al
xor eax, eax
mov al, byte [ebx + 3]
xor edx, edx
mov dl, byte [ebx + 1]
imul edx
mov edi, 0xff
xor edx, edx
div edi
mov byte [esi + 1], al
xor eax, eax
mov al, byte [ebx + 3]
xor edx, edx
mov dl, byte [ebx + 2]
imul edx
mov edi, 0xff
xor edx, edx
div edi
mov byte [esi], al
add ebx, 4
add esi, 3
dec ecx
jne 0x646f86
jmp 0x647060
mov ecx, dword [ebp - 4]
test ecx, ecx
jle 0x647060
xor eax, eax
mov al, byte [ebx + 3]
xor edx, edx
mov dl, byte [ebx]
imul edx
mov edi, 0xff
xor edx, edx
div edi
xor edx, edx
mov dl, byte [esi + 2]
sub eax, edx
mov edx, dword [ebp + 0xc]
imul dword [edx]
shr eax, 0x12
add byte [esi + 2], al
xor eax, eax
mov al, byte [ebx + 3]
xor edx, edx
mov dl, byte [ebx + 1]
imul edx
mov edi, 0xff
xor edx, edx
div edi
xor edx, edx
mov dl, byte [esi + 1]
sub eax, edx
mov edx, dword [ebp + 0xc]
imul dword [edx]
shr eax, 0x12
add byte [esi + 1], al
xor eax, eax
mov al, byte [ebx + 3]
xor edx, edx
mov dl, byte [ebx + 2]
imul edx
mov edi, 0xff
xor edx, edx
div edi
xor edx, edx
mov dl, byte [esi]
sub eax, edx
mov edx, dword [ebp + 0xc]
imul dword [edx]
shr eax, 0x12
add byte [esi], al
add ebx, 4
add esi, 3
add dword [ebp + 0xc], 4
dec ecx
jne 0x646fe1
pop edi
pop esi
pop ebx
pop ecx
pop ecx
pop ebp
ret 8