Function at 0x14017da40
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push rbp
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbx
sub rsp, 0x88
lea rbp, [rsp + 0x80]
movdqa xmmword [rbp - 0x10], xmm6
mov qword [rbp - 0x18], 0xfffffffffffffffe
mov word [rbp - 0x58], r9w
mov qword [rbp - 0x60], rcx
test r8, r8
je 0x14017e7b8
mov rdi, rdx
movzx r14d, byte [rdx + 0x19]
cmp r8, 1
mov qword [rbp - 0x30], r8
jne 0x14017da9b
movzx ebx, byte [rdi + 0x1a]
mov r15d, 0x28
jmp 0x14017e297
movabs rax, 0x7ffffffffffffff
lea rcx, [r8 + rax]
and rax, rcx
cmp rax, 8
jae 0x14017dab9
xor edx, edx
jmp 0x14017de52
cmp rax, 0x20
jae 0x14017dac6
xor edx, edx
jmp 0x14017dd69
mov r8d, ecx
and r8d, 0x1f
mov rdx, rax
sub rdx, r8
movzx r9d, r14b
movd xmm0, r9d
punpcklbw xmm0, xmm0
pshuflw xmm0, xmm0, 0
pshufd xmm0, xmm0, 0
lea r9, [rdi + 0x419]
mov r10, rdx
movdqa xmm1, xmm0
nop dword [rax + rax]
movzx r11d, byte [r9 - 0x200]
movd xmm2, r11d
movzx r11d, byte [r9 - 0x220]
movd xmm3, r11d
punpcklbw xmm3, xmm2
movzx r11d, byte [r9 - 0x240]
movd xmm2, r11d
movzx r11d, byte [r9 - 0x260]
movd xmm4, r11d
punpcklbw xmm4, xmm2
punpcklwd xmm4, xmm3
movzx r11d, byte [r9 - 0x280]
movd xmm2, r11d
movzx r11d, byte [r9 - 0x2a0]
movd xmm3, r11d
punpcklbw xmm3, xmm2
movzx r11d, byte [r9 - 0x2c0]
movd xmm5, r11d
movzx r11d, byte [r9 - 0x2e0]
movd xmm2, r11d
punpcklbw xmm2, xmm5
punpcklwd xmm2, xmm3
punpckldq xmm2, xmm4
movzx r11d, byte [r9 - 0x300]
movd xmm3, r11d
movzx r11d, byte [r9 - 0x320]
movd xmm4, r11d
punpcklbw xmm4, xmm3
movzx r11d, byte [r9 - 0x340]
movd xmm3, r11d
movzx r11d, byte [r9 - 0x360]
movd xmm5, r11d
punpcklbw xmm5, xmm3
punpcklwd xmm5, xmm4
movzx r11d, byte [r9 - 0x380]
movd xmm3, r11d
movzx r11d, byte [r9 - 0x3a0]
movd xmm4, r11d
punpcklbw xmm4, xmm3
movzx r11d, byte [r9 - 0x3c0]
movd xmm3, r11d
movzx r11d, byte [r9 - 0x3e0]
movd xmm6, r11d
punpcklbw xmm6, xmm3
punpcklwd xmm6, xmm4
punpckldq xmm6, xmm5
punpcklqdq xmm6, xmm2
pmaxub xmm0, xmm6
movzx r11d, byte [r9]
movd xmm2, r11d
movzx r11d, byte [r9 - 0x20]
movd xmm3, r11d
punpcklbw xmm3, xmm2
movzx r11d, byte [r9 - 0x40]
movd xmm2, r11d
movzx r11d, byte [r9 - 0x60]
movd xmm4, r11d
punpcklbw xmm4, xmm2
punpcklwd xmm4, xmm3
movzx r11d, byte [r9 - 0x80]
movd xmm2, r11d
movzx r11d, byte [r9 - 0xa0]
movd xmm3, r11d
punpcklbw xmm3, xmm2
movzx r11d, byte [r9 - 0xc0]
movd xmm5, r11d
movzx r11d, byte [r9 - 0xe0]
movd xmm2, r11d
punpcklbw xmm2, xmm5
punpcklwd xmm2, xmm3
punpckldq xmm2, xmm4
movzx r11d, byte [r9 - 0x100]
movd xmm3, r11d
movzx r11d, byte [r9 - 0x120]
movd xmm4, r11d
punpcklbw xmm4, xmm3
movzx r11d, byte [r9 - 0x140]
movd xmm3, r11d
movzx r11d, byte [r9 - 0x160]
movd xmm5, r11d
punpcklbw xmm5, xmm3
punpcklwd xmm5, xmm4
movzx r11d, byte [r9 - 0x180]
movd xmm3, r11d
movzx r11d, byte [r9 - 0x1a0]
movd xmm4, r11d
punpcklbw xmm4, xmm3
movzx r11d, byte [r9 - 0x1c0]
movd xmm3, r11d
movzx r11d, byte [r9 - 0x1e0]
movd xmm6, r11d
punpcklbw xmm6, xmm3
punpcklwd xmm6, xmm4
punpckldq xmm6, xmm5
punpcklqdq xmm6, xmm2
pmaxub xmm1, xmm6
add r9, 0x400
add r10, 0xffffffffffffffe0
jne 0x14017db00
pmaxub xmm0, xmm1
pshufd xmm1, xmm0, 0xee
pmaxub xmm1, xmm0
pshufd xmm0, xmm1, 0x55
pmaxub xmm0, xmm1
movdqa xmm1, xmm0
psrld xmm1, 0x10
pmaxub xmm1, xmm0
movdqa xmm0, xmm1
psrlw xmm0, 8
pmaxub xmm0, xmm1
movd r14d, xmm0
test r8, r8
je 0x14017de9c
cmp r8d, 8
jb 0x14017de52
mov r9, rdx
mov r8d, ecx
and r8d, 7
mov rdx, rax
sub rdx, r8
movzx r10d, r14b
movd xmm0, r10d
punpcklbw xmm0, xmm0
pshuflw xmm0, xmm0, 0
mov r10, r9
shl r10, 5
add r10, rdi
add r10, 0x119
add r9, r8
sub r9, rax
nop word cs:[rax + rax]
movzx r11d, byte [r10 - 0xe0]
movzx esi, byte [r10 - 0xa0]
movzx ebx, byte [r10 - 0x60]
movzx r14d, byte [r10 - 0x20]
movzx r15d, byte [r10 - 0x80]
shl r15d, 8
or r15d, esi
movzx esi, byte [r10 - 0xc0]
shl esi, 8
or esi, r11d
movd xmm1, esi
pinsrw xmm1, r15d, 1
movzx r11d, byte [r10 - 0x40]
shl r11d, 8
or r11d, ebx
pinsrw xmm1, r11d, 2
movzx r11d, byte [r10]
shl r11d, 8
or r11d, r14d
pinsrw xmm1, r11d, 3
pmaxub xmm0, xmm1
add r10, 0x100
add r9, 8
jne 0x14017ddb0
pshufd xmm1, xmm0, 0x55
pmaxub xmm1, xmm0
movdqa xmm0, xmm1
psrld xmm0, 0x10
pmaxub xmm0, xmm1
movdqa xmm1, xmm0
psrlw xmm1, 8
pmaxub xmm1, xmm0
movd r14d, xmm1
mov esi, r14d
test r8, r8
je 0x14017de8a
mov r8, rax
sub r8, rdx
shl rdx, 5
add rdx, rdi
add rdx, 0x39
nop word cs:[rax + rax]
movzx esi, byte [rdx]
movzx r9d, r14b
cmp r9b, sil
cmova esi, r9d
add rdx, 0x20
mov r14d, esi
dec r8
jne 0x14017de70
movzx r9d, byte [rdi + 0x1a]
cmp rax, 8
jae 0x14017deaa
xor edx, edx
jmp 0x14017e234
mov esi, r14d
movzx r9d, byte [rdi + 0x1a]
cmp rax, 8
jb 0x14017de95
cmp rax, 0x20
jae 0x14017deb7
xor edx, edx
jmp 0x14017e159
mov r8d, ecx
and r8d, 0x1f
mov rdx, rax
sub rdx, r8
movzx r9d, r9b
movd xmm0, r9d
punpcklbw xmm0, xmm0
pshuflw xmm0, xmm0, 0
pshufd xmm0, xmm0, 0
lea r9, [rdi + 0x41a]
mov r10, rdx
movdqa xmm1, xmm0
nop dword [rax]
movzx r11d, byte [r9 - 0x200]
movd xmm2, r11d
movzx r11d, byte [r9 - 0x220]
movd xmm3, r11d
punpcklbw xmm3, xmm2
movzx r11d, byte [r9 - 0x240]
movd xmm2, r11d
movzx r11d, byte [r9 - 0x260]
movd xmm4, r11d
punpcklbw xmm4, xmm2
punpcklwd xmm4, xmm3
movzx r11d, byte [r9 - 0x280]
movd xmm2, r11d
movzx r11d, byte [r9 - 0x2a0]
movd xmm3, r11d
punpcklbw xmm3, xmm2
movzx r11d, byte [r9 - 0x2c0]
movd xmm5, r11d
movzx r11d, byte [r9 - 0x2e0]
movd xmm2, r11d
punpcklbw xmm2, xmm5
punpcklwd xmm2, xmm3
punpckldq xmm2, xmm4
movzx r11d, byte [r9 - 0x300]
movd xmm3, r11d
movzx r11d, byte [r9 - 0x320]
movd xmm4, r11d
punpcklbw xmm4, xmm3
movzx r11d, byte [r9 - 0x340]
movd xmm3, r11d
movzx r11d, byte [r9 - 0x360]
movd xmm5, r11d
punpcklbw xmm5, xmm3
punpcklwd xmm5, xmm4
movzx r11d, byte [r9 - 0x380]
movd xmm3, r11d
movzx r11d, byte [r9 - 0x3a0]
movd xmm4, r11d
punpcklbw xmm4, xmm3
movzx r11d, byte [r9 - 0x3c0]
movd xmm3, r11d
movzx r11d, byte [r9 - 0x3e0]
movd xmm6, r11d
punpcklbw xmm6, xmm3
punpcklwd xmm6, xmm4
punpckldq xmm6, xmm5
punpcklqdq xmm6, xmm2
pmaxub xmm0, xmm6
movzx r11d, byte [r9]
movd xmm2, r11d
movzx r11d, byte [r9 - 0x20]
movd xmm3, r11d
punpcklbw xmm3, xmm2
movzx r11d, byte [r9 - 0x40]
movd xmm2, r11d
movzx r11d, byte [r9 - 0x60]
movd xmm4, r11d
punpcklbw xmm4, xmm2
punpcklwd xmm4, xmm3
movzx r11d, byte [r9 - 0x80]
movd xmm2, r11d
movzx r11d, byte [r9 - 0xa0]
movd xmm3, r11d
punpcklbw xmm3, xmm2
movzx r11d, byte [r9 - 0xc0]
movd xmm5, r11d
movzx r11d, byte [r9 - 0xe0]
movd xmm2, r11d
punpcklbw xmm2, xmm5
punpcklwd xmm2, xmm3
punpckldq xmm2, xmm4
movzx r11d, byte [r9 - 0x100]
movd xmm3, r11d
movzx r11d, byte [r9 - 0x120]
movd xmm4, r11d
punpcklbw xmm4, xmm3
movzx r11d, byte [r9 - 0x140]
movd xmm3, r11d
movzx r11d, byte [r9 - 0x160]
movd xmm5, r11d
punpcklbw xmm5, xmm3
punpcklwd xmm5, xmm4
movzx r11d, byte [r9 - 0x180]
movd xmm3, r11d
movzx r11d, byte [r9 - 0x1a0]
movd xmm4, r11d
punpcklbw xmm4, xmm3
movzx r11d, byte [r9 - 0x1c0]
movd xmm3, r11d
movzx r11d, byte [r9 - 0x1e0]
movd xmm6, r11d
punpcklbw xmm6, xmm3
punpcklwd xmm6, xmm4
punpckldq xmm6, xmm5
punpcklqdq xmm6, xmm2
pmaxub xmm1, xmm6
add r9, 0x400
add r10, 0xffffffffffffffe0
jne 0x14017def0
pmaxub xmm0, xmm1
pshufd xmm1, xmm0, 0xee
pmaxub xmm1, xmm0
pshufd xmm0, xmm1, 0x55
pmaxub xmm0, xmm1
movdqa xmm1, xmm0
psrld xmm1, 0x10
pmaxub xmm1, xmm0
movdqa xmm0, xmm1
psrlw xmm0, 8
pmaxub xmm0, xmm1
movd r9d, xmm0
test r8, r8
je 0x14017e752
cmp r8d, 8
jb 0x14017e234
mov r8, rdx
and ecx, 7
mov rdx, rax
sub rdx, rcx
movzx r9d, r9b
movd xmm0, r9d
punpcklbw xmm0, xmm0
pshuflw xmm0, xmm0, 0
mov r9, r8
shl r9, 5
add r9, rdi
add r9, 0x11a
add r8, rcx
sub r8, rax
nop
movzx r10d, byte [r9 - 0xe0]
movzx r11d, byte [r9 - 0xa0]
movzx ebx, byte [r9 - 0x60]
movzx r14d, byte [r9 - 0x20]
movzx r15d, byte [r9 - 0x80]
shl r15d, 8
or r15d, r11d
movzx r11d, byte [r9 - 0xc0]
shl r11d, 8
or r11d, r10d
movd xmm1, r11d
pinsrw xmm1, r15d, 1
movzx r10d, byte [r9 - 0x40]
shl r10d, 8
or r10d, ebx
pinsrw xmm1, r10d, 2
movzx r10d, byte [r9]
shl r10d, 8
or r10d, r14d
pinsrw xmm1, r10d, 3
pmaxub xmm0, xmm1
add r9, 0x100
add r8, 8
jne 0x14017e190
pshufd xmm1, xmm0, 0x55
pmaxub xmm1, xmm0
movdqa xmm0, xmm1
psrld xmm0, 0x10
pmaxub xmm0, xmm1
movdqa xmm1, xmm0
psrlw xmm1, 8
pmaxub xmm1, xmm0
movd r9d, xmm1
mov ebx, r9d
test rcx, rcx
je 0x14017e268
sub rax, rdx
shl rdx, 5
lea rcx, [rdx + rdi]
add rcx, 0x3a
nop word cs:[rax + rax]
movzx ebx, byte [rcx]
movzx edx, r9b
cmp dl, bl
cmova ebx, edx
add rcx, 0x20
mov r9d, ebx
dec rax
jne 0x14017e250
movabs rax, 0x333333333333334
mov rcx, qword [rbp - 0x30]
cmp rcx, rax
jae 0x14017e76c
lea rax, [rcx*8]
lea r15, [rax + rax*4]
test r15, r15
je 0x14017e677
mov r14d, esi
movzx eax, byte [0x1402f7215]
mov edx, 8
mov rcx, r15
call fcn.1400a8e60
mov esi, r14d
mov rcx, qword [rbp - 0x30]
test rax, rax
je 0x14017e688
mov qword [rbp - 0x50], rax
mov qword [rbp - 0x48], rcx
mov qword [rbp - 0x40], 0
shl rcx, 5
mov qword [rbp - 0x38], rcx
xor r14d, r14d
xor edx, edx
jmp 0x14017e325
mov rdx, qword [rbp - 0x40]
mov rax, qword [rbp - 0x50]
lea rcx, [rdx + rdx*4]
mov rdx, qword [rbp - 0x20]
mov qword [rax + rcx*8], rdx
mov rdx, qword [rbp - 0x28]
mov qword [rax + rcx*8 + 8], rdx
mov qword [rax + rcx*8 + 0x10], r12
mov qword [rax + rcx*8 + 0x18], r13
mov qword [rax + rcx*8 + 0x20], r15
mov rdx, qword [rbp - 0x40]
inc rdx
mov qword [rbp - 0x40], rdx
add r14, 0x20
cmp qword [rbp - 0x38], r14
je 0x14017e494
cmp word [rbp + 0x70], 1
sete r9b
cmp word [rbp - 0x58], 1
sete r8b
movzx r11d, byte [rdi + r14 + 0x19]
movzx ecx, byte [rdi + r14 + 0x1a]
cmp r11b, sil
sete al
or al, r8b
cmp cl, bl
sete r8b
or r8b, r9b
cmp al, 1
jne 0x14017e380
test r8b, r8b
je 0x14017e380
mov eax, 1
mov qword [rbp - 0x20], rax
lea rax, fcn.14000a190
jmp 0x14017e460
lea r9d, [r11 + r11]
cmp r9b, sil
sete r10b
test r10b, r8b
je 0x14017e3b0
mov eax, 1
mov qword [rbp - 0x20], rax
lea rax, fcn.14000a190
jmp 0x14017e460
lea r8d, [rcx + rcx]
cmp r8b, bl
sete r10b
test al, r10b
je 0x14017e3d5
mov eax, 1
mov qword [rbp - 0x20], rax
lea rax, fcn.14000a190
jmp 0x14017e460
cmp r9b, sil
jne 0x14017e3f1
cmp r8b, bl
jne 0x14017e3f1
mov eax, 1
mov qword [rbp - 0x20], rax
lea rax, fcn.14000a190
jmp 0x14017e460
test r11b, r11b
je 0x14017e773
movzx eax, sil
div r11b
mov r12d, eax
movzx eax, ah
test al, al
jne 0x14017e697
test cl, cl
je 0x14017e78d
movzx eax, bl
div cl
mov r13d, eax
movzx eax, ah
test al, al
jne 0x14017e697
movzx eax, byte [0x1402f7215]
mov ecx, 2
mov edx, 1
call fcn.1400a8e60
test rax, rax
je 0x14017e7a7
mov byte [rax], r12b
mov qword [rbp - 0x20], rax
mov byte [rax + 1], r13b
mov rdx, qword [rbp - 0x40]
lea rax, fcn.14000a190
nop
mov qword [rbp - 0x28], rax
movzx r12d, word [rdi + r14 + 0x10]
movzx r13d, word [rdi + r14 + 0x12]
movzx r15d, word [rdi + r14 + 0x14]
imul r15, qword [rdi + r14 + 8]
cmp rdx, qword [rbp - 0x48]
jne 0x14017e2e4
lea rcx, [rbp - 0x50]
call fcn.14007c7d0
jmp 0x14017e2e0
movzx edx, word [rdi + 0x10]
mov rcx, qword [rbp - 0x30]
cmp rcx, 1
jne 0x14017e4ab
mov rbx, qword [rbp - 0x60]
jmp 0x14017e634
movabs rax, 0x7ffffffffffffff
add rcx, rax
and rax, rcx
cmp rax, 0x10
mov rbx, qword [rbp - 0x60]
jae 0x14017e4cc
xor ecx, ecx
jmp 0x14017e60d
and ecx, 0xf
mov r8, rcx
mov rcx, rax
mov r9, r8
sub rcx, r8
movd xmm0, edx
pshuflw xmm0, xmm0, 0
pshufd xmm0, xmm0, 0
lea rdx, [rdi + 0x210]
mov r8, rcx
movdqa xmm3, xmm0
nop word [rax + rax]
movdqa xmm1, xmm3
movdqa xmm2, xmm0
movd xmm0, dword [rdx - 0x100]
movd xmm3, dword [rdx - 0x120]
punpcklwd xmm3, xmm0
movd xmm0, dword [rdx - 0x140]
movd xmm4, dword [rdx - 0x160]
punpcklwd xmm4, xmm0
punpckldq xmm4, xmm3
movd xmm0, dword [rdx - 0x180]
movd xmm3, dword [rdx - 0x1a0]
punpcklwd xmm3, xmm0
movd xmm5, dword [rdx - 0x1c0]
movd xmm0, dword [rdx - 0x1e0]
punpcklwd xmm0, xmm5
punpckldq xmm0, xmm3
punpcklqdq xmm0, xmm4
movd xmm3, dword [rdx]
movd xmm4, dword [rdx - 0x20]
punpcklwd xmm4, xmm3
movd xmm3, dword [rdx - 0x40]
movd xmm5, dword [rdx - 0x60]
punpcklwd xmm5, xmm3
punpckldq xmm5, xmm4
movd xmm3, dword [rdx - 0x80]
movd xmm4, dword [rdx - 0xa0]
punpcklwd xmm4, xmm3
movd xmm6, dword [rdx - 0xc0]
movd xmm3, dword [rdx - 0xe0]
punpcklwd xmm3, xmm6
punpckldq xmm3, xmm4
punpcklqdq xmm3, xmm5
psubusw xmm0, xmm2
paddw xmm0, xmm2
psubusw xmm3, xmm1
paddw xmm3, xmm1
add rdx, 0x200
add r8, 0xfffffffffffffff0
jne 0x14017e500
psubusw xmm3, xmm0
paddw xmm3, xmm0
pshufd xmm0, xmm3, 0xee
psubusw xmm0, xmm3
paddw xmm0, xmm3
pshufd xmm1, xmm0, 0x55
psubusw xmm1, xmm0
paddw xmm1, xmm0
movdqa xmm0, xmm1
psrld xmm0, 0x10
psubusw xmm0, xmm1
paddw xmm0, xmm1
movd edx, xmm0
test r9, r9
je 0x14017e634
sub rax, rcx
shl rcx, 5
add rcx, rdi
add rcx, 0x30
nop dword [rax + rax]
mov r8d, dword [rcx]
cmp dx, r8w
cmovbe edx, r8d
add rcx, 0x20
dec rax
jne 0x14017e620
movzx eax, dx
movzx ecx, sil
imul rcx, rax
mov rax, qword [rbp - 0x40]
mov qword [rbx + 0x18], rax
movdqu xmm0, xmmword [rbp - 0x50]
movdqu xmmword [rbx + 8], xmm0
mov qword [rbx + 0x20], rcx
mov qword [rbx], 0
mov rax, rbx
movaps xmm6, xmmword [rbp - 0x10]
add rsp, 0x88
pop rbx
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
pop rbp
ret
mov eax, 8
xor r15d, r15d
test rax, rax
jne 0x14017e2bb
mov ecx, 8
mov rdx, r15
call fcn.1401fbeb0
ud2
mov rbx, qword [rbp - 0x60]
mov word [rbx + 8], 0x601
mov rax, qword [rbp - 0x20]
mov qword [rbx + 0x10], rax
mov rax, qword [rbp - 0x28]
mov qword [rbx + 0x18], rax
mov qword [rbx], 1
mov qword [rbp - 0x38], rdx
test rdx, rdx
je 0x14017e729
mov rax, qword [rbp - 0x50]
mov rsi, qword [rbp - 0x38]
neg rsi
mov qword [rbp - 0x30], rax
lea rdi, [rax + 8]
mov ecx, 1
jmp 0x14017e6f8
mov rcx, qword [rbp - 0x20]
lea rax, [rsi + rcx]
inc rax
inc rcx
add rdi, 0x28
cmp rax, 1
je 0x14017e729
mov qword [rbp - 0x20], rcx
mov rcx, qword [rdi - 8]
mov rax, qword [rdi]
mov qword [rbp - 0x58], rcx
mov qword [rbp - 0x28], rax
call qword [rax]
mov rax, qword [rbp - 0x28]
mov rdx, qword [rax + 8]
test rdx, rdx
je 0x14017e6e0
mov r8, qword [rax + 0x10]
mov rcx, qword [rbp - 0x58]
call fcn.1400a8e70
jmp 0x14017e6e0
mov rax, qword [rbp - 0x48]
test rax, rax
je 0x14017e65c
mov rcx, qword [rbp - 0x50]
shl rax, 3
lea rdx, [rax + rax*4]
mov r8d, 8
call fcn.1400a8e70
jmp 0x14017e65c
mov ebx, r9d
movabs rax, 0x333333333333334
mov rcx, qword [rbp - 0x30]
cmp rcx, rax
jb 0x14017e27f
call fcn.1401e15a0
ud2
lea rcx, str.attempt_to_calculate_the_remainder_with_a_divisor_of_zero
lea r8, [0x14026bde0]
mov edx, 0x39
call fcn.1401fc0d0
jmp 0x14017e7b6
lea rcx, str.attempt_to_calculate_the_remainder_with_a_divisor_of_zero
lea r8, [0x14026be40]
mov edx, 0x39
call fcn.1401fc0d0
jmp 0x14017e7b6
mov ecx, 1
mov edx, 2
call fcn.1401fbeb0
ud2
lea rcx, str.called__Option::unwrap____on_a__None__valueC:Usershp.cargo_registry_srcindex.crates.io_6f17d22bba15001fjpeg_decoder_0.3.0_srcupsampler.rs
lea r8, [0x14026bd98]
mov edx, 0x2b
call fcn.1401fc0d0
ud2