Function at 0x1009d5b8
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x54
push ebx
mov ebx, dword [ebp + 0x1c]
shr ebx, 0x18
mov dword [ebp - 0x10], ebx
test ebx, ebx
je 0x1009d883
mov ecx, dword [ebp + 0xc]
mov eax, dword [ebp + 0x14]
mov edx, dword [ebp + 0x10]
add eax, ecx
and dword [ebp - 0x54], 0
and dword [ebp - 0x50], 0
mov dword [ebp - 0x3c], eax
mov eax, dword [ebp + 0x18]
push esi
push edi
mov edi, dword [ebp + 8]
add eax, edx
mov dword [ebp - 0x38], eax
mov dword [ebp - 0x44], ecx
lea ecx, [ebp - 0x44]
mov dword [ebp - 0x40], edx
mov eax, dword [edi + 8]
mov dword [ebp - 0x4c], eax
mov eax, dword [edi + 0xc]
mov dword [ebp - 0x48], eax
lea eax, [ebp - 0x54]
push eax
call fcn.1001579d
mov ecx, dword [ebp + 0x1c]
mov eax, ecx
shr eax, 0x10
movzx eax, al
mov dword [ebp - 0xc], eax
mov eax, ecx
shr eax, 8
movzx eax, al
mov esi, dword [ebp - 0x3c]
mov dword [ebp - 4], eax
mov eax, dword [edi + 0x10]
sub esi, dword [ebp - 0x44]
cdq
and edx, 7
movzx ecx, cl
add eax, edx
mov dword [ebp - 0x14], ecx
sar eax, 3
mov dword [ebp - 8], eax
mov eax, dword [edi + 0x14]
mov edi, ebx
shl edi, 8
or edi, ecx
shr eax, 1
mov ecx, dword [ebp + 8]
and eax, 1
shl edi, 8
or edi, dword [ebp - 4]
mov dword [ebp - 0x2c], eax
mov eax, dword [ecx]
shl edi, 8
or edi, dword [ebp - 0xc]
mov dword [ebp - 0x24], esi
mov dword [ebp - 0x28], edi
call dword [eax + 4]
mov dword [ebp - 0x18], eax
mov ecx, ebx
mov ebx, dword [ebp - 0x40]
mov eax, 0xff
cmp ecx, eax
jne 0x1009d6f0
mov dword [ebp - 0x10], ebx
cmp ebx, dword [ebp - 0x38]
jge 0x1009d881
mov ecx, dword [ebp - 8]
mov eax, dword [ebp + 8]
mov edx, dword [ebp - 0x44]
imul edx, ecx
mov eax, dword [eax + 0x18]
imul eax, ebx
add eax, dword [ebp - 0x18]
add edx, eax
cmp ecx, 4
jne 0x1009d6bb
test esi, esi
jle 0x1009d6e2
mov eax, edi
mov ecx, esi
mov edi, edx
rep stosd dword es:[edi], eax
mov edi, dword [ebp - 0x28]
jmp 0x1009d6df
test esi, esi
jle 0x1009d6e2
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 4]
mov ebx, dword [ebp - 0xc]
mov dword [ebp + 0x1c], esi
sub dword [ebp + 0x1c], 1
mov byte [edx], bl
lea edx, [edx + 3]
mov byte [edx - 2], cl
mov byte [edx - 1], al
jne 0x1009d6cb
mov ebx, dword [ebp - 0x10]
mov ecx, dword [ebp - 8]
inc ebx
mov dword [ebp - 0x10], ebx
cmp ebx, dword [ebp - 0x38]
jl 0x1009d691
jmp 0x1009d881
mov dword [ebp - 0x28], ebx
cmp ebx, dword [ebp - 0x38]
jge 0x1009d881
mov edx, dword [ebp - 8]
mov edi, dword [ebp - 0x18]
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x18]
imul eax, ebx
mov ebx, dword [ebp - 0x44]
imul ebx, edx
add eax, edi
add ebx, eax
cmp dword [ebp - 0x2c], 0
je 0x1009d7f4
test esi, esi
jle 0x1009d871
mov dword [ebp - 0x1c], esi
mov al, byte [ebx + 3]
mov byte [ebp + 0x1f], al
test al, al
jne 0x1009d776
mov edx, dword [ebp - 0x14]
mov ecx, edx
mov eax, dword [ebp - 4]
shr eax, 0x10
shr ecx, 0x18
or cl, al
mov byte [ebx + 2], dl
mov eax, dword [ebp - 0xc]
shr eax, 8
or cl, al
mov eax, dword [ebp - 0x10]
or cl, al
mov eax, dword [ebp - 4]
mov byte [ebx + 3], cl
mov ecx, edx
shr eax, 8
shr ecx, 0x10
or cl, al
mov eax, edx
or cl, byte [ebp - 0xc]
shr eax, 8
or al, byte [ebp - 4]
mov byte [ebx], cl
mov byte [ebx + 1], al
jmp 0x1009d7e2
movzx eax, al
mov esi, 0xff
imul eax, ecx
cdq
idiv esi
sub cl, al
imul eax, dword [ebp - 0x10], 0xff
add cl, byte [ebp + 0x1f]
mov byte [ebx + 3], cl
movzx ecx, cl
cdq
idiv ecx
mov edi, eax
movzx eax, byte [ebx]
sub esi, edi
mov ecx, edi
imul ecx, dword [ebp - 0xc]
imul eax, esi
add eax, ecx
mov ecx, 0xff
cdq
idiv ecx
mov ecx, edi
imul edi, dword [ebp - 0x14]
imul ecx, dword [ebp - 4]
mov byte [ebx], al
movzx eax, byte [ebx + 1]
imul eax, esi
add eax, ecx
mov ecx, 0xff
cdq
idiv ecx
mov byte [ebx + 1], al
movzx eax, byte [ebx + 2]
imul eax, esi
add eax, edi
cdq
idiv ecx
mov byte [ebx + 2], al
mov ecx, dword [ebp - 0x10]
add ebx, 4
sub dword [ebp - 0x1c], 1
jne 0x1009d72a
jmp 0x1009d865
test esi, esi
jle 0x1009d871
mov eax, dword [ebp - 4]
mov edi, 0xff
mov edx, dword [ebp - 0xc]
sub edi, ecx
imul eax, ecx
imul edx, ecx
mov dword [ebp + 0x1c], esi
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x14]
imul eax, ecx
mov dword [ebp - 0x34], edx
mov dword [ebp - 0x30], eax
movzx eax, byte [ebx]
mov ecx, 0xff
imul eax, edi
mov esi, ebx
add eax, edx
cdq
idiv ecx
mov byte [ebx], al
movzx eax, byte [ebx + 1]
imul eax, edi
add eax, dword [ebp - 0x1c]
cdq
idiv ecx
mov byte [ebx + 1], al
movzx eax, byte [ebx + 2]
imul eax, edi
add eax, dword [ebp - 0x30]
cdq
idiv ecx
mov edx, dword [ebp - 0x34]
mov byte [ebx + 2], al
inc ebx
cmp dword [ebp - 8], 4
cmovne ebx, esi
add ebx, 3
sub dword [ebp + 0x1c], 1
jne 0x1009d81d
mov edi, dword [ebp - 0x18]
mov edx, dword [ebp - 8]
mov esi, dword [ebp - 0x24]
mov ecx, dword [ebp - 0x10]
mov ebx, dword [ebp - 0x28]
inc ebx
mov dword [ebp - 0x28], ebx
cmp ebx, dword [ebp - 0x38]
jl 0x1009d702
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret