Function at 0x140047470
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x78
xor ebx, ebx
mov rdi, rcx
test rdx, rdx
jne 0x14004749c
mov esi, dword [rcx]
mov r14d, dword [rcx + 4]
mov ebp, ebx
mov dword [rsp + 0xc0], ebx
jmp 0x140047502
movups xmm0, xmmword [rdx]
mov edx, dword [rcx]
movups xmmword [rsp + 0x30], xmm0
mov ebp, dword [rsp + 0x34]
movd r8d, xmm0
test r8d, r8d
cmovs r8d, ebx
test ebp, ebp
cmovs ebp, ebx
mov dword [rsp + 0xc0], r8d
cmp r8d, edx
jl 0x1400474d4
lea r8d, [rdx - 1]
mov dword [rsp + 0xc0], r8d
mov ecx, dword [rcx + 4]
cmp ebp, ecx
jl 0x1400474de
lea ebp, [rcx - 1]
mov esi, dword [rsp + 0x38]
lea eax, [rsi + r8]
cmp eax, edx
jl 0x1400474ef
mov esi, edx
sub esi, r8d
mov r14d, dword [rsp + 0x3c]
lea eax, [r14 + rbp]
cmp eax, ecx
jl 0x140047502
mov r14d, ecx
sub r14d, ebp
movzx ecx, word [rdi + 0xc]
mov edx, 0x7f0
cmp cx, 1
jne 0x140047519
mov r15d, 2
jmp 0x140047526
test dx, cx
mov r15d, 0x100
cmovne r15d, ebx
mov eax, 1
mov dword [rsp + 0x40], 0x28
mov dword [rsp + 0x44], esi
mov dword [rsp + 0x48], r14d
mov word [rsp + 0x4c], ax
cmp cx, ax
je 0x14004755a
test dx, cx
je 0x140047555
movzx eax, word [rdi + 0x12]
shl ax, 3
jmp 0x14004755a
mov eax, 8
mov word [rsp + 0x4e], ax
movzx eax, ax
movsxd r12, r15d
lea rcx, [r12*4 + 0x28]
mov qword [rsp + 0x28], r12
imul eax, esi
add eax, 0x1f
cdq
and edx, 0x1f
lea r13d, [rdx + rax]
sar r13d, 5
shl r13d, 2
mov eax, r13d
mov dword [rsp + 0xc8], r13d
imul eax, r14d
movsxd rdx, eax
mov dword [rsp + 0xd0], eax
add rdx, rcx
mov ecx, 0x2002
call qword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov qword [rsp + 0x30], rax
test rax, rax
je 0x1400478f9
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GlobalLock]
mov r8d, dword [rsp + 0xd0]
movups xmm0, xmmword [rsp + 0x40]
movups xmm1, xmmword [rsp + 0x50]
lea rcx, [rax + 0x28]
lea rdx, [rax + 0x28]
mov qword [rsp + 0xd8], rax
movups xmmword [rax], xmm0
movsd xmm0, qword [rsp + 0x60]
movups xmmword [rax + 0x10], xmm1
mov qword [rsp + 0x20], rcx
lea rdx, [rdx + r12*4]
movsd qword [rax + 0x20], xmm0
mov dword [rax + 0x10], ebx
mov dword [rax + 0x14], r8d
mov qword [rax + 0x18], 0
mov dword [rax + 0x20], r15d
mov dword [rax + 0x24], ebx
imul ebp, dword [rdi + 8]
movzx eax, word [rax + 0xe]
cmp ax, 1
jne 0x14004770d
lea eax, [r14 - 1]
movsxd r12, ebp
add r12, qword [rdi + 0x30]
imul eax, r13d
movsxd r13, eax
add r13, rdx
test r14d, r14d
jle 0x1400476f5
mov r15d, dword [rsp + 0xc0]
movsxd rax, dword [rsp + 0xc8]
add r15d, esi
nop dword [rax]
mov r8, rax
xor edx, edx
mov rcx, r13
mov rsi, r13
movzx ebp, bx
call fcn.1401c0040
movsxd rax, dword [rsp + 0xc0]
mov r8d, eax
cmp eax, r15d
jge 0x1400476d5
mov r9, rax
nop word [rax + rax]
movzx eax, r8b
mov ecx, 7
and al, 7
sub cl, al
mov rax, r9
sar rax, 3
movzx edx, byte [rax + r12]
movzx eax, bp
inc bp
shr dl, cl
mov ecx, 7
sub ecx, eax
and dl, 1
shl dl, cl
or byte [rsi], dl
cmp bp, 8
jne 0x1400476ca
mov ebp, ebx
inc rsi
inc r8d
inc r9
cmp r8d, r15d
jl 0x140047690
movsxd rax, dword [rdi + 8]
add r12, rax
movsxd rax, dword [rsp + 0xc8]
sub r13, rax
dec r14
jne 0x140047660
mov rcx, qword [rsp + 0x20]
mov word [rcx], 0
mov byte [rcx + 2], 0
mov word [rcx + 4], 0xffff
mov byte [rcx + 6], 0xff
jmp 0x1400478e3
cmp ax, 8
lea eax, [r14 - 1]
ja 0x14004781f
imul eax, r13d
movsxd rbp, ebp
add rbp, qword [rdi + 0x30]
movsxd r15, eax
add r15, rdx
test r14d, r14d
jle 0x140047774
movsxd r12, esi
mov esi, r14d
mov r14d, dword [rsp + 0xc0]
movsxd r13, r13d
movzx eax, word [rdi + 0xe]
mov r8, r12
mov rcx, r15
imul eax, r14d
movsxd rdx, eax
add rdx, rbp
call fcn.1401bd6e0
movsxd rax, dword [rdi + 8]
sub r15, r13
add rbp, rax
dec rsi
jne 0x140047742
mov r12, qword [rsp + 0x28]
mov rcx, qword [rsp + 0x20]
lea r8, [r12*4]
xor edx, edx
call fcn.1401c0040
cmp qword [rdi + 0x28], 0
mov r10, qword [rsp + 0xd8]
je 0x1400477db
test r12, r12
jle 0x1400478eb
lea rdx, [r10 + 0x2a]
nop
mov rax, qword [rdi + 0x28]
inc rbx
lea rdx, [rdx + 4]
movzx ecx, byte [rax + rbx + 0x1ff]
mov byte [rdx - 6], cl
mov rax, qword [rdi + 0x28]
movzx ecx, byte [rax + rbx + 0xff]
mov byte [rdx - 5], cl
mov rax, qword [rdi + 0x28]
movzx ecx, byte [rbx + rax - 1]
mov byte [rdx - 4], cl
cmp rbx, r12
jl 0x1400477a0
jmp 0x1400478eb
movsx eax, word [rdi + 0x20]
test eax, eax
jle 0x1400478eb
mov r9d, ebx
lea r8, [r10 + 0x29]
nop
lea ecx, [rax - 1]
mov eax, r9d
inc ebx
cdq
add r9d, 0xff
lea r8, [r8 + 4]
idiv ecx
mov byte [r8 - 3], al
mov byte [r8 - 4], al
mov byte [r8 - 5], al
movsx eax, word [rdi + 0x20]
cmp ebx, eax
jl 0x1400477f0
jmp 0x1400478eb
imul eax, r13d
movsxd r10, ebp
add r10, qword [rdi + 0x30]
movsxd r9, eax
inc r9
test r14d, r14d
jle 0x1400478e3
mov r11d, r14d
mov r14d, dword [rsp + 0xc0]
movsxd rbx, r13d
add r9, rdx
nop word [rax + rax]
movzx eax, word [rdi + 0xe]
imul eax, r14d
cdqe
add rax, r10
cmp word [rdi + 0x12], 3
jne 0x140047893
test esi, esi
jle 0x1400478d0
mov rdx, r9
mov r8d, esi
nop
movzx ecx, byte [rax]
lea rdx, [rdx + 3]
lea rax, [rax + 3]
mov byte [rdx - 2], cl
movzx ecx, byte [rax - 2]
mov byte [rdx - 3], cl
movzx ecx, byte [rax - 1]
mov byte [rdx - 4], cl
dec r8
jne 0x140047870
jmp 0x1400478d0
test esi, esi
jle 0x1400478d0
mov rdx, r9
mov r8d, esi
nop dword [rax]
movzx ecx, byte [rax]
add rax, 3
mov byte [rdx + 1], cl
movzx ecx, byte [rax - 2]
mov byte [rdx], cl
movzx ecx, byte [rax - 1]
mov byte [rdx - 1], cl
cmp word [rdi + 0xe], 4
jne 0x1400478c7
movzx ecx, byte [rax]
inc rax
mov byte [rdx + 2], cl
add rdx, 4
dec r8
jne 0x1400478a0
movsxd rax, dword [rdi + 8]
sub r9, rbx
add r10, rax
dec r11
jne 0x140047850
mov r10, qword [rsp + 0xd8]
mov rcx, r10
call qword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov rax, qword [rsp + 0x30]
add rsp, 0x78
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret