Function at 0x40cff2af
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x64
push ebx
push esi
push edi
mov edi, dword [ebp + 0x10]
movsx eax, word [edi + 8]
mov edx, dword [edi + 0xc]
mov dword [ebp - 0x10], eax
mov eax, dword [edi]
xor ecx, ecx
mov dword [ebp - 0x1c], edx
add eax, 7
lea esi, [eax + 0x1c5]
mov byte [eax - 1], cl
mov byte [eax], 1
mov dword [eax + 1], esi
inc ecx
add eax, 0x1cc
cmp ecx, 0x100
jl 0x40cff2d1
push 5
pop eax
dec eax
mov dword [ebp + eax*4 - 0x3c], 0
jne 0x40cff2f1
and dword [ebp - 0xc], 0
mov esi, dword [edi + 4]
test edx, edx
jle 0x40cff38e
movzx edx, byte [esi + 1]
movzx edi, byte [esi]
movzx eax, byte [esi + 2]
movzx ecx, byte [esi + 3]
lea ebx, [edi + edx]
add ebx, eax
lea eax, [ebx + ecx + 2]
sar eax, 2
mov ebx, eax
sub ebx, edi
mov ebx, dword [ebx*4 + 0x40d02484]
mov edi, eax
sub edi, edx
add ebx, dword [edi*4 + 0x40d02484]
movzx edx, byte [esi + 2]
mov edi, eax
sub edi, edx
add ebx, dword [edi*4 + 0x40d02484]
sub eax, ecx
add ebx, dword [eax*4 + 0x40d02484]
push ebx
call fcn.40cff278
movzx ecx, al
shl ecx, 2
mov byte [esi + 7], al
lea eax, [ebp + ecx - 0x3c]
mov edx, dword [eax]
lea edi, [edx + 1]
mov dword [eax], edi
test edx, edx
jne 0x40cff37d
mov eax, dword [ebp - 0xc]
mov dword [ebp + ecx - 0x64], eax
mov dword [ebp + ecx - 0x50], esi
inc dword [ebp - 0xc]
mov eax, dword [ebp - 0xc]
add esi, 8
cmp eax, dword [ebp - 0x1c]
jl 0x40cff30b
mov edi, dword [ebp + 0x10]
and dword [ebp - 8], 0
mov dl, 5
lea eax, [ebp - 0x28]
sub eax, 4
mov ecx, dword [eax]
dec dl
test ecx, ecx
je 0x40cff3b4
xor ebx, ebx
cmp ecx, 1
mov ecx, dword [ebp - 8]
setg bl
lea ecx, [ecx + ebx + 1]
mov dword [ebp - 8], ecx
test dl, dl
jne 0x40cff397
mov eax, dword [ebp - 0x10]
cmp eax, dword [ebp - 8]
jge 0x40cff3c3
mov dword [ebp - 8], eax
mov ebx, dword [edi]
xor ecx, ecx
mov byte [ebp - 0x14], 0
mov byte [ebp - 1], 0
mov dword [ebp - 0x20], ecx
mov eax, dword [ebp + ecx - 0x3c]
test eax, eax
je 0x40cff49f
cmp dword [ebp - 0x10], 0
je 0x40cff49f
mov edx, dword [ebp + ecx - 0x50]
mov esi, edx
mov edi, ebx
movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
or dword [ebx + 0x28], 0xffffffff
mov edi, dword [ebp + ecx - 0x3c]
xor esi, esi
inc esi
add edx, 6
mov dword [ebx + 0xc], eax
mov byte [ebx + 7], 6
mov eax, esi
mov dword [ebp - 0xc], edi
mov dword [ebp - 0x18], edx
mov edx, dword [ebp - 0x18]
mov dword [ebp - 0x24], eax
mov al, byte [ebp - 0x14]
cmp byte [edx + 1], al
mov eax, dword [ebp - 0x24]
jne 0x40cff42c
mov dl, byte [ebp - 1]
mov edi, dword [ebp - 0x18]
dec dword [ebp - 0xc]
mov byte [edi], dl
add dword [ebp - 0x18], 8
cmp dword [ebp - 0xc], 0
jne 0x40cff410
mov edx, dword [ebp + ecx - 0x3c]
cmp edx, esi
jle 0x40cff480
cmp dword [ebp - 0x10], esi
jle 0x40cff480
mov eax, dword [ebx + 8]
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x10]
sub eax, dword [ebp - 8]
push esi
imul eax, edx
cdq
idiv dword [ebp - 0x1c]
inc eax
push eax
lea eax, [ebp - 0x28]
push eax
push dword [ebp - 0x14]
movzx ax, byte [ebp - 1]
push dword [ebp + ecx - 0x64]
movzx eax, ax
push eax
push dword [ebp + 0x10]
call fcn.40d0068a
mov ecx, dword [ebp - 0x20]
cwde
inc eax
sub dword [ebp - 8], 2
jmp 0x40cff487
and dword [ebx + 0x28], 0
dec dword [ebp - 8]
sub dword [ebp - 0x10], eax
add byte [ebp - 1], al
imul eax, eax, 0x1cc
mov edx, dword [ebp + ecx - 0x3c]
sub dword [ebp - 0x1c], edx
mov edi, dword [ebp + 0x10]
add ebx, eax
inc byte [ebp - 0x14]
add ecx, 4
cmp byte [ebp - 0x14], 5
mov dword [ebp - 0x20], ecx
jb 0x40cff3d2
push 0
push 0xff
push edi
push dword [ebp + 8]
call fcn.40cf2b54
add dword [edi + 0x14], eax
pop edi
pop esi
pop ebx
leave
ret 0xc