Function at 0x665150
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
lea esp, [esp - 0x24]
push ebx
push esi
push edi
mov dword [ebp - 0x1c], edx
mov dword [ebp - 0x20], ecx
mov edx, dword [ebp + 8]
mov dword [ebp - 0x24], edx
mov dword [edx], 0
mov edx, eax
test eax, eax
je 0x66539e
sub edx, 2
jb 0x665402
sub edx, 2
ja 0x665402
sub eax, 3
cmp eax, 2
jae 0x665197
mov edi, 3
jmp 0x66519c
mov edi, 1
mov edx, dword [ebp - 0x20]
mov eax, dword [edx]
mov edx, dword [ebp - 0x20]
mov ecx, dword [edx]
mov edx, dword [ecx]
call dword [edx + 0xbc]
mov edx, dword [ebp - 0x1c]
shl edx, 3
cmp eax, edx
jge 0x665283
mov edx, dword [ebp - 0x20]
mov eax, dword [edx]
mov edx, dword [ebp - 0x20]
mov ecx, dword [edx]
mov edx, dword [ecx]
call dword [edx + 0xbc]
mov edx, dword [ebp - 0x1c]
lea ecx, [edx + edx*2]
cmp eax, ecx
jl 0x665283
mov eax, dword [ebp - 0x20]
mov edx, dword [eax]
mov dword [edx + 0xc0], 6
push 1
mov edx, dword [ebp - 0x20]
mov eax, dword [edx]
mov edx, dword [ebp - 0x20]
mov ecx, dword [edx]
mov edx, dword [ecx]
call dword [edx + 0xbc]
mov dword [ebp - 8], eax
fild dword [ebp - 8]
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 8], eax
fild dword [ebp - 8]
fdivp st(1)
fistp qword [ebp - 0x10]
wait
mov esi, dword [ebp - 0x10]
mov edx, dword [ebp - 0x20]
mov eax, dword [edx]
mov edx, dword [ebp - 0x20]
mov ecx, dword [edx]
mov edx, dword [ecx]
call dword [edx + 0xd4]
mov dword [ebp - 8], eax
fild dword [ebp - 8]
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 8], eax
fild dword [ebp - 8]
fdivp st(1)
mov dword [ebp - 8], edi
fild dword [ebp - 8]
fmulp st(1)
fistp qword [ebp - 0x18]
wait
mov edx, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x20]
mov eax, dword [ecx]
mov ebx, dword [ebp - 0x20]
mov ecx, dword [ebx]
mov ebx, dword [ecx]
mov ecx, esi
call dword [ebx + 0x8b8]
mov dword [ebp - 4], eax
push 1
mov ecx, dword [ebp - 4]
mov eax, 0x74bbd4
mov edx, 1
call fcn.00615120
mov edx, dword [ebp - 0x24]
mov dword [edx], eax
lea eax, [ebp - 4]
call fcn.0044f4d0
jmp 0x6652f8
mov edx, dword [ebp - 0x20]
mov eax, dword [edx]
mov edx, dword [ebp - 0x20]
mov ecx, dword [edx]
mov edx, dword [ecx]
call dword [edx + 0xd4]
mov dword [ebp - 8], eax
fild dword [ebp - 8]
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 8], eax
fild dword [ebp - 8]
fdivp st(1)
mov dword [ebp - 8], edi
fild dword [ebp - 8]
fmulp st(1)
fistp qword [ebp - 0x18]
wait
push dword [ebp - 0x18]
mov edx, dword [ebp - 0x20]
mov eax, dword [edx]
mov edx, dword [ebp - 0x20]
mov ecx, dword [edx]
mov edx, dword [ecx]
call dword [edx + 0xbc]
mov dword [ebp - 8], eax
fild dword [ebp - 8]
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 8], eax
fild dword [ebp - 8]
fdivp st(1)
fistp qword [ebp - 0x10]
wait
push dword [ebp - 0x10]
mov eax, dword [ebp - 0x20]
mov ecx, dword [eax]
mov eax, 0x74bbd4
mov edx, 1
call fcn.00615200
mov edx, dword [ebp - 0x24]
mov dword [edx], eax
mov eax, dword [ebp - 0x20]
call fcn.0044f4d0
mov ebx, 0
mov eax, dword [ebp - 0x24]
mov edx, dword [eax]
mov edi, dword [edx + 0x44]
mov edx, dword [ebp - 0x24]
mov eax, dword [edx]
mov edx, dword [ebp - 0x24]
mov ecx, dword [edx]
mov edx, dword [ecx]
call dword [edx + 0xc8]
sub eax, 1
mov esi, eax
test eax, eax
jl 0x665342
add esi, 1
nop
sub esi, 1
movzx eax, byte [edi]
cmp eax, ebx
jbe 0x66533b
movzx eax, byte [edi]
mov ebx, eax
add edi, 1
test esi, esi
jg 0x66532c
test ebx, ebx
je 0x665402
cmp ebx, 0xff
je 0x665402
mov edx, dword [ebp - 0x24]
mov eax, dword [edx]
mov edi, dword [eax + 0x44]
mov edx, dword [ebp - 0x24]
mov eax, dword [edx]
mov ecx, dword [ebp - 0x24]
mov edx, dword [ecx]
mov edx, dword [edx]
call dword [edx + 0xc8]
sub eax, 1
mov esi, eax
test eax, eax
jl 0x665402
add esi, 1
sub esi, 1
movzx eax, byte [edi]
imul eax, eax, 0xff
mov edx, 0
div ebx
mov byte [edi], al
add edi, 1
test esi, esi
jg 0x665380
jmp 0x665402
push 1
mov eax, dword [ebp - 0x20]
mov ecx, dword [eax]
mov eax, 0x74bbd4
mov edx, 1
call fcn.00615120
mov edx, dword [ebp - 0x24]
mov dword [edx], eax
mov eax, dword [ebp - 0x20]
call fcn.0044f4d0
mov edx, dword [ebp - 0x24]
mov eax, dword [edx]
mov edi, dword [eax + 0x44]
mov edx, dword [ebp - 0x24]
mov eax, dword [edx]
mov edx, dword [ebp - 0x24]
mov ecx, dword [edx]
mov edx, dword [ecx]
call dword [edx + 0xc8]
sub eax, 1
mov esi, eax
test eax, eax
jl 0x665402
add esi, 1
nop
sub esi, 1
movzx eax, byte [edi]
movzx eax, word [eax*2 + 0x778f70]
shr eax, 8
mov byte [edi], al
add edi, 1
test esi, esi
jg 0x6653e8
pop edi
pop esi
pop ebx
leave
ret 4