Function at 0x180047210
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push rbx
push rsi
push rdi
push r12
sub rsp, 0x28
mov ebx, r9d
mov edi, r8d
mov r12d, edx
mov rsi, rcx
cmp r8d, edx
jne 0x180047238
mov rax, rcx
add rsp, 0x28
pop r12
pop rdi
pop rsi
pop rbx
ret
mov qword [rsp + 0x50], rbp
mov qword [rsp + 0x20], r15
test edi, edi
js 0x18004763f
test ebx, ebx
js 0x18004763f
je 0x180047264
mov eax, 0x7fffffff
cdq
idiv ebx
cmp edi, eax
jg 0x18004763f
mov ecx, edi
imul ecx, ebx
test ecx, ecx
js 0x18004763f
mov ebp, dword [rsp + 0x70]
test ebp, ebp
js 0x18004763f
je 0x18004728f
mov eax, 0x7fffffff
cdq
idiv ebp
cmp ecx, eax
jg 0x18004763f
imul ecx, ebp
movsxd rcx, ecx
call fcn.180074b18
mov r15, rax
test rax, rax
je 0x18004763f
xor r11d, r11d
mov qword [rsp + 0x58], r13
mov qword [rsp + 0x60], r14
test ebp, ebp
jle 0x1800475df
lea r14d, [r12*8 - 0xa]
add r14d, edi
lea r13, [0x180000000]
nop dword [rax]
mov r9d, r11d
mov eax, r11d
imul r9d, r12d
imul eax, edi
imul r9d, ebx
imul eax, ebx
add r9, rsi
add rax, r15
cmp r14d, 0x19
ja case.0x180047302.3
movsxd rcx, r14d
mov edx, dword [r13 + rcx*4 + 0x47670]
add rdx, r13
jmp rdx
lea edx, [rbx - 1]
test ebx, ebx
jle 0x1800475d3
nop
sub edx, 1
movzx ecx, byte [r9]
mov byte [rax], cl
lea r9, [r9 + 1]
mov byte [rax + 1], 0xff
lea rax, [rax + 2]
jns 0x180047310
jmp 0x1800475d3
lea edx, [rbx - 1]
test ebx, ebx
jle 0x1800475d3
nop word [rax + rax]
sub edx, 1
movzx ecx, byte [r9]
mov byte [rax + 2], cl
lea r9, [r9 + 1]
mov byte [rax + 1], cl
mov byte [rax], cl
lea rax, [rax + 3]
jns 0x180047340
jmp 0x1800475d3
lea edx, [rbx - 1]
test ebx, ebx
jle 0x1800475d3
nop dword [rax]
sub edx, 1
movzx ecx, byte [r9]
mov byte [rax + 2], cl
lea r9, [r9 + 1]
mov byte [rax + 1], cl
mov byte [rax], cl
mov byte [rax + 3], 0xff
lea rax, [rax + 4]
jns 0x180047370
jmp 0x1800475d3
lea edx, [rbx - 1]
test ebx, ebx
jle 0x1800475d3
nop dword [rax]
sub edx, 1
movzx ecx, byte [r9]
mov byte [rax], cl
lea rax, [rax + 1]
lea r9, [r9 + 2]
jns 0x1800473a0
jmp 0x1800475d3
lea edx, [rbx - 1]
test ebx, ebx
jle 0x1800475d3
nop dword [rax]
nop word [rax + rax]
sub edx, 1
movzx ecx, byte [r9]
mov byte [rax + 2], cl
lea r9, [r9 + 2]
mov byte [rax + 1], cl
mov byte [rax], cl
lea rax, [rax + 3]
jns 0x1800473d0
jmp 0x1800475d3
lea edx, [rbx - 1]
test ebx, ebx
jle 0x1800475d3
nop dword [rax]
sub edx, 1
movzx ecx, byte [r9]
mov byte [rax + 2], cl
lea r9, [r9 + 2]
mov byte [rax + 1], cl
mov byte [rax], cl
lea rax, [rax + 4]
movzx ecx, byte [r9 - 1]
mov byte [rax - 1], cl
jns 0x180047400
jmp 0x1800475d3
lea edx, [rbx - 1]
test ebx, ebx
jle 0x1800475d3
sub edx, 1
movzx ecx, byte [r9]
mov byte [rax], cl
lea rax, [rax + 4]
movzx ecx, byte [r9 + 1]
lea r9, [r9 + 3]
mov byte [rax - 3], cl
movzx ecx, byte [r9 - 1]
mov byte [rax - 2], cl
mov byte [rax - 1], 0xff
jns 0x180047431
jmp 0x1800475d3
lea r10d, [rbx - 1]
test ebx, ebx
jle 0x1800475d3
nop dword [rax]
movzx ecx, byte [r9 + 1]
lea rax, [rax + 1]
imul r8d, ecx, 0x96
movzx ecx, byte [r9 + 2]
lea r9, [r9 + 3]
imul edx, ecx, 0x1d
movzx ecx, byte [r9 - 3]
add r8d, edx
imul edx, ecx, 0x4d
add r8d, edx
shr r8d, 8
sub r10d, 1
mov byte [rax - 1], r8b
jns 0x180047470
jmp 0x1800475d3
lea r10d, [rbx - 1]
test ebx, ebx
jle 0x1800475d3
nop dword [rax]
movzx ecx, byte [r9 + 1]
lea rax, [rax + 2]
imul r8d, ecx, 0x96
movzx ecx, byte [r9 + 2]
lea r9, [r9 + 3]
imul edx, ecx, 0x1d
movzx ecx, byte [r9 - 3]
mov byte [rax - 1], 0xff
add r8d, edx
imul edx, ecx, 0x4d
add r8d, edx
shr r8d, 8
sub r10d, 1
mov byte [rax - 2], r8b
jns 0x1800474c0
jmp 0x1800475d3
lea r10d, [rbx - 1]
test ebx, ebx
jle 0x1800475d3
nop dword [rax]
movzx ecx, byte [r9 + 1]
lea rax, [rax + 1]
imul r8d, ecx, 0x96
movzx ecx, byte [r9 + 2]
lea r9, [r9 + 4]
imul edx, ecx, 0x1d
movzx ecx, byte [r9 - 4]
add r8d, edx
imul edx, ecx, 0x4d
add r8d, edx
shr r8d, 8
sub r10d, 1
mov byte [rax - 1], r8b
jns 0x180047510
jmp 0x1800475d3
lea r10d, [rbx - 1]
test ebx, ebx
jle 0x1800475d3
nop dword [rax]
movzx ecx, byte [r9 + 1]
lea rax, [rax + 2]
imul r8d, ecx, 0x96
movzx ecx, byte [r9 + 2]
lea r9, [r9 + 4]
imul edx, ecx, 0x1d
movzx ecx, byte [r9 - 4]
add r8d, edx
imul edx, ecx, 0x4d
add r8d, edx
shr r8d, 8
sub r10d, 1
mov byte [rax - 2], r8b
movzx ecx, byte [r9 - 1]
mov byte [rax - 1], cl
jns 0x180047560
jmp 0x1800475d3
lea edx, [rbx - 1]
test edx, edx
js 0x1800475d3
nop dword [rax]
sub edx, 1
movzx ecx, byte [r9]
mov byte [rax], cl
lea rax, [rax + 3]
movzx ecx, byte [r9 + 1]
lea r9, [r9 + 4]
mov byte [rax - 2], cl
movzx ecx, byte [r9 - 2]
mov byte [rax - 1], cl
jns 0x1800475b0
inc r11d
cmp r11d, ebp
jl 0x1800472d0
mov rcx, rsi
call fcn.180074b04
mov rax, r15
mov r14, qword [rsp + 0x60]
mov r13, qword [rsp + 0x58]
mov rbp, qword [rsp + 0x50]
mov r15, qword [rsp + 0x20]
add rsp, 0x28
pop r12
pop rdi
pop rsi
pop rbx
ret
mov rcx, rsi
call fcn.180074b04
mov rcx, r15
call fcn.180074b04
mov edx, dword [0x1801bd240]
mov rax, qword gs:[0x58]
mov ecx, 0x10
mov rax, qword [rax + rdx*8]
lea rdx, str.unsupported
mov qword [rcx + rax], rdx
xor eax, eax
jmp 0x1800475ea
mov rcx, rsi
call fcn.180074b04
mov edx, dword [0x1801bd240]
mov rax, qword gs:[0x58]
mov ecx, 0x10
mov rax, qword [rax + rdx*8]
lea rdx, str.outofmem
mov qword [rcx + rax], rdx
xor eax, eax
jmp 0x1800475f4