Function at 0x10010779
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 0x100107b3
push 5
pop ecx
mov eax, ecx
sub eax, 1
mov dword [esp + eax*4 + 0x30], 0
jne 0x100107d6
and dword [esp + 0x10], 0
mov edx, dword [ebx + 4]
mov dword [esp + 0x1c], edx
test esi, esi
jle 0x100108af
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 0x1001084f
mov al, 4
jmp 0x1001086d
test ecx, 0x1c00
je 0x1001085b
mov al, 3
jmp 0x1001086d
test ecx, 0x380
je 0x10010867
mov al, 2
jmp 0x1001086d
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 0x10010892
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 0x100107f7
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 0x100108ca
xor eax, eax
cmp dword [edx], 1
setg al
inc eax
add esi, eax
test cl, cl
jne 0x100108b5
mov ecx, dword [esp + 0x20]
cmp ecx, esi
jge 0x100108d8
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 0x100109da
test ecx, ecx
je 0x100109da
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 0x10010941
dec dword [esp + 0x18]
mov byte [ecx], dh
add ecx, 8
cmp dword [esp + 0x18], 0
jne 0x10010936
cmp eax, 1
jle 0x100109ab
mov ecx, dword [esp + 0x20]
cmp ecx, 1
jle 0x100109ab
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.1001cf6f
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 0x100109b4
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 0x100108ec
mov ecx, dword [esp + 0x2c]
mov edx, ebx
push 0
push 0xff
call fcn.10003ff5
add dword [ebx + 0x14], eax
mov ecx, dword [esp + 0x6c]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.100129d0
mov esp, ebp
pop ebp
ret 4