Function at 0x40c850
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
sub esp, 0x10
lea eax, [esp + 8]
push ebx
mov ebx, ecx
push eax
call fcn.0040c5b0
test eax, eax
jne 0x40c86b
pop ebx
add esp, 0x10
ret 4
mov ecx, dword [esp + 0x18]
push ebp
push esi
mov esi, dword [esp + 0x18]
lea eax, [ecx - 1]
push edi
cmp eax, 0xa
ja case.0x40c88a.6
xor edx, edx
mov dl, byte [eax + 0x40cb54]
jmp dword [edx*4 + 0x40cb3c]
mov eax, dword [ebx + 0xc]
mov dword [esp + 0x10], 0
test eax, eax
jbe 0x40c975
mov eax, dword [ebx + 8]
mov dword [esp + 0x24], 0
test eax, eax
jbe 0x40c956
xor eax, eax
xor ecx, ecx
mov al, byte [esi + 3]
mov cl, byte [esi + 2]
xor edx, edx
mov dword [esp + 0x14], eax
mov dl, byte [esi + 1]
xor eax, eax
mov al, byte [esi]
add ecx, edx
add ecx, eax
mov eax, 0xaaaaaaab
mul ecx
mov ebp, edx
shr ebp, 1
call fcn.004a72d7
cdq
mov ecx, 0x14
idiv ecx
lea edi, [edx + ebp + 0x1e]
test edi, 0xffffff00
je 0x40c8fb
mov edi, 0xff
call fcn.004a72d7
cdq
mov ecx, 0x14
idiv ecx
lea eax, [edx + ebp + 0x14]
test eax, 0xffffff00
je 0x40c918
mov eax, 0xff
mov ecx, dword [esp + 0x14]
and edi, 0xff
shl ecx, 8
or edi, ecx
and eax, 0xff
shl edi, 8
or edi, eax
mov eax, dword [esp + 0x24]
shl edi, 8
and ebp, 0xff
add esi, 4
or edi, ebp
inc eax
mov dword [esi - 4], edi
mov ecx, dword [ebx + 8]
cmp eax, ecx
mov dword [esp + 0x24], eax
jb 0x40c8b7
mov edx, dword [ebx + 0x10]
mov edi, dword [ebx + 8]
mov eax, dword [esp + 0x10]
mov ecx, dword [ebx + 0xc]
sub edx, edi
inc eax
cmp eax, ecx
mov dword [esp + 0x10], eax
lea esi, [esi + edx*4]
jb 0x40c8a4
mov dword [ebx + 0x1c], 1
jmp case.0x40c88a.6
mov eax, dword [ebx + 0xc]
xor ebp, ebp
test eax, eax
jbe 0x40c9e8
mov eax, dword [ebx + 8]
xor edi, edi
test eax, eax
jbe 0x40c9d5
xor eax, eax
xor edx, edx
mov al, byte [esi + 2]
mov dl, byte [esi + 1]
mov ecx, eax
xor eax, eax
mov al, byte [esi]
add ecx, edx
add ecx, eax
mov eax, 0xaaaaaaab
mul ecx
shr edx, 1
xor ecx, ecx
and edx, 0xff
mov ch, byte [esi + 3]
add esi, 4
or ecx, edx
shl ecx, 8
or ecx, edx
shl ecx, 8
or ecx, edx
inc edi
mov dword [esi - 4], ecx
mov eax, dword [ebx + 8]
cmp edi, eax
jb 0x40c993
mov edx, dword [ebx + 0x10]
mov edi, dword [ebx + 8]
mov eax, dword [ebx + 0xc]
sub edx, edi
inc ebp
cmp ebp, eax
lea esi, [esi + edx*4]
jb 0x40c98a
mov dword [ebx + 0x1c], 2
jmp case.0x40c88a.6
mov eax, dword [ebx + 0xc]
xor edi, edi
test eax, eax
jbe 0x40ca65
mov ecx, dword [ebx + 8]
xor eax, eax
test ecx, ecx
jbe 0x40ca52
xor ecx, ecx
xor edx, edx
mov cl, byte [esi + 2]
mov dl, byte [esi + 1]
inc ecx
or ebp, 0xffffffff
neg ecx
shl ecx, 0x10
and ecx, 0xff0000
inc edx
neg edx
shl edx, 8
and edx, 0xff00
add esi, 4
or ecx, edx
mov dl, byte [esi - 4]
sub ebp, edx
xor edx, edx
mov dl, byte [esi - 1]
and ebp, 0xff
or ecx, ebp
shl edx, 0x18
or ecx, edx
inc eax
mov dword [esi - 4], ecx
mov ecx, dword [ebx + 8]
cmp eax, ecx
jb 0x40ca06
mov eax, dword [ebx + 0x10]
mov edx, dword [ebx + 8]
sub eax, edx
inc edi
lea esi, [esi + eax*4]
mov eax, dword [ebx + 0xc]
cmp edi, eax
jb 0x40c9fd
mov dword [ebx + 0x1c], 3
jmp case.0x40c88a.6
mov eax, dword [ebx + 0xc]
xor ebp, ebp
test eax, eax
jbe 0x40cab9
mov eax, dword [ebx + 8]
xor edi, edi
test eax, eax
jbe 0x40caa2
xor ecx, ecx
xor edx, edx
mov ch, byte [esi + 2]
mov dl, byte [esi]
mov cl, byte [esi + 1]
add esi, 4
shl ecx, 8
or ecx, edx
inc edi
mov dword [esi - 4], ecx
mov eax, dword [ebx + 8]
cmp edi, eax
jb 0x40ca83
mov eax, dword [ebx + 0x10]
mov edx, dword [ebx + 8]
shl eax, 1
sub eax, edx
add ebp, 2
lea esi, [esi + eax*4]
mov eax, dword [ebx + 0xc]
cmp ebp, eax
jb 0x40ca7a
mov dword [ebx + 0x1c], 0xa
jmp case.0x40c88a.6
mov eax, dword [ebx + 0xc]
xor edi, edi
test eax, eax
jbe 0x40cb1f
mov ecx, dword [ebx + 8]
xor eax, eax
test ecx, ecx
jbe 0x40cb08
xor ecx, ecx
xor edx, edx
mov cl, byte [esi + 3]
mov dl, byte [esi + 2]
and ecx, 0xfffffffe
add esi, 4
shl ecx, 7
or ecx, edx
xor edx, edx
mov dl, byte [esi - 3]
shl ecx, 8
or ecx, edx
xor edx, edx
mov dl, byte [esi - 4]
shl ecx, 8
or ecx, edx
inc eax
mov dword [esi - 4], ecx
mov ecx, dword [ebx + 8]
cmp eax, ecx
jb 0x40cad4
mov eax, dword [ebx + 0x10]
mov edx, dword [ebx + 8]
shl eax, 1
sub eax, edx
add edi, 2
lea esi, [esi + eax*4]
mov eax, dword [ebx + 0xc]
cmp edi, eax
jb 0x40cacb
mov dword [ebx + 0x1c], 0xb
mov ecx, ebx
call fcn.0040c600
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x10
ret 4