Function at 0x1400350e0
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 0x140035cb0
test r9d, r9d
js 0x140035cb0
mov ebx, 0x7fffffff
je 0x140035184
xor edx, edx
mov eax, ebx
div r9d
cmp r14d, eax
jg 0x140035cb0
mov r8d, r14d
imul r8d, r9d
test r8d, r8d
js 0x140035cb0
test ecx, ecx
js 0x140035cb0
je 0x1400351ac
mov eax, ebx
cdq
idiv ecx
cmp r8d, eax
jg 0x140035cb0
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 0x140035cb4
test r12d, r12d
js 0x140035c9b
test r14d, r14d
je 0x1400351e7
xor edx, edx
mov eax, ebx
div r14d
cmp r12d, eax
jg 0x140035c9b
imul r12d, r14d
test r12d, r12d
js 0x140035c9b
test ebp, ebp
js 0x140035c9b
je 0x14003520d
xor edx, edx
mov eax, ebx
div ebp
cmp r12d, eax
jg 0x140035c9b
mov eax, r12d
imul eax, ebp
cmp eax, 0x7ffffff8
jg 0x140035c9b
mov ecx, dword [rsp + 0xf8]
imul ebp, r12d
add ebp, 7
shr ebp, 3
mov dword [rsp + 0x48], ebp
test ecx, ecx
je 0x140035245
xor edx, edx
mov eax, ebx
div ecx
cmp ebp, eax
jg 0x140035c9b
mov eax, ebp
sub ebx, ebp
imul eax, ecx
cmp eax, ebx
jg 0x140035c9b
lea eax, [rbp + 1]
imul eax, ecx
cmp esi, eax
jae 0x140035276
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, str.not_enough_pixels
jmp 0x140035cc7
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 0x140035cb4
movsxd rsi, dword [rsp + 0x100]
mov ebx, 1
cmp esi, 8
jge 0x1400352b3
mov eax, ebx
mov dword [rsp + 0xd0], ebx
mov ecx, ebp
jmp 0x1400352bd
mov eax, dword [rsp + 0xd0]
mov ecx, r14d
mov edx, r13d
mov dword [rsp + 0x44], edx
cmp dword [rsp + 0xf8], edx
jbe 0x140035c88
mov r8, qword [rdi + 0x18]
mov qword [rsp + 0x60], r8
lea r8, [0x140064e88]
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 0x140035c61
lea r8, [0x140000000]
test edx, edx
jne 0x140035387
mov rdx, qword [rsp + 0x68]
movzx eax, byte [rax + r8 + 0x64e7c]
mov qword [rsp + 0x20], rdx
jmp 0x14003538c
mov rdx, qword [rsp + 0x20]
cmp eax, 5
ja case.default.0x1400353a2
cdqe
mov ecx, dword [r8 + rax*4 + 0x35cf0]
add rcx, r8
jmp rcx
mov r8, rdx
mov rcx, rbx
mov rdx, r15
call sub.VCRUNTIME140.dll_memcpy
jmp 0x1400358a9
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 0x140035405
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 0x1400353f0
mov rcx, qword [rsp + 0x30]
jmp 0x1400358b3
mov r10d, dword [rsp + 0x50]
xor eax, eax
mov edx, eax
test r10d, r10d
jle 0x140035552
cmp r10d, 8
jb 0x140035552
lea eax, [r10 - 1]
movsxd rcx, eax
lea rax, [rcx + r15]
lea r8, [rcx + rbx]
cmp rbx, rax
ja 0x140035448
cmp r8, r15
jae 0x140035552
lea rax, [rcx + r11]
cmp rbx, rax
ja 0x14003545a
cmp r8, r11
jae 0x140035552
cmp r10d, 0x40
jb 0x1400354ff
mov ecx, r10d
and ecx, 0x8000003f
jge 0x140035476
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 0x140035490
mov eax, r10d
and al, 0x3f
cmp al, 8
jb 0x140035552
jmp 0x140035505
mov rcx, r11
sub rcx, r15
mov r8d, r10d
and r8d, 0x80000007
jge 0x14003551b
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 0x140035531
cmp rdx, qword [rsp + 0x20]
jge 0x1400358a9
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 0x140035580
jmp 0x1400358a9
test r10, r10
jle 0x1400355ca
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 0x1400355b1
mov rcx, qword [rsp + 0x20]
cmp r10, rcx
jge 0x1400358a9
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 0x140035600
jmp 0x1400358a9
mov r9d, dword [rsp + 0xd0]
xor eax, eax
mov edx, eax
test r9d, r9d
jle 0x140035781
cmp r9d, 8
jb 0x140035781
lea eax, [r9 - 1]
movsxd rcx, eax
lea rax, [rcx + r15]
lea r8, [rcx + rbx]
cmp rbx, rax
ja 0x140035661
cmp r8, r15
jae 0x140035781
lea rax, [rcx + r11]
cmp rbx, rax
ja 0x140035673
cmp r8, r11
jae 0x140035781
cmp r9d, 0x40
jb 0x140035727
mov ecx, r9d
and ecx, 0x8000003f
jge 0x14003568f
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 0x1400356b0
mov r9d, dword [rsp + 0xd0]
mov eax, r9d
and al, 0x3f
cmp al, 8
jb 0x140035781
jmp 0x14003572d
mov rcx, r11
sub rcx, r15
mov r8d, r9d
and r8d, 0x80000007
jge 0x140035743
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 0x140035760
cmp rdx, r10
jge 0x1400357bb
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 0x1400357a1
mov r10, qword [rsp + 0x38]
cmp r10, qword [rsp + 0x20]
jge 0x1400358a9
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 0x1400357f0
mov rdi, qword [rsp + 0x70]
mov r13, qword [rsp + 0x78]
mov esi, dword [rsp + 0x100]
jmp 0x1400358a9
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 0x1400358a9
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 0x140035890
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 0x140035aae
cmp dword [rsp + 0x108], 0
jne 0x1400358e3
mov rax, qword [rsp + 0x80]
movzx r15d, byte [rax]
jmp 0x1400358e6
mov r15b, 1
xor r8b, r8b
mov r9, rdi
cmp esi, 4
jne 0x140035942
xor esi, esi
test r14d, r14d
je 0x1400359dc
nop dword [rax]
mov r11d, esi
and r11d, 1
jne 0x14003590d
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 0x140035900
jmp 0x1400359dc
cmp esi, 2
jne 0x140035991
xor esi, esi
test r14d, r14d
je 0x1400359dc
mov r11d, esi
and r11d, 3
jne 0x14003595f
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 0x140035952
jmp 0x1400359dc
xor esi, esi
test r14d, r14d
je 0x1400359dc
nop dword [rax + rax]
mov r11d, esi
and r11d, 7
jne 0x1400359ad
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 0x1400359a0
mov eax, dword [rsp + 0x40]
cmp eax, dword [rsp + 0xe8]
je 0x140035a12
mov rcx, qword [rsp + 0x58]
dec rcx
cmp eax, 1
jne 0x140035a5a
test rcx, rcx
js 0x140035a12
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 0x140035a00
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 0x140035311
mov rcx, r9
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov eax, 1
jmp 0x140035cd2
test rcx, rcx
js 0x140035a12
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 0x140035a80
jmp 0x140035a12
jne 0x140035b5e
mov eax, dword [rsp + 0x40]
cmp eax, dword [rsp + 0xe8]
jne 0x140035ad4
mov r8, rbp
mov rdx, rbx
mov rcx, rdi
call sub.VCRUNTIME140.dll_memcpy
jmp 0x140035a21
mov rcx, qword [rsp + 0x58]
dec rcx
cmp eax, 1
jne 0x140035b07
test rcx, rcx
js 0x140035a21
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 0x140035af0
jmp 0x140035a21
test rcx, rcx
js 0x140035a21
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 0x140035b30
jmp 0x140035a21
cmp esi, 0x10
jne 0x140035a21
mov eax, dword [rsp + 0x40]
cmp eax, dword [rsp + 0xe8]
jne 0x140035bb7
mov r9, qword [rsp + 0x28]
test r12d, r12d
je 0x140035a26
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 0x140035b90
jmp 0x140035a26
cmp eax, 1
mov eax, dword [rsp + 0xf0]
jne 0x140035bfb
test eax, eax
je 0x140035a21
mov edx, eax
nop dword [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 0x140035bd0
jmp 0x140035a1a
test eax, eax
je 0x140035a21
add rdi, 4
mov rdx, 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 0x140035c10
jmp 0x140035a1a
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 0x140035cd0
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 0x140035cd2
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, str.too_large
jmp 0x140035cc7
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