Function at 0x10010a81
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x64
mov eax, dword [0x10014084]
xor eax, esp
mov dword [esp + 0x60], eax
push ebx
mov ebx, dword [ebp + 8]
xor edx, edx
mov dword [esp + 0x24], ecx
push esi
push edi
movsx ecx, word [ebx + 8]
mov esi, dword [ebx + 0xc]
mov dword [esp + 0x20], ecx
mov ecx, dword [ebx]
mov dword [esp + 0x14], ebx
add ecx, 7
mov dword [esp + 0x24], esi
mov byte [ecx - 1], dl
lea eax, [ecx + 0x1c5]
inc edx
mov byte [ecx], 1
mov dword [ecx + 1], eax
lea ecx, [ecx + 0x1cc]
cmp edx, 0x100
jl 0x10010abb
push 5
pop ecx
mov eax, ecx
sub eax, 1
mov dword [esp + eax*4 + 0x30], 0
jne 0x10010ade
and dword [esp + 0x10], 0
mov edx, dword [ebx + 4]
mov dword [esp + 0x1c], edx
test esi, esi
jle 0x10010bb7
movzx ecx, byte [edx + 3]
movzx ebx, byte [edx + 2]
movzx esi, byte [edx + 1]
movzx edx, byte [edx]
lea edi, [ecx + 2]
mov dword [esp + 0x28], ecx
lea eax, [edx + esi]
add eax, ebx
add edi, eax
shr edi, 2
mov ecx, edi
mov eax, edi
sub ecx, edx
sub eax, esi
mov ecx, dword [ecx*4 + 0x100016dc]
add ecx, dword [eax*4 + 0x100016dc]
mov eax, edi
sub edi, dword [esp + 0x28]
sub eax, ebx
add ecx, dword [eax*4 + 0x100016dc]
add ecx, dword [edi*4 + 0x100016dc]
test ecx, 0xe000
je 0x10010b57
mov al, 4
jmp 0x10010b75
test ecx, 0x1c00
je 0x10010b63
mov al, 3
jmp 0x10010b75
test ecx, 0x380
je 0x10010b6f
mov al, 2
jmp 0x10010b75
test cl, 0x70
setne al
mov edx, dword [esp + 0x1c]
movzx esi, al
mov byte [edx + 7], al
mov ecx, dword [esp + esi*4 + 0x30]
lea eax, [ecx + 1]
mov dword [esp + esi*4 + 0x30], eax
mov eax, dword [esp + 0x10]
test ecx, ecx
jne 0x10010b9a
mov dword [esp + esi*4 + 0x58], eax
mov dword [esp + esi*4 + 0x44], edx
inc eax
add edx, 8
mov dword [esp + 0x10], eax
mov dword [esp + 0x1c], edx
cmp eax, dword [esp + 0x24]
jl 0x10010aff
mov ebx, dword [esp + 0x14]
push 5
pop ecx
xor esi, esi
lea edx, [esp + 0x44]
sub edx, 4
dec cl
cmp dword [edx], 0
je 0x10010bd2
xor eax, eax
cmp dword [edx], 1
setg al
inc eax
add esi, eax
test cl, cl
jne 0x10010bbd
mov ecx, dword [esp + 0x20]
cmp ecx, esi
jge 0x10010be0
mov esi, ecx
mov edi, dword [ebx]
xor dl, dl
xor dh, dh
mov byte [esp + 0x1c], dl
xor eax, eax
mov byte [esp + 0xf], dh
mov dword [esp + 0x10], eax
mov eax, dword [esp + eax + 0x30]
mov dword [esp + 0x28], eax
test eax, eax
je 0x10010ce2
test ecx, ecx
je 0x10010ce2
mov ecx, dword [esp + 0x10]
mov dword [esp + 0x14], 1
mov ecx, dword [esp + ecx + 0x44]
mov eax, dword [ecx]
mov dword [edi], eax
mov ax, word [ecx + 4]
or dword [edi + 0x28], 0xffffffff
add ecx, 6
mov word [edi + 4], ax
mov eax, dword [esp + 0x28]
mov dword [edi + 0xc], eax
mov byte [edi + 7], 6
mov dword [esp + 0x18], eax
cmp byte [ecx + 1], dl
jne 0x10010c49
dec dword [esp + 0x18]
mov byte [ecx], dh
add ecx, 8
cmp dword [esp + 0x18], 0
jne 0x10010c3e
cmp eax, 1
jle 0x10010cb3
mov ecx, dword [esp + 0x20]
cmp ecx, 1
jle 0x10010cb3
mov eax, dword [edi + 8]
mov dword [esp + 0x14], eax
mov eax, ecx
mov ecx, dword [esp + 0x10]
sub eax, esi
push 1
imul eax, dword [esp + ecx + 0x34]
cdq
idiv dword [esp + 0x28]
movzx edx, byte [esp + 0x13]
inc eax
push eax
lea eax, [esp + 0x1c]
push eax
push dword [esp + 0x28]
push dword [esp + ecx + 0x68]
mov ecx, ebx
call fcn.10011d44
mov dl, byte [esp + 0x1c]
mov dh, byte [esp + 0xf]
cwde
inc eax
mov dword [esp + 0x18], 0xfffffffe
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x28]
jmp 0x10010cbc
and dword [edi + 0x28], 0
or dword [esp + 0x18], 0xffffffff
sub dword [esp + 0x24], eax
mov eax, dword [esp + 0x14]
add dh, al
mov ecx, dword [esp + 0x20]
sub ecx, dword [esp + 0x14]
imul eax, eax, 0x1cc
mov dword [esp + 0x20], ecx
mov byte [esp + 0xf], dh
add edi, eax
add esi, dword [esp + 0x18]
mov eax, dword [esp + 0x10]
inc dl
add eax, 4
mov byte [esp + 0x1c], dl
mov dword [esp + 0x10], eax
cmp dl, 5
jb 0x10010bf4
mov ecx, dword [esp + 0x2c]
mov edx, ebx
push 0
push 0xff
call fcn.100040ae
add dword [ebx + 0x14], eax
mov ecx, dword [esp + 0x6c]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.10012d10
mov esp, ebp
pop ebp
ret 4