Function at 0x140064d30
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov qword [rsp + 0x18], rbx
mov dword [rsp + 0x20], r9d
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x90
movsxd r14, dword [rsp + 0xf0]
xor r13d, r13d
mov ebp, dword [rsp + 0x100]
mov rdi, rcx
mov eax, r9d
cmp ebp, 0x10
mov r9d, dword [rsp + 0xf8]
mov r10d, r13d
sete r10b
mov esi, r8d
inc r10d
mov r15, rdx
mov ecx, r10d
imul ecx, eax
mov rax, qword [rdi]
mov r12d, dword [rax + 8]
mov r11d, ecx
imul r11d, r14d
mov eax, r12d
imul eax, r10d
mov dword [rsp + 0x40], r12d
mov dword [rsp + 0x4c], r11d
mov dword [rsp + 0xd0], eax
test r14d, r14d
js 0x14006590e
test r9d, r9d
js 0x14006590e
mov ebx, 0x7fffffff
je 0x140064dd4
xor edx, edx
mov eax, ebx
div r9d
cmp r14d, eax
jg 0x14006590e
mov r8d, r14d
imul r8d, r9d
test r8d, r8d
js 0x14006590e
test ecx, ecx
js 0x14006590e
je 0x140064dfc
mov eax, ebx
cdq
idiv ecx
cmp r8d, eax
jg 0x14006590e
mov eax, r9d
imul eax, r11d
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 0x140065912
test r12d, r12d
js 0x1400658f9
test r14d, r14d
je 0x140064e37
xor edx, edx
mov eax, ebx
div r14d
cmp r12d, eax
jg 0x1400658f9
imul r12d, r14d
test r12d, r12d
js 0x1400658f9
test ebp, ebp
js 0x1400658f9
je 0x140064e5d
xor edx, edx
mov eax, ebx
div ebp
cmp r12d, eax
jg 0x1400658f9
mov eax, r12d
imul eax, ebp
cmp eax, 0x7ffffff8
jg 0x1400658f9
mov ecx, dword [rsp + 0xf8]
imul ebp, r12d
add ebp, 7
shr ebp, 3
mov dword [rsp + 0x48], ebp
test ecx, ecx
je 0x140064e95
xor edx, edx
mov eax, ebx
div ecx
cmp ebp, eax
jg 0x1400658f9
mov eax, ebp
sub ebx, ebp
imul eax, ecx
cmp eax, ebx
jg 0x1400658f9
lea eax, [rbp + 1]
imul eax, ecx
cmp esi, eax
jae 0x140064ec6
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, str.not_enough_pixels
jmp 0x140065925
lea ecx, [rbp*2]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov qword [rsp + 0x28], rax
mov r9, rax
test rax, rax
je 0x140065912
movsxd rsi, dword [rsp + 0x100]
mov ebx, 1
cmp esi, 8
jge 0x140064f03
mov eax, ebx
mov dword [rsp + 0xd0], ebx
mov ecx, ebp
jmp 0x140064f0d
mov eax, dword [rsp + 0xd0]
mov ecx, r14d
mov edx, r13d
mov dword [rsp + 0x44], edx
cmp dword [rsp + 0xf8], edx
jbe 0x1400658e6
mov r8, qword [rdi + 0x18]
mov qword [rsp + 0x60], r8
lea r8, [0x1400efbe0]
add r8, rsi
movsxd r10, eax
imul ecx, eax
mov qword [rsp + 0x58], r14
mov r14d, r12d
mov qword [rsp + 0x80], r8
mov qword [rsp + 0x38], r10
mov ebp, r12d
movsxd rax, ecx
mov dword [rsp + 0x50], ecx
mov rcx, rax
mov qword [rsp + 0x68], rax
mov eax, edx
mov qword [rsp + 0x20], rcx
and eax, 1
mov qword [rsp + 0x78], r15
imul eax, dword [rsp + 0x48]
mov r11d, edx
not r11d
mov edi, edx
imul edi, dword [rsp + 0x4c]
and r11d, 1
imul r11d, dword [rsp + 0x48]
mov r13, r15
mov ecx, eax
mov qword [rsp + 0x30], rcx
add rdi, qword [rsp + 0x60]
lea rbx, [rax + r9]
mov qword [rsp + 0x70], rdi
movzx eax, byte [r15]
add r11, r9
inc r15
cmp eax, 4
ja 0x1400658bf
lea r8, [0x140000000]
test edx, edx
jne 0x140064fd7
mov rdx, qword [rsp + 0x68]
movzx eax, byte [rax + r8 + 0xeda14]
mov qword [rsp + 0x20], rdx
jmp 0x140064fdc
mov rdx, qword [rsp + 0x20]
cmp eax, 5
ja case.default.0x140064ff2
cdqe
mov ecx, dword [r8 + rax*4 + 0x6594c]
add rcx, r8
jmp rcx
mov r8, rdx
mov rcx, rbx
mov rdx, r15
call sub.VCRUNTIME140.dll_memcpy
jmp 0x1400654f9
mov r8, r10
mov rdx, r15
mov rcx, rbx
call sub.VCRUNTIME140.dll_memcpy
mov r10, qword [rsp + 0x38]
mov r11, qword [rsp + 0x20]
cmp r10, r11
jge 0x140065055
mov r8, rbx
lea rcx, [r10 + 1]
sub r8, r10
mov r9, rbx
sub r8, r15
add rcx, r13
sub r9, r15
mov rdx, r11
sub rdx, r10
movzx eax, byte [r8 + rcx]
add al, byte [rcx]
mov byte [r9 + rcx], al
lea rcx, [rcx + 1]
sub rdx, 1
jne 0x140065040
mov rcx, qword [rsp + 0x30]
jmp 0x140065503
mov r10d, dword [rsp + 0x50]
xor eax, eax
mov edx, eax
test r10d, r10d
jle 0x1400651a2
cmp r10d, 8
jb 0x1400651a2
lea eax, [r10 - 1]
movsxd rcx, eax
lea rax, [rcx + r15]
lea r8, [rcx + rbx]
cmp rbx, rax
ja 0x140065098
cmp r8, r15
jae 0x1400651a2
lea rax, [rcx + r11]
cmp rbx, rax
ja 0x1400650aa
cmp r8, r11
jae 0x1400651a2
cmp r10d, 0x40
jb 0x14006514f
mov ecx, r10d
and ecx, 0x8000003f
jge 0x1400650c6
dec ecx
or ecx, 0xffffffc0
inc ecx
mov eax, r10d
sub eax, ecx
mov rcx, r11
movsxd r9, eax
sub rcx, r15
lea rax, [r13 + 0x11]
mov r8, rbx
sub r8, r15
nop
movdqu xmm0, xmmword [rax - 0x10]
add rdx, 0x40
movdqu xmm1, xmmword [rcx + rax - 0x10]
movdqu xmm2, xmmword [rax + rcx]
lea rax, [rax + 0x40]
paddb xmm1, xmm0
movdqu xmm0, xmmword [rax - 0x40]
movdqu xmmword [r8 + rax - 0x50], xmm1
paddb xmm2, xmm0
movdqu xmm0, xmmword [rax - 0x30]
movdqu xmm1, xmmword [rcx + rax - 0x30]
movdqu xmmword [rax + r8 - 0x40], xmm2
paddb xmm1, xmm0
movdqu xmm0, xmmword [rax - 0x20]
movdqu xmm2, xmmword [rcx + rax - 0x20]
movdqu xmmword [r8 + rax - 0x30], xmm1
paddb xmm2, xmm0
movdqu xmmword [r8 + rax - 0x20], xmm2
cmp rdx, r9
jl 0x1400650e0
mov eax, r10d
and al, 0x3f
cmp al, 8
jb 0x1400651a2
jmp 0x140065155
mov rcx, r11
sub rcx, r15
mov r8d, r10d
and r8d, 0x80000007
jge 0x14006516b
dec r8d
or r8d, 0xfffffff8
inc r8d
mov eax, r10d
sub eax, r8d
movsxd r9, eax
mov r8, rbx
lea rax, [r13 + 1]
add rax, rdx
sub r8, r15
movq xmm1, qword [rax + rcx]
add rdx, 8
movq xmm0, qword [rax]
lea rax, [rax + 8]
paddb xmm1, xmm0
movq qword [rax + r8 - 8], xmm1
cmp rdx, r9
jl 0x140065181
cmp rdx, qword [rsp + 0x20]
jge 0x1400654f9
mov r8, qword [rsp + 0x20]
lea rcx, [r13 + 1]
mov r9, rbx
add rcx, rdx
sub r9, r15
sub r11, r15
sub r8, rdx
nop word [rax + rax]
movzx eax, byte [rcx + r11]
add al, byte [rcx]
mov byte [rcx + r9], al
lea rcx, [rcx + 1]
sub r8, 1
jne 0x1400651d0
jmp 0x1400654f9
test r10, r10
jle 0x14006521a
mov r8, r11
mov r9, rbx
sub r8, r15
mov rcx, r15
sub r9, r15
mov rdx, r10
movzx eax, byte [rcx + r8]
lea rcx, [rcx + 1]
shr al, 1
add al, byte [rcx - 1]
mov byte [rcx + r9 - 1], al
sub rdx, 1
jne 0x140065201
mov rcx, qword [rsp + 0x20]
cmp r10, rcx
jge 0x1400654f9
lea rdx, [r10 + r11]
mov r9, rbx
sub r9, r10
sub r15, r11
mov r10, rbx
sub r9, r11
sub r10, r11
mov r8, rcx
sub r8, qword [rsp + 0x38]
nop word [rax + rax]
movzx ecx, byte [rdx + r9]
movzx eax, byte [rdx]
lea rdx, [rdx + 1]
add ecx, eax
shr ecx, 1
add cl, byte [rdx + r15 - 1]
mov byte [rdx + r10 - 1], cl
sub r8, 1
jne 0x140065250
jmp 0x1400654f9
mov r9d, dword [rsp + 0xd0]
xor eax, eax
mov edx, eax
test r9d, r9d
jle 0x1400653d1
cmp r9d, 8
jb 0x1400653d1
lea eax, [r9 - 1]
movsxd rcx, eax
lea rax, [rcx + r15]
lea r8, [rcx + rbx]
cmp rbx, rax
ja 0x1400652b1
cmp r8, r15
jae 0x1400653d1
lea rax, [rcx + r11]
cmp rbx, rax
ja 0x1400652c3
cmp r8, r11
jae 0x1400653d1
cmp r9d, 0x40
jb 0x140065377
mov ecx, r9d
and ecx, 0x8000003f
jge 0x1400652df
dec ecx
or ecx, 0xffffffc0
inc ecx
mov eax, r9d
sub eax, ecx
mov rcx, r11
movsxd r9, eax
sub rcx, r15
lea rax, [r13 + 0x11]
mov r8, rbx
sub r8, r15
nop word [rax + rax]
movdqu xmm0, xmmword [rax - 0x10]
add rdx, 0x40
movdqu xmm1, xmmword [rcx + rax - 0x10]
movdqu xmm2, xmmword [rcx + rax]
lea rax, [rax + 0x40]
paddb xmm1, xmm0
movdqu xmm0, xmmword [rax - 0x40]
movdqu xmmword [r8 + rax - 0x50], xmm1
paddb xmm2, xmm0
movdqu xmm0, xmmword [rax - 0x30]
movdqu xmm1, xmmword [rcx + rax - 0x30]
movdqu xmmword [r8 + rax - 0x40], xmm2
paddb xmm1, xmm0
movdqu xmm0, xmmword [rax - 0x20]
movdqu xmm2, xmmword [rcx + rax - 0x20]
movdqu xmmword [r8 + rax - 0x30], xmm1
paddb xmm2, xmm0
movdqu xmmword [r8 + rax - 0x20], xmm2
cmp rdx, r9
jl 0x140065300
mov r9d, dword [rsp + 0xd0]
mov eax, r9d
and al, 0x3f
cmp al, 8
jb 0x1400653d1
jmp 0x14006537d
mov rcx, r11
sub rcx, r15
mov r8d, r9d
and r8d, 0x80000007
jge 0x140065393
dec r8d
or r8d, 0xfffffff8
inc r8d
mov eax, r9d
sub eax, r8d
movsxd r9, eax
mov r8, rbx
lea rax, [r13 + 1]
add rax, rdx
sub r8, r15
nop dword [rax]
movq xmm1, qword [rax + rcx]
add rdx, 8
movq xmm0, qword [rax]
lea rax, [rax + 8]
paddb xmm1, xmm0
movq qword [r8 + rax - 8], xmm1
cmp rdx, r9
jl 0x1400653b0
cmp rdx, r10
jge 0x14006540b
mov r8, qword [rsp + 0x38]
lea rcx, [r13 + 1]
mov r9, r11
mov r10, rbx
add rcx, rdx
sub r9, r15
sub r10, r15
sub r8, rdx
movzx eax, byte [r9 + rcx]
add al, byte [rcx]
mov byte [rcx + r10], al
lea rcx, [rcx + 1]
sub r8, 1
jne 0x1400653f1
mov r10, qword [rsp + 0x38]
cmp r10, qword [rsp + 0x20]
jge 0x1400654f9
mov rax, qword [rsp + 0x38]
mov rsi, r11
mov rdi, qword [rsp + 0x38]
sub rax, rbx
sub rsi, rbx
add r13, rax
mov r10, rbx
lea r15, [rax + r11]
mov r11, qword [rsp + 0x20]
sub r11, qword [rsp + 0x38]
nop dword [rax]
movzx eax, byte [r15 + r10]
movzx r9d, byte [r10]
mov edx, eax
movzx ecx, byte [rsi + r10]
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 [r10 + r13]
mov byte [r10 + rdi - 1], cl
sub r11, 1
jne 0x140065440
mov rdi, qword [rsp + 0x70]
mov r13, qword [rsp + 0x78]
mov esi, dword [rsp + 0x100]
jmp 0x1400654f9
mov r8, r10
mov rdx, r15
mov rcx, rbx
call sub.VCRUNTIME140.dll_memcpy
mov r10, qword [rsp + 0x38]
cmp r10, qword [rsp + 0x20]
jge 0x1400654f9
mov rdx, qword [rsp + 0x20]
lea rcx, [r10 + 1]
mov r8, rbx
mov r9, rbx
sub r8, r10
add rcx, r13
sub r8, r15
sub r9, r15
sub rdx, r10
nop dword [rax]
movzx eax, byte [rcx + r8]
lea rcx, [rcx + 1]
shr al, 1
add al, byte [rcx - 1]
mov byte [rcx + r9 - 1], al
sub rdx, 1
jne 0x1400654e0
mov rcx, qword [rsp + 0x30]
mov r11, qword [rsp + 0x20]
lea r15, [r13 + 1]
add r15, r11
mov qword [rsp + 0xd8], r15
cmp esi, 8
jge 0x1400656fe
cmp dword [rsp + 0x108], 0
jne 0x140065533
mov rax, qword [rsp + 0x80]
movzx r15d, byte [rax]
jmp 0x140065536
mov r15b, 1
xor r8b, r8b
mov r9, rdi
cmp esi, 4
jne 0x140065592
xor esi, esi
test r14d, r14d
je 0x14006562c
nop dword [rax]
mov r11d, esi
and r11d, 1
jne 0x14006555d
movzx r8d, byte [rbx]
movzx eax, r8b
movzx ecx, r15b
shr al, 4
inc esi
movzx edx, al
lea rax, [rbx + 1]
imul edx, ecx
shl r8b, 4
mov byte [r9], dl
inc r9
test r11d, r11d
cmovne rax, rbx
mov rbx, rax
cmp esi, r14d
jb 0x140065550
jmp 0x14006562c
cmp esi, 2
jne 0x1400655e1
xor esi, esi
test r14d, r14d
je 0x14006562c
mov r11d, esi
and r11d, 3
jne 0x1400655af
movzx r8d, byte [rbx]
movzx eax, r8b
movzx ecx, r15b
shr al, 6
inc esi
movzx edx, al
lea rax, [rbx + 1]
imul edx, ecx
shl r8b, 2
mov byte [r9], dl
inc r9
test r11d, r11d
cmovne rax, rbx
mov rbx, rax
cmp esi, r14d
jb 0x1400655a2
jmp 0x14006562c
xor esi, esi
test r14d, r14d
je 0x14006562c
nop dword [rax + rax]
mov r11d, esi
and r11d, 7
jne 0x1400655fd
movzx r8d, byte [rbx]
movzx eax, r8b
movzx ecx, r15b
shr al, 7
add r8b, r8b
movzx edx, al
inc esi
imul edx, ecx
lea rax, [rbx + 1]
mov byte [r9], dl
inc r9
test r11d, r11d
cmovne rax, rbx
mov rbx, rax
cmp esi, r14d
jb 0x1400655f0
mov eax, dword [rsp + 0x40]
cmp eax, dword [rsp + 0xe8]
je 0x140065662
mov rcx, qword [rsp + 0x58]
dec rcx
cmp eax, 1
jne 0x1400656aa
test rcx, rcx
js 0x140065662
nop dword [rax + rax]
mov byte [rdi + rcx*2 + 1], 0xff
movzx eax, byte [rcx + rdi]
mov byte [rdi + rcx*2], al
sub rcx, 1
jns 0x140065650
mov r15, qword [rsp + 0xd8]
mov esi, dword [rsp + 0x100]
mov r9, qword [rsp + 0x28]
mov edx, dword [rsp + 0x44]
mov r10, qword [rsp + 0x38]
inc edx
mov rcx, qword [rsp + 0x20]
mov dword [rsp + 0x44], edx
cmp edx, dword [rsp + 0xf8]
jb 0x140064f61
mov rcx, r9
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov eax, 1
jmp 0x140065930
test rcx, rcx
js 0x140065662
lea r8, [rcx*2 + 1]
add r8, rdi
lea rdx, [rcx*4 + 2]
add r8, rcx
add rdx, rdi
nop dword [rax + 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 0x1400656d0
jmp 0x140065662
jne 0x1400657ae
mov eax, dword [rsp + 0x40]
cmp eax, dword [rsp + 0xe8]
jne 0x140065724
mov r8, rbp
mov rdx, rbx
mov rcx, rdi
call sub.VCRUNTIME140.dll_memcpy
jmp 0x140065671
mov rcx, qword [rsp + 0x58]
dec rcx
cmp eax, 1
jne 0x140065757
test rcx, rcx
js 0x140065671
nop word [rax + rax]
mov byte [rdi + rcx*2 + 1], 0xff
movzx eax, byte [rcx + rbx]
mov byte [rdi + rcx*2], al
sub rcx, 1
jns 0x140065740
jmp 0x140065671
test rcx, rcx
js 0x140065671
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 0x140065780
jmp 0x140065671
cmp esi, 0x10
jne 0x140065671
mov eax, dword [rsp + 0x40]
cmp eax, dword [rsp + 0xe8]
jne 0x140065807
mov r9, qword [rsp + 0x28]
test r12d, r12d
je 0x140065676
sub rcx, rdi
mov edx, r12d
lea r8, [rcx + r9]
nop dword [rax]
movzx eax, byte [rbx]
lea rbx, [rbx + 2]
movzx ecx, byte [r8 + rdi + 1]
lea rdi, [rdi + 2]
shl ax, 8
or cx, ax
mov word [rdi - 2], cx
sub rdx, 1
jne 0x1400657e0
jmp 0x140065676
cmp eax, 1
mov eax, dword [rsp + 0xf0]
jne 0x140065859
test eax, eax
je 0x140065671
mov edx, eax
mov esi, 0xffff
nop dword [rax]
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], si
mov word [rdi - 4], cx
sub rdx, 1
jne 0x140065830
jmp 0x14006566a
test eax, eax
je 0x140065671
add rdi, 4
mov rdx, rax
mov esi, 0xffff
nop dword [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], si
mov word [rdi - 8], cx
sub rdx, 1
jne 0x140065870
jmp 0x14006566a
mov rax, qword gs:[0x58]
mov edx, 0x20
mov rcx, qword [rax]
lea rax, str.invalid_filter
mov qword [rdx + rcx], rax
mov rcx, r9
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
jmp 0x14006592e
mov rcx, r9
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
test ebx, ebx
mov rax, r13
setne al
jmp 0x140065930
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, str.too_large
jmp 0x140065925
mov qword [rdi + 0x18], r13
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, str.outofmem
mov edx, 0x20
mov qword [rdx + rcx], rax
xor eax, eax
mov rbx, qword [rsp + 0xe0]
add rsp, 0x90
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret