Function at 0x100ff660
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
sub esp, 0x810
mov al, byte [0x1018ccc3]
push ebx
push ebp
push esi
mov dword [esp + 0x10], ecx
push edi
mov byte [esp + 0x1c], al
mov edi, 0x10191588
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
mov ebp, dword [esp + 0x828]
push 1
not ecx
dec ecx
mov ebx, ecx
mov ecx, ebp
push ebx
call fcn.1000be20
test al, al
je 0x100ff6bf
mov edi, dword [ebp + 4]
mov ecx, ebx
mov edx, ecx
mov esi, 0x10191588
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [ebp + 4]
mov dword [ebp + 8], ebx
mov byte [eax + ebx], 0
mov eax, 0x1cc
mov ecx, dword [0x1018ccb4]
cdq
idiv dword [0x1018ccb8]
mov eax, dword [esp + 0x824]
mov dl, byte [edx + ecx]
mov byte [0x1018ccc2], dl
mov eax, dword [eax + 8]
cmp dword [ebp + 0xc], eax
jae 0x100ff6f3
push 0
push eax
mov ecx, ebp
call fcn.1000be20
mov al, byte [esp + 0x1c]
xor esi, esi
dec al
mov ecx, dword [0x1018ccb4]
mov byte [0x1018ccc1], al
mov al, byte [0x1018ccbf]
dec al
mov byte [0x1018ccbe], 0x80
mov byte [0x1018ccbf], al
mov eax, 0x5d
cdq
idiv dword [0x1018ccb8]
lea ebp, [edx + ecx]
mov cl, byte [0x1018ccc0]
mov ebx, dword [esp + 0x14]
mov edi, dword [ebx + 4]
test edi, edi
jne 0x100ff740
mov edx, 0x1016a1dc
jmp 0x100ff749
mov eax, esi
xor edx, edx
div dword [ebx + 8]
add edx, edi
movsx edx, byte [edx]
mov al, byte [ebp]
mov dword [esp + esi*4 + 0x420], edx
mov dl, 0x34
mov bl, cl
imul dl
mov dword [esp + esi*4 + 0x20], esi
dec cl
inc esi
mov byte [0x1018ccc1], al
cmp esi, 0x100
mov byte [0x1018ccc0], cl
jb 0x100ff72e
dec bl
xor ebp, ebp
xor esi, esi
mov edi, dword [esp + esi + 0x20]
mov eax, dword [esp + esi + 0x420]
add eax, edi
mov ecx, dword [0x1018ccb4]
add eax, ebp
push 0xffffffffffffffb8
and eax, 0xff
push 0x2e
mov ebp, eax
mov eax, 0x17b
cdq
idiv dword [0x1018ccb8]
mov eax, dword [esp + ebp*4 + 0x28]
push 0xffffffffffffff90
mov dword [esp + esi + 0x2c], eax
mov dl, byte [edx + ecx]
mov cl, byte [0x1018ccc5]
inc cl
mov byte [0x1018ccbc], dl
mov byte [0x1018ccc5], cl
inc bl
call fcn.100ffa60
mov cl, 0xe9
add esp, 0xc
imul cl
mov byte [esp + 0x14], al
mov al, byte [0x1018ccbf]
mov byte [esp + 0x18], al
inc al
push 0x7a
push 0xffffffffffffffa9
mov byte [0x1018ccbf], al
call fcn.100ffa10
mov dl, byte [0x1018ccbc]
mov ecx, dword [esp + 0x20]
add esp, 4
push eax
mov eax, dword [esp + 0x1c]
push 0xffffffffffffffd0
push edx
push 0x3f
push eax
push ecx
call fcn.10032b70
mov dl, al
mov al, byte [0x1018ccc5]
imul bl
add esp, 0x14
add dl, al
push edx
call fcn.100ffa60
mov al, bl
add esi, 4
add esp, 0xc
add al, 0x10
cmp esi, 0x400
mov dword [esp + ebp*4 + 0x20], edi
mov byte [0x1018ccbf], al
jb 0x100ff77c
mov ecx, dword [esp + 0x824]
xor ebp, ebp
xor ebx, ebx
mov dword [esp + 0x14], ebp
cmp dword [ecx + 8], ebp
jbe 0x100ff998
mov eax, 0x3e7
inc ebp
cdq
idiv dword [0x1018ccb8]
mov eax, dword [0x1018ccb4]
and ebp, 0xff
mov byte [0x1018ccbd], 0x53
mov ecx, dword [esp + ebp*4 + 0x20]
add ebx, ecx
and ebx, 0xff
mov dl, byte [edx + eax]
mov eax, dword [esp + ebx*4 + 0x20]
mov dword [esp + ebp*4 + 0x20], eax
mov byte [0x1018ccc1], dl
mov dword [esp + ebx*4 + 0x20], ecx
mov edx, dword [esp + ebp*4 + 0x20]
add edx, ecx
and edx, 0x800000ff
jns 0x100ff8b3
dec edx
or edx, 0xffffff00
inc edx
mov al, byte [0x1018ccbc]
mov ecx, dword [esp + edx*4 + 0x20]
dec al
mov byte [0x1018ccbc], al
mov eax, dword [esp + 0x824]
mov eax, dword [eax + 4]
test eax, eax
jne 0x100ff8d8
mov eax, 0x1016a1dc
jmp 0x100ff8de
mov edx, dword [esp + 0x14]
add eax, edx
mov dl, byte [eax]
mov esi, dword [esp + 0x828]
mov eax, dword [0x1016a3e8]
xor cl, dl
mov edx, dword [esi + 8]
mov byte [esp + 0x13], cl
sub eax, edx
cmp eax, 1
ja 0x100ff901
call fcn.101307ab
mov edi, dword [esi + 8]
inc edi
cmp edi, 0xfffffffd
jbe 0x100ff90f
call fcn.101307ab
mov ecx, dword [esi + 4]
xor edx, edx
cmp ecx, edx
je 0x100ff937
mov al, byte [ecx - 1]
test al, al
je 0x100ff937
cmp al, 0xff
je 0x100ff937
cmp edi, edx
jne 0x100ff94e
dec al
mov byte [ecx - 1], al
mov dword [esi + 4], edx
mov dword [esi + 8], edx
mov dword [esi + 0xc], edx
jmp 0x100ff971
cmp edi, edx
jne 0x100ff949
cmp ecx, edx
je 0x100ff971
push edx
mov ecx, esi
call fcn.1000be00
jmp 0x100ff971
cmp dword [esi + 0xc], edi
jae 0x100ff956
push edi
mov ecx, esi
call fcn.1000c9b0
movsx ecx, byte [esp + 0x13]
mov edx, dword [esi + 4]
mov eax, dword [esi + 8]
add edx, eax
mov ch, cl
mov byte [edx], cl
mov ecx, dword [esi + 4]
mov dword [esi + 8], edi
mov byte [ecx + edi], 0
mov al, byte [0x1018ccbd]
mov edx, dword [esp + 0x824]
inc al
mov byte [0x1018ccbd], al
mov eax, dword [esp + 0x14]
mov ecx, dword [edx + 8]
inc eax
cmp eax, ecx
mov dword [esp + 0x14], eax
jb 0x100ff85d
pop edi
pop esi
pop ebp
mov al, 1
pop ebx
add esp, 0x810
ret 8