Function at 0x140009230
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov dword [rsp + 0x20], r9d
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x80
mov r15d, dword [rsp + 0xe0]
mov eax, r9d
movsxd r13, dword [rsp + 0xf0]
xor r9d, r9d
mov r11d, dword [rsp + 0xe8]
mov rdi, rcx
cmp r13d, 0x10
mov dword [rsp + 0x30], r15d
mov r10d, r9d
mov esi, r8d
sete r10b
mov r12, rdx
inc r10d
mov ecx, r10d
imul ecx, eax
mov eax, ecx
imul eax, r15d
mov dword [rsp + 0x3c], eax
mov rax, qword [rdi]
mov r14d, dword [rax + 8]
mov eax, r14d
imul eax, r10d
mov dword [rsp + 0xc0], r14d
mov dword [rsp + 0x34], eax
test r15d, r15d
js 0x140009e08
test r11d, r11d
js 0x140009e08
mov ebx, 0x7fffffff
je 0x1400092d4
xor edx, edx
mov eax, ebx
div r11d
cmp r15d, eax
jg 0x140009e08
mov r8d, r15d
imul r8d, r11d
test r8d, r8d
js 0x140009e08
test ecx, ecx
js 0x140009e08
je 0x1400092fc
mov eax, ebx
cdq
idiv ecx
cmp r8d, eax
jg 0x140009e08
mov eax, r11d
imul eax, dword [rsp + 0x3c]
movsxd rcx, eax
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov qword [rdi + 0x18], rax
test rax, rax
je 0x140009e0c
test r14d, r14d
js 0x140009df3
test r15d, r15d
je 0x140009338
xor edx, edx
mov eax, ebx
div r15d
cmp r14d, eax
jg 0x140009df3
mov r15d, r14d
imul r15d, dword [rsp + 0xe0]
test r15d, r15d
js 0x140009df3
test r13d, r13d
js 0x140009df3
je 0x140009368
xor edx, edx
mov eax, ebx
div r13d
cmp r15d, eax
jg 0x140009df3
mov eax, r15d
imul eax, r13d
cmp eax, 0x7ffffff8
jg 0x140009df3
mov r8d, dword [rsp + 0xe8]
mov ecx, r13d
imul ecx, r15d
add ecx, 7
shr ecx, 3
mov dword [rsp + 0x38], ecx
test r8d, r8d
je 0x1400093a7
xor edx, edx
mov eax, ebx
div r8d
cmp ecx, eax
jg 0x140009df3
mov eax, ecx
sub ebx, ecx
imul eax, r8d
cmp eax, ebx
jg 0x140009df3
lea eax, [rcx + 1]
imul eax, r8d
cmp esi, eax
jae 0x1400093da
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, [0x1413a1ba8]
jmp 0x140009e1f
add ecx, ecx
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov qword [rsp + 0x20], rax
mov rsi, rax
test rax, rax
je 0x140009e0c
mov r9d, dword [rsp + 0x38]
mov ebx, 1
cmp r13d, 8
jge 0x14000940e
mov eax, ebx
mov dword [rsp + 0x34], ebx
mov r10d, r9d
jmp 0x140009417
mov eax, dword [rsp + 0x34]
mov r10d, dword [rsp + 0x30]
xor r8d, r8d
mov edx, r8d
mov dword [rsp + 0x40], edx
cmp dword [rsp + 0xe8], edx
jbe 0x140009dd9
mov rcx, qword [rdi + 0x18]
mov qword [rsp + 0x58], rcx
lea rcx, [0x140517de8]
add rcx, r13
movsxd r11, eax
imul r10d, eax
mov qword [rsp + 0x70], rcx
movsxd rcx, dword [rsp + 0xe0]
mov qword [rsp + 0x48], r11
mov qword [rsp + 0x50], rcx
movsxd rax, r10d
mov dword [rsp + 0x30], r10d
mov r10, rax
mov qword [rsp + 0x60], rax
nop
mov eax, edx
mov qword [rsp + 0x28], r10
and eax, 1
mov edi, edx
imul edi, dword [rsp + 0x3c]
imul eax, r9d
add rdi, qword [rsp + 0x58]
mov r13d, eax
mov qword [rsp + 0x68], r13
lea rbx, [rsi + rax]
movzx eax, byte [r12]
mov esi, edx
inc r12
not esi
mov qword [rsp + 0xc8], r12
and esi, 1
imul esi, r9d
mov r9, qword [rsp + 0x20]
add rsi, r9
cmp eax, 4
ja 0x140009daf
test edx, edx
lea rdx, [0x140000000]
jne 0x1400094df
mov r10, qword [rsp + 0x60]
movzx eax, byte [rax + rdx + 0x517d3c]
mov qword [rsp + 0x28], r10
cmp eax, 5
ja case.default.0x1400094f0
cdqe
mov ecx, dword [rdx + rax*4 + 0x9e40]
add rcx, rdx
jmp rcx
mov r8, r10
mov rdx, r12
mov rcx, rbx
vzeroupper
call sub.VCRUNTIME140.dll_memcpy
mov ecx, dword [rsp + 0xe0]
mov rsi, qword [rsp + 0x28]
mov eax, dword [rsp + 0xf0]
add r12, rsi
cmp eax, 8
jge 0x140009bae
cmp dword [rsp + 0xf8], 0
jne 0x140009a25
mov rcx, qword [rsp + 0x70]
movzx r14d, byte [rcx]
jmp 0x140009a28
mov r8, r11
mov rdx, r12
mov rcx, rbx
vzeroupper
call sub.VCRUNTIME140.dll_memcpy
mov r11, qword [rsp + 0x48]
mov rsi, qword [rsp + 0x28]
cmp r11, rsi
jge 0x140009595
mov r8, rbx
lea rcx, [r11 + r12]
sub r8, r11
mov r9, rbx
sub r8, r12
sub r9, r12
mov rdx, rsi
sub rdx, r11
nop word [rax + rax]
movzx eax, byte [rcx + r8]
add al, byte [rcx]
mov byte [r9 + rcx], al
lea rcx, [rcx + 1]
sub rdx, 1
jne 0x140009580
mov ecx, dword [rsp + 0xe0]
jmp 0x14000950f
mov r11d, dword [rsp + 0x30]
xor edx, edx
test r11d, r11d
jle 0x1400096e0
cmp r11d, 8
jb 0x1400096e0
lea eax, [r11 - 1]
movsxd rcx, eax
lea rax, [rcx + r12]
lea r8, [rcx + rbx]
cmp rbx, rax
ja 0x1400095d8
cmp r8, r12
jae 0x1400096e0
lea rax, [rcx + rsi]
cmp rbx, rax
ja 0x1400095ea
cmp r8, rsi
jae 0x1400096e0
cmp r11d, 0x80
jb 0x14000968e
mov ecx, r11d
and ecx, 0x8000007f
jge 0x140009609
dec ecx
or ecx, 0xffffff80
inc ecx
mov eax, r11d
sub eax, ecx
mov rcx, r12
movsxd r9, eax
sub rcx, rsi
lea rax, [rsi + 0x20]
mov r8, rbx
sub r8, rsi
nop dword [rax]
nop word [rax + rax]
vmovdqu ymm2, ymmword [rax + rcx]
vmovdqu ymm1, ymmword [rax - 0x20]
vpaddb ymm1, ymm1, ymmword [rax + rcx - 0x20]
vmovdqu ymmword [r8 + rax - 0x20], ymm1
vpaddb ymm1, ymm2, ymmword [rax]
vmovdqu ymm2, ymmword [rax + 0x20]
vmovdqu ymmword [r8 + rax], ymm1
vpaddb ymm1, ymm2, ymmword [rax + rcx + 0x20]
vmovdqu ymm2, ymmword [rax + 0x40]
vmovdqu ymmword [r8 + rax + 0x20], ymm1
vpaddb ymm1, ymm2, ymmword [rax + rcx + 0x40]
sub rdx, 0xffffffffffffff80
vmovdqu ymmword [r8 + rax + 0x40], ymm1
lea rax, [rax + 0x80]
cmp rdx, r9
jl 0x140009630
mov eax, r11d
and al, 0x7f
cmp al, 8
jb 0x1400096e0
mov ecx, r11d
and ecx, 0x80000007
jge 0x1400096a0
dec ecx
or ecx, 0xfffffff8
inc ecx
mov eax, r11d
sub eax, ecx
mov rcx, rsi
movsxd r9, eax
sub rcx, r12
lea rax, [rdx + r12]
mov r8, rbx
sub r8, r12
nop dword [rax + rax]
vmovq xmm1, qword [rax + rcx]
vmovq xmm0, qword [rax]
vpaddb xmm1, xmm1, xmm0
add rdx, 8
vmovq qword [r8 + rax], xmm1
lea rax, [rax + 8]
cmp rdx, r9
jl 0x1400096c0
cmp rdx, r10
jge 0x140009503
mov r9, rbx
lea rcx, [rdx + r12]
sub r9, r12
sub rsi, r12
mov r8, r10
sub r8, rdx
nop dword [rax]
movzx eax, byte [rcx + rsi]
add al, byte [rcx]
mov byte [r9 + rcx], al
lea rcx, [rcx + 1]
sub r8, 1
jne 0x140009700
jmp 0x140009503
test r11, r11
jle 0x140009749
mov r8, rsi
mov r9, rbx
sub r8, r12
mov rcx, r12
sub r9, r12
mov rdx, r11
movzx eax, byte [rcx + r8]
lea rcx, [rcx + 1]
shr al, 1
add al, byte [rcx - 1]
mov byte [r9 + rcx - 1], al
sub rdx, 1
jne 0x140009730
cmp r11, r10
jge 0x140009503
lea rdx, [r11 + rsi]
mov r9, rbx
sub r9, r11
mov r10, r12
sub r9, rsi
sub r10, rsi
mov r11, rbx
sub r11, rsi
mov rsi, qword [rsp + 0x28]
mov r8, rsi
sub r8, qword [rsp + 0x48]
nop dword [rax + rax]
movzx ecx, byte [rdx + r9]
movzx eax, byte [rdx]
lea rdx, [rdx + 1]
add ecx, eax
shr ecx, 1
add cl, byte [r10 + rdx - 1]
mov byte [r11 + rdx - 1], cl
sub r8, 1
jne 0x140009780
mov ecx, dword [rsp + 0xe0]
jmp 0x14000950f
mov r10d, dword [rsp + 0x34]
mov rdx, r8
test r10d, r10d
jle 0x1400098e0
cmp r10d, 8
jb 0x1400098e0
lea eax, [r10 - 1]
movsxd rcx, eax
lea rax, [rcx + r12]
lea r8, [rcx + rbx]
cmp rbx, rax
ja 0x1400097e4
cmp r8, r12
jae 0x1400098e0
lea rax, [rcx + rsi]
cmp rbx, rax
ja 0x1400097f6
cmp r8, rsi
jae 0x1400098e0
cmp r10d, 0x80
jb 0x14000988e
mov ecx, r10d
and ecx, 0x8000007f
jge 0x140009815
dec ecx
or ecx, 0xffffff80
inc ecx
mov eax, r10d
sub eax, ecx
mov rcx, r12
movsxd r9, eax
sub rcx, rsi
lea rax, [rsi + 0x20]
mov r8, rbx
sub r8, rsi
nop dword [rax]
vmovdqu ymm2, ymmword [rax]
vmovdqu ymm1, ymmword [rax - 0x20]
vpaddb ymm1, ymm1, ymmword [rax + rcx - 0x20]
vmovdqu ymmword [r8 + rax - 0x20], ymm1
vpaddb ymm1, ymm2, ymmword [rax + rcx]
vmovdqu ymm2, ymmword [rax + 0x20]
vmovdqu ymmword [r8 + rax], ymm1
vpaddb ymm1, ymm2, ymmword [rax + rcx + 0x20]
vmovdqu ymm2, ymmword [rax + 0x40]
vmovdqu ymmword [r8 + rax + 0x20], ymm1
vpaddb ymm1, ymm2, ymmword [rax + rcx + 0x40]
sub rdx, 0xffffffffffffff80
vmovdqu ymmword [r8 + rax + 0x40], ymm1
lea rax, [rax + 0x80]
cmp rdx, r9
jl 0x140009830
mov eax, r10d
and al, 0x7f
cmp al, 8
jb 0x1400098e0
mov ecx, r10d
and ecx, 0x80000007
jge 0x1400098a0
dec ecx
or ecx, 0xfffffff8
inc ecx
mov eax, r10d
sub eax, ecx
mov rcx, rsi
movsxd r9, eax
sub rcx, r12
lea rax, [rdx + r12]
mov r8, rbx
sub r8, r12
nop dword [rax + rax]
vmovq xmm1, qword [rax + rcx]
vmovq xmm0, qword [rax]
vpaddb xmm1, xmm1, xmm0
add rdx, 8
vmovq qword [r8 + rax], xmm1
lea rax, [rax + 8]
cmp rdx, r9
jl 0x1400098c0
cmp rdx, r11
jge 0x140009915
mov r9, rsi
lea rcx, [rdx + r12]
mov r10, rbx
sub r9, r12
sub r10, r12
mov r8, r11
sub r8, rdx
nop dword [rax + rax]
movzx eax, byte [rcx + r9]
add al, byte [rcx]
mov byte [r10 + rcx], al
lea rcx, [rcx + 1]
sub r8, 1
jne 0x140009900
mov rcx, qword [rsp + 0x28]
cmp r11, rcx
jge 0x140009503
mov r13, qword [rsp + 0x48]
mov rax, r11
sub rax, rbx
mov r14, rsi
add rsi, rax
add r12, rax
sub r14, rbx
mov r11, rcx
sub r11, r13
mov r10, rbx
nop dword [rax]
nop word [rax + rax]
movzx eax, byte [rsi + r10]
movzx r9d, byte [r10]
mov edx, eax
movzx ecx, byte [r10 + r14]
lea r10, [r10 + 1]
lea r8d, [rcx + rcx*2]
sub r8d, r9d
sub r8d, eax
cmp r9d, eax
cmovb edx, r9d
cmovb r9d, eax
cmp r9d, r8d
movzx eax, dl
cmovle ecx, eax
cmp r8d, edx
movzx ecx, cl
movzx eax, r9b
cmovle ecx, eax
add cl, byte [r12 + r10 - 1]
mov byte [r10 + r13 - 1], cl
sub r11, 1
jne 0x140009950
mov r13, qword [rsp + 0x68]
mov r12, qword [rsp + 0xc8]
mov r14d, dword [rsp + 0xc0]
jmp 0x140009503
mov r8, r11
mov rdx, r12
mov rcx, rbx
vzeroupper
call sub.VCRUNTIME140.dll_memcpy
mov r11, qword [rsp + 0x48]
mov rsi, qword [rsp + 0x28]
cmp r11, rsi
jge 0x140009595
mov r8, rbx
lea rcx, [r11 + r12]
sub r8, r11
mov r9, rbx
sub r8, r12
sub r9, r12
mov rdx, rsi
sub rdx, r11
nop word [rax + rax]
movzx eax, byte [rcx + r8]
lea rcx, [rcx + 1]
shr al, 1
add al, byte [rcx - 1]
mov byte [r9 + rcx - 1], al
sub rdx, 1
jne 0x140009a00
mov ecx, dword [rsp + 0xe0]
jmp 0x14000950f
mov r14b, 1
xor r8b, r8b
xor r11d, r11d
mov r9, rdi
cmp eax, 4
jne 0x140009a83
test r15d, r15d
je 0x140009b13
nop
mov r10d, r11d
and r10d, 1
jne 0x140009a4d
movzx r8d, byte [rbx]
movzx eax, r8b
movzx ecx, r14b
shr al, 4
inc r11d
movzx edx, al
lea rax, [rbx + 1]
imul edx, ecx
shl r8b, 4
mov byte [r9], dl
inc r9
test r10d, r10d
cmovne rax, rbx
mov rbx, rax
cmp r11d, r15d
jb 0x140009a40
jmp 0x140009b13
cmp eax, 2
jne 0x140009ad1
test r15d, r15d
je 0x140009b13
mov r10d, r11d
and r10d, 3
jne 0x140009a9e
movzx r8d, byte [rbx]
movzx eax, r8b
movzx ecx, r14b
shr al, 6
inc r11d
movzx edx, al
lea rax, [rbx + 1]
imul edx, ecx
shl r8b, 2
mov byte [r9], dl
inc r9
test r10d, r10d
cmovne rax, rbx
mov rbx, rax
cmp r11d, r15d
jb 0x140009a91
jmp 0x140009b13
test r15d, r15d
je 0x140009b13
mov r10d, r11d
and r10d, 7
jne 0x140009ae3
movzx r8d, byte [rbx]
movzx eax, r8b
movzx ecx, r14b
shr al, 7
add r8b, r8b
movzx edx, al
inc r11d
imul edx, ecx
lea rax, [rbx + 1]
mov byte [r9], dl
inc r9
test r10d, r10d
cmovne rax, rbx
mov rbx, rax
cmp r11d, r15d
jb 0x140009ad6
mov r14d, dword [rsp + 0xc0]
cmp r14d, dword [rsp + 0xd8]
je 0x140009d64
mov rcx, qword [rsp + 0x50]
dec rcx
cmp r14d, 1
jne 0x140009b57
test rcx, rcx
js 0x140009d64
mov byte [rdi + rcx*2 + 1], 0xff
movzx eax, byte [rcx + rdi]
mov byte [rdi + rcx*2], al
sub rcx, 1
jns 0x140009b40
jmp 0x140009d64
test rcx, rcx
js 0x140009d64
lea r8, [rcx*2 + 1]
add r8, rdi
lea rdx, [rcx*4 + 2]
add r8, rcx
add rdx, rdi
nop dword [rax]
sub rcx, 1
mov byte [rdx + 1], 0xff
movzx eax, byte [r8 + 1]
lea r8, [r8 - 3]
mov byte [rdx], al
lea rdx, [rdx - 4]
movzx eax, byte [r8 + 3]
mov byte [rdx + 3], al
movzx eax, byte [r8 + 2]
mov byte [rdx + 2], al
jns 0x140009b80
jmp 0x140009d64
jne 0x140009c5e
cmp r14d, dword [rsp + 0xd8]
jne 0x140009bd4
mov r8d, r15d
mov rdx, rbx
mov rcx, rdi
vzeroupper
call sub.VCRUNTIME140.dll_memcpy
jmp 0x140009d64
mov rcx, qword [rsp + 0x50]
dec rcx
cmp r14d, 1
jne 0x140009c07
test rcx, rcx
js 0x140009d64
nop dword [rax + rax]
mov byte [rdi + rcx*2 + 1], 0xff
movzx eax, byte [rbx + rcx]
mov byte [rdi + rcx*2], al
sub rcx, 1
jns 0x140009bf0
jmp 0x140009d64
test rcx, rcx
js 0x140009d64
lea r8, [rcx*2 + 1]
add r8, rbx
lea rdx, [rcx*4 + 2]
add r8, rcx
add rdx, rdi
nop dword [rax]
sub rcx, 1
mov byte [rdx + 1], 0xff
movzx eax, byte [r8 + 1]
lea r8, [r8 - 3]
mov byte [rdx], al
lea rdx, [rdx - 4]
movzx eax, byte [r8 + 3]
mov byte [rdx + 3], al
movzx eax, byte [r8 + 2]
mov byte [rdx + 2], al
jns 0x140009c30
jmp 0x140009d64
cmp eax, 0x10
jne 0x140009d64
cmp r14d, dword [rsp + 0xd8]
jne 0x140009cb7
mov rsi, qword [rsp + 0x20]
test r15d, r15d
je 0x140009d69
sub r13, rdi
mov edx, r15d
add r13, rsi
nop dword [rax + rax]
movzx eax, byte [rbx]
lea rbx, [rbx + 2]
movzx ecx, byte [rdi + r13 + 1]
lea rdi, [rdi + 2]
shl ax, 8
or cx, ax
mov word [rdi - 2], cx
sub rdx, 1
jne 0x140009c90
jmp 0x140009d69
cmp r14d, 1
jne 0x140009cf8
test ecx, ecx
je 0x140009d64
mov edx, ecx
nop word [rax + rax]
movzx ecx, byte [rbx]
lea rdi, [rdi + 4]
movzx eax, byte [rbx + 1]
lea rbx, [rbx + 2]
shl cx, 8
or cx, ax
mov word [rdi - 2], 0xffff
mov word [rdi - 4], cx
sub rdx, 1
jne 0x140009cd0
jmp 0x140009d5c
test ecx, ecx
je 0x140009d64
add rdi, 4
mov edx, ecx
nop dword [rax]
nop word [rax + rax]
movzx ecx, byte [rbx]
lea rdi, [rdi + 8]
movzx eax, byte [rbx + 1]
lea rbx, [rbx + 6]
shl cx, 8
or cx, ax
mov word [rdi - 0xc], cx
movzx ecx, byte [rbx - 4]
movzx eax, byte [rbx - 3]
shl cx, 8
or cx, ax
mov word [rdi - 0xa], cx
movzx ecx, byte [rbx - 2]
movzx eax, byte [rbx - 1]
shl cx, 8
or cx, ax
mov word [rdi - 6], 0xffff
mov word [rdi - 8], cx
sub rdx, 1
jne 0x140009d10
mov r14d, dword [rsp + 0xc0]
mov rsi, qword [rsp + 0x20]
mov edx, dword [rsp + 0x40]
mov r8d, 0
mov ecx, dword [rsp + 0xe0]
inc edx
mov r11, qword [rsp + 0x48]
mov r10, qword [rsp + 0x28]
mov r9d, dword [rsp + 0x38]
mov dword [rsp + 0x40], edx
cmp edx, dword [rsp + 0xe8]
jb 0x140009470
mov rcx, rsi
vzeroupper
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov eax, 1
jmp 0x140009e2a
mov rax, qword gs:[0x58]
mov edx, 0x28
mov rcx, qword [rax]
lea rax, [0x1413a1bc0]
mov qword [rdx + rcx], rax
mov rcx, r9
vzeroupper
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
jmp 0x140009e28
mov rcx, rsi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov r8d, 0
test ebx, ebx
setne r8b
mov eax, r8d
jmp 0x140009e2a
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, [0x1413a1b98]
jmp 0x140009e1f
mov qword [rdi + 0x18], r9
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, [0x1413a1aa0]
mov edx, 0x28
mov qword [rdx + rcx], rax
xor eax, eax
add rsp, 0x80
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
ret