Function at 0x14003d9e0
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 0x14003e5ae
test r9d, r9d
js 0x14003e5ae
mov ebx, 0x7fffffff
je 0x14003da84
xor edx, edx
mov eax, ebx
div r9d
cmp r14d, eax
jg 0x14003e5ae
mov r8d, r14d
imul r8d, r9d
test r8d, r8d
js 0x14003e5ae
test ecx, ecx
js 0x14003e5ae
je 0x14003daac
mov eax, ebx
cdq
idiv ecx
cmp r8d, eax
jg 0x14003e5ae
mov eax, r9d
imul eax, r11d
movsxd rcx, eax
call fcn.1400bfd90
mov qword [rdi + 0x18], rax
test rax, rax
je 0x14003e5b2
test r12d, r12d
js 0x14003e599
test r14d, r14d
je 0x14003dae6
xor edx, edx
mov eax, ebx
div r14d
cmp r12d, eax
jg 0x14003e599
imul r12d, r14d
test r12d, r12d
js 0x14003e599
test ebp, ebp
js 0x14003e599
je 0x14003db0c
xor edx, edx
mov eax, ebx
div ebp
cmp r12d, eax
jg 0x14003e599
mov eax, r12d
imul eax, ebp
cmp eax, 0x7ffffff8
jg 0x14003e599
mov ecx, dword [rsp + 0xf8]
imul ebp, r12d
add ebp, 7
shr ebp, 3
mov dword [rsp + 0x48], ebp
test ecx, ecx
je 0x14003db44
xor edx, edx
mov eax, ebx
div ecx
cmp ebp, eax
jg 0x14003e599
mov eax, ebp
sub ebx, ebp
imul eax, ecx
cmp eax, ebx
jg 0x14003e599
lea eax, [rbp + 1]
imul eax, ecx
cmp esi, eax
jae 0x14003db75
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, str.not_enough_pixels
jmp 0x14003e5c5
lea ecx, [rbp*2]
call fcn.1400bfd90
mov qword [rsp + 0x28], rax
mov r9, rax
test rax, rax
je 0x14003e5b2
movsxd rsi, dword [rsp + 0x100]
mov ebx, 1
cmp esi, 8
jge 0x14003dbb1
mov eax, ebx
mov dword [rsp + 0xd0], ebx
mov ecx, ebp
jmp 0x14003dbbb
mov eax, dword [rsp + 0xd0]
mov ecx, r14d
mov edx, r13d
mov dword [rsp + 0x44], edx
cmp dword [rsp + 0xf8], edx
jbe 0x14003e587
mov r8, qword [rdi + 0x18]
mov qword [rsp + 0x60], r8
lea r8, [0x1400fd3c8]
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
nop
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 0x14003e561
lea r8, [0x140000000]
test edx, edx
jne 0x14003dc86
mov rdx, qword [rsp + 0x68]
movzx eax, byte [rax + r8 + 0xfd3bc]
mov qword [rsp + 0x20], rdx
jmp 0x14003dc8b
mov rdx, qword [rsp + 0x20]
cmp eax, 5
ja case.default.0x14003dca1
cdqe
mov ecx, dword [r8 + rax*4 + 0x3e5ec]
add rcx, r8
jmp rcx
mov r8, rdx
mov rcx, rbx
mov rdx, r15
call fcn.1400b3fb0
jmp 0x14003e1a9
mov r8, r10
mov rdx, r15
mov rcx, rbx
call fcn.1400b3fb0
mov r10, qword [rsp + 0x38]
mov r11, qword [rsp + 0x20]
cmp r10, r11
jge 0x14003dd05
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
nop
movzx eax, byte [r8 + rcx]
add al, byte [rcx]
mov byte [r9 + rcx], al
lea rcx, [rcx + 1]
sub rdx, 1
jne 0x14003dcf0
mov rcx, qword [rsp + 0x30]
jmp 0x14003e1b3
mov r10d, dword [rsp + 0x50]
xor eax, eax
mov edx, eax
test r10d, r10d
jle 0x14003de52
cmp r10d, 8
jb 0x14003de52
lea eax, [r10 - 1]
movsxd rcx, eax
lea rax, [rcx + r15]
lea r8, [rcx + rbx]
cmp rbx, rax
ja 0x14003dd48
cmp r8, r15
jae 0x14003de52
lea rax, [rcx + r11]
cmp rbx, rax
ja 0x14003dd5a
cmp r8, r11
jae 0x14003de52
cmp r10d, 0x40
jb 0x14003ddff
mov ecx, r10d
and ecx, 0x8000003f
jge 0x14003dd76
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 0x14003dd90
mov eax, r10d
and al, 0x3f
cmp al, 8
jb 0x14003de52
jmp 0x14003de05
mov rcx, r11
sub rcx, r15
mov r8d, r10d
and r8d, 0x80000007
jge 0x14003de1b
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 0x14003de31
cmp rdx, qword [rsp + 0x20]
jge 0x14003e1a9
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 0x14003de80
jmp 0x14003e1a9
test r10, r10
jle 0x14003deca
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 0x14003deb1
mov rcx, qword [rsp + 0x20]
cmp r10, rcx
jge 0x14003e1a9
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 [r9 + rdx]
movzx eax, byte [rdx]
lea rdx, [rdx + 1]
add ecx, eax
shr ecx, 1
add cl, byte [r15 + rdx - 1]
mov byte [r10 + rdx - 1], cl
sub r8, 1
jne 0x14003df00
jmp 0x14003e1a9
mov r9d, dword [rsp + 0xd0]
xor eax, eax
mov edx, eax
test r9d, r9d
jle 0x14003e081
cmp r9d, 8
jb 0x14003e081
lea eax, [r9 - 1]
movsxd rcx, eax
lea rax, [rcx + r15]
lea r8, [rcx + rbx]
cmp rbx, rax
ja 0x14003df61
cmp r8, r15
jae 0x14003e081
lea rax, [rcx + r11]
cmp rbx, rax
ja 0x14003df73
cmp r8, r11
jae 0x14003e081
cmp r9d, 0x40
jb 0x14003e027
mov ecx, r9d
and ecx, 0x8000003f
jge 0x14003df8f
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 0x14003dfb0
mov r9d, dword [rsp + 0xd0]
mov eax, r9d
and al, 0x3f
cmp al, 8
jb 0x14003e081
jmp 0x14003e02d
mov rcx, r11
sub rcx, r15
mov r8d, r9d
and r8d, 0x80000007
jge 0x14003e043
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 0x14003e060
cmp rdx, r10
jge 0x14003e0bb
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 0x14003e0a1
mov r10, qword [rsp + 0x38]
cmp r10, qword [rsp + 0x20]
jge 0x14003e1a9
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 0x14003e0f0
mov rdi, qword [rsp + 0x70]
mov r13, qword [rsp + 0x78]
mov esi, dword [rsp + 0x100]
jmp 0x14003e1a9
mov r8, r10
mov rdx, r15
mov rcx, rbx
call fcn.1400b3fb0
mov r10, qword [rsp + 0x38]
cmp r10, qword [rsp + 0x20]
jge 0x14003e1a9
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 [r8 + rcx]
lea rcx, [rcx + 1]
shr al, 1
add al, byte [rcx - 1]
mov byte [r9 + rcx - 1], al
sub rdx, 1
jne 0x14003e190
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 0x14003e3ae
cmp dword [rsp + 0x108], 0
jne 0x14003e1e3
mov rax, qword [rsp + 0x80]
movzx r15d, byte [rax]
jmp 0x14003e1e6
mov r15b, 1
xor r8b, r8b
mov r9, rdi
cmp esi, 4
jne 0x14003e242
xor esi, esi
test r14d, r14d
je 0x14003e2dc
nop dword [rax]
mov r11d, esi
and r11d, 1
jne 0x14003e20d
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 0x14003e200
jmp 0x14003e2dc
cmp esi, 2
jne 0x14003e291
xor esi, esi
test r14d, r14d
je 0x14003e2dc
mov r11d, esi
and r11d, 3
jne 0x14003e25f
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 0x14003e252
jmp 0x14003e2dc
xor esi, esi
test r14d, r14d
je 0x14003e2dc
nop dword [rax + rax]
mov r11d, esi
and r11d, 7
jne 0x14003e2ad
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 0x14003e2a0
mov eax, dword [rsp + 0x40]
cmp eax, dword [rsp + 0xe8]
je 0x14003e312
mov rcx, qword [rsp + 0x58]
dec rcx
cmp eax, 1
jne 0x14003e359
test rcx, rcx
js 0x14003e312
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 0x14003e300
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 0x14003dc10
mov rcx, r9
call fcn.1400bd0a4
mov eax, 1
jmp 0x14003e5d0
test rcx, rcx
js 0x14003e312
lea r8, [rcx*2 + 1]
add r8, rdi
lea rdx, [rcx*4 + 2]
add r8, rcx
add rdx, rdi
nop word [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 0x14003e380
jmp 0x14003e312
jne 0x14003e45e
mov eax, dword [rsp + 0x40]
cmp eax, dword [rsp + 0xe8]
jne 0x14003e3d4
mov r8, rbp
mov rdx, rbx
mov rcx, rdi
call fcn.1400b3fb0
jmp 0x14003e321
mov rcx, qword [rsp + 0x58]
dec rcx
cmp eax, 1
jne 0x14003e407
test rcx, rcx
js 0x14003e321
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 0x14003e3f0
jmp 0x14003e321
test rcx, rcx
js 0x14003e321
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 0x14003e430
jmp 0x14003e321
cmp esi, 0x10
jne 0x14003e321
mov eax, dword [rsp + 0x40]
cmp eax, dword [rsp + 0xe8]
jne 0x14003e4b7
mov r9, qword [rsp + 0x28]
test r12d, r12d
je 0x14003e326
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 0x14003e490
jmp 0x14003e326
cmp eax, 1
mov eax, dword [rsp + 0xf0]
jne 0x14003e4fb
test eax, eax
je 0x14003e321
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 0x14003e4d0
jmp 0x14003e31a
test eax, eax
je 0x14003e321
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 0x14003e510
jmp 0x14003e31a
mov rax, qword gs:[0x58]
mov edx, 0x28
mov rcx, qword [rax]
lea rax, str.invalid_filter
mov qword [rdx + rcx], rax
mov rcx, r9
call fcn.1400bd0a4
jmp 0x14003e5ce
mov rcx, r9
call fcn.1400bd0a4
test ebx, ebx
mov rax, r13
setne al
jmp 0x14003e5d0
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, str.too_large
jmp 0x14003e5c5
mov qword [rdi + 0x18], r13
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, str.outofmem
mov edx, 0x28
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