Function at 0x1010ad60
Capabilities:
Encrypt data using rc4 prga

Disassembly:
sub esp, 0x2c
push esi
mov esi, dword [esp + 0x38]
push edi
test esi, esi
jne 0x1010ae21
mov esi, 0xb
mov dword [esp + 0x3c], esi
mov edi, dword [esp + 0x44]
mov ecx, 0x1f
bsr eax, edi
sub ecx, eax
mov eax, 0x1f
sub eax, ecx
lea ecx, [eax + 1]
mov eax, dword [esp + 0x48]
bsr eax, eax
add eax, 2
cmp ecx, eax
cmovb eax, ecx
cmp esi, eax
jb 0x1010afa2
push ebx
xor eax, eax
mov ebx, 0x3e
cmp dword [esp + 0x50], eax
push ebp
sete al
sub ebx, esi
push 0
push edi
push 0x40000000
lea eax, [eax*2 - 1]
mov dword [esp + 0x20], ebx
movzx eax, ax
push 0
mov dword [esp + 0x2c], eax
call fcn.10114000
xor ecx, ecx
mov dword [esp + 0x24], edx
xor edx, edx
mov dword [esp + 0x28], eax
lea eax, [ebx - 0x14]
mov ebp, 1
bts ecx, eax
cmp eax, 0x20
cmovae edx, ecx
xor ecx, edx
cmp eax, 0x40
mov dword [esp + 0x30], ecx
cmovae edx, ecx
mov ecx, esi
mov dword [esp + 0x2c], edx
xor eax, eax
mov edx, edi
shl ebp, cl
shr edx, cl
xor ebx, ebx
mov dword [esp + 0x54], eax
xor esi, esi
mov dword [esp + 0x20], edx
jmp 0x1010ae44
cmp esi, 5
jb 0x1010afa2
cmp esi, 0xc
jbe 0x1010ad7a
pop edi
mov eax, 0xffffffd4
pop esi
add esp, 0x2c
ret 0x18
mov edx, dword [esp + 0x20]
movzx ecx, ax
movzx eax, ax
mov dword [esp + 0x34], eax
mov eax, dword [esp + 0x48]
mov dword [esp + 0x18], ecx
mov dword [esp + 0x38], ebx
mov ecx, dword [eax + esi*4]
cmp ecx, edi
je 0x1010af96
test ecx, ecx
jne 0x1010ae70
xor edi, edi
jmp 0x1010af23
cmp ecx, edx
ja 0x1010ae81
mov ecx, dword [esp + 0x1c]
dec ebp
movzx edi, cx
jmp 0x1010af23
mov eax, dword [esp + 0x24]
mul ecx
mov ebx, eax
mov eax, dword [esp + 0x28]
mul ecx
mov ecx, dword [esp + 0x14]
add ebx, edx
mov dword [esp + 0x10], eax
mov edx, ebx
mov dword [esp + 0x54], ebx
call fcn.10113f90
movzx ebx, ax
cmp bx, 8
jge 0x1010aef4
mov ecx, dword [esp + 0x14]
movsx edi, bx
mov eax, edi
cdq
call fcn.10113f60
sub dword [esp + 0x10], eax
mov ecx, dword [edi*4 + 0x1000f940]
sbb dword [esp + 0x54], edx
mov eax, dword [esp + 0x2c]
mul ecx
mov edi, eax
mov eax, dword [esp + 0x30]
mul ecx
add edi, edx
cmp dword [esp + 0x54], edi
jb 0x1010aef0
ja 0x1010aee9
cmp dword [esp + 0x10], eax
jbe 0x1010aef0
mov eax, 1
jmp 0x1010aef2
xor eax, eax
add ebx, eax
movzx edx, bx
movsx eax, bx
mov ecx, edx
sub ebp, eax
movzx edi, bx
cmp dx, word [esp + 0x34]
mov ebx, esi
mov eax, dword [esp + 0x18]
cmovle ebx, dword [esp + 0x38]
cmp dx, word [esp + 0x18]
movzx eax, ax
cmovle ecx, eax
movzx eax, cx
mov dword [esp + 0x54], eax
mov edx, dword [esp + 0x40]
mov ecx, esi
mov eax, edx
inc esi
mov word [eax + ecx*2], di
mov eax, dword [esp + 0x54]
mov edi, dword [esp + 0x4c]
cmp esi, dword [esp + 0x50]
jbe 0x1010ae40
movzx edi, word [edx + ebx*2]
lea esi, [edx + ebx*2]
movsx ecx, di
mov eax, ebp
sar ecx, 1
neg eax
cmp eax, ecx
jl 0x1010af80
push dword [esp + 0x1c]
mov esi, dword [esp + 0x48]
push dword [esp + 0x54]
push dword [esp + 0x54]
push dword [esp + 0x54]
push esi
push edx
call fcn.1010afc0
cmp eax, 0xffffff88
jbe 0x1010af8a
pop ebp
pop ebx
pop edi
pop esi
add esp, 0x2c
ret 0x18
lea ecx, [edi + ebp]
mov word [esi], cx
mov esi, dword [esp + 0x44]
pop ebp
pop ebx
pop edi
mov eax, esi
pop esi
add esp, 0x2c
ret 0x18
pop ebp
pop ebx
pop edi
xor eax, eax
pop esi
add esp, 0x2c
ret 0x18
pop edi
or eax, 0xffffffff
pop esi
add esp, 0x2c
ret 0x18