Function at 0x100105bf
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x64
mov eax, dword [0x10013084]
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 0x100105f9
push 5
pop ecx
mov eax, ecx
sub eax, 1
mov dword [esp + eax*4 + 0x30], 0
jne 0x1001061c
and dword [esp + 0x10], 0
mov edx, dword [ebx + 4]
mov dword [esp + 0x1c], edx
test esi, esi
jle 0x100106f5
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 + 0x100016cc]
add ecx, dword [eax*4 + 0x100016cc]
mov eax, edi
sub edi, dword [esp + 0x28]
sub eax, ebx
add ecx, dword [eax*4 + 0x100016cc]
add ecx, dword [edi*4 + 0x100016cc]
test ecx, 0xe000
je 0x10010695
mov al, 4
jmp 0x100106b3
test ecx, 0x1c00
je 0x100106a1
mov al, 3
jmp 0x100106b3
test ecx, 0x380
je 0x100106ad
mov al, 2
jmp 0x100106b3
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 0x100106d8
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 0x1001063d
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 0x10010710
xor eax, eax
cmp dword [edx], 1
setg al
inc eax
add esi, eax
test cl, cl
jne 0x100106fb
mov ecx, dword [esp + 0x20]
cmp ecx, esi
jge 0x1001071e
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 0x10010820
test ecx, ecx
je 0x10010820
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 0x10010787
dec dword [esp + 0x18]
mov byte [ecx], dh
add ecx, 8
cmp dword [esp + 0x18], 0
jne 0x1001077c
cmp eax, 1
jle 0x100107f1
mov ecx, dword [esp + 0x20]
cmp ecx, 1
jle 0x100107f1
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.100117fd
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 0x100107fa
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 0x10010732
mov ecx, dword [esp + 0x2c]
mov edx, ebx
push 0
push 0xff
call fcn.10004012
add dword [ebx + 0x14], eax
mov ecx, dword [esp + 0x6c]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.10012780
mov esp, ebp
pop ebp
ret 4