Function at 0x1800b7de0
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov qword [rsp + 0x10], rbx
mov dword [rsp + 0x20], r9d
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x60
mov r12d, dword [rsp + 0xc0]
mov eax, r9d
movsxd rbp, dword [rsp + 0xd0]
xor r9d, r9d
mov r11d, dword [rsp + 0xc8]
mov rdi, rcx
cmp ebp, 0x10
mov dword [rsp + 0x28], r12d
mov r10d, r9d
mov esi, r8d
sete r10b
mov r13, rdx
inc r10d
mov ecx, r10d
imul ecx, eax
mov rax, qword [rdi]
mov r15d, dword [rax + 8]
mov r14d, ecx
imul r14d, r12d
mov eax, r15d
imul eax, r10d
mov dword [rsp + 0x3c], r15d
mov dword [rsp + 0x40], r14d
mov dword [rsp + 0x2c], eax
test r12d, r12d
js 0x1800b89a7
test r11d, r11d
js 0x1800b89a7
mov ebx, 0x7fffffff
je 0x1800b7e84
xor edx, edx
mov eax, ebx
div r11d
cmp r12d, eax
jg 0x1800b89a7
mov r8d, r12d
imul r8d, r11d
test r8d, r8d
js 0x1800b89a7
test ecx, ecx
js 0x1800b89a7
je 0x1800b7eac
mov eax, ebx
cdq
idiv ecx
cmp r8d, eax
jg 0x1800b89a7
mov eax, r11d
imul eax, r14d
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 0x1800b89ab
test r15d, r15d
js 0x1800b898b
test r12d, r12d
je 0x1800b7ee7
xor edx, edx
mov eax, ebx
div r12d
cmp r15d, eax
jg 0x1800b898b
mov r14d, r15d
imul r14d, r12d
test r14d, r14d
js 0x1800b898b
test ebp, ebp
js 0x1800b898b
je 0x1800b7f10
xor edx, edx
mov eax, ebx
div ebp
cmp r14d, eax
jg 0x1800b898b
mov eax, r14d
imul eax, ebp
cmp eax, 0x7ffffff8
jg 0x1800b898b
mov ecx, dword [rsp + 0xc8]
mov r12d, ebp
imul r12d, r14d
add r12d, 7
shr r12d, 3
mov dword [rsp + 0xa0], r12d
test ecx, ecx
je 0x1800b7f52
xor edx, edx
mov eax, ebx
div ecx
cmp r12d, eax
jg 0x1800b898b
mov eax, r12d
sub ebx, r12d
imul eax, ecx
cmp eax, ebx
jg 0x1800b898b
lea eax, [r12 + 1]
imul eax, ecx
cmp esi, eax
jae 0x1800b7f8e
mov edx, dword [0x18013b348]
mov rax, qword gs:[0x58]
mov rax, qword [rax + rdx*8]
lea rdx, str.not_enough_pixels
jmp 0x1800b89c5
lea ecx, [r12 + r12]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov qword [rsp + 0x20], rax
mov r9, rax
test rax, rax
je 0x1800b89ab
mov ebx, 1
cmp ebp, 8
jge 0x1800b7fbe
mov ecx, ebx
mov dword [rsp + 0x2c], ebx
mov eax, r12d
jmp 0x1800b7fc6
mov eax, dword [rsp + 0x28]
mov ecx, dword [rsp + 0x2c]
xor r8d, r8d
mov r12d, r8d
mov dword [rsp + 0x38], r8d
cmp dword [rsp + 0xc8], r8d
jbe 0x1800b8974
mov rdx, qword [rdi + 0x18]
mov qword [rsp + 0x48], rdx
lea rdx, [0x18010a560]
add rdx, rbp
movsxd r10, ecx
imul eax, ecx
mov qword [rsp + 0x50], rdx
mov qword [rsp + 0x30], r10
movsxd rdx, eax
mov qword [rsp + 0x58], rdx
mov rsi, rdx
mov dword [rsp + 0x28], eax
jmp 0x1800b8025
mov r9, qword [rsp + 0x20]
mov ecx, dword [rsp + 0xa0]
mov r11d, r12d
movzx eax, byte [r13]
not r11d
and r11d, 1
mov ebx, r12d
and ebx, 1
imul r11d, ecx
mov edi, r12d
imul ebx, ecx
imul edi, dword [rsp + 0x40]
inc r13
add r11, r9
add rbx, r9
add rdi, qword [rsp + 0x48]
cmp eax, 4
ja 0x1800b8946
lea r9, [0x180000000]
test r12d, r12d
jne 0x1800b807f
movzx eax, byte [rax + r9 + 0x10a56c]
mov rsi, rdx
cmp eax, 5
ja case.default.0x1800b8095
cdqe
mov ecx, dword [r9 + rax*4 + 0xb89e8]
add rcx, r9
jmp rcx
mov r8, rsi
mov rdx, r13
mov rcx, rbx
call sub.VCRUNTIME140.dll_memcpy
jmp 0x1800b8568
mov r8, r10
mov rdx, r13
mov rcx, rbx
call sub.VCRUNTIME140.dll_memcpy
mov r10, qword [rsp + 0x30]
cmp r10, rsi
jge 0x1800b8568
mov rdx, rbx
lea rcx, [r10 + r13]
sub rdx, r10
mov r8, rbx
sub rdx, r13
sub r8, r13
sub rsi, r10
nop dword [rax]
movzx eax, byte [rcx + rdx]
add al, byte [rcx]
mov byte [r8 + rcx], al
lea rcx, [rcx + 1]
sub rsi, 1
jne 0x1800b80e0
jmp 0x1800b8568
mov r9d, dword [rsp + 0x28]
xor edx, edx
test r9d, r9d
jle 0x1800b8241
cmp r9d, 8
jb 0x1800b8241
lea eax, [r9 - 1]
movsxd rcx, eax
lea rax, [rcx + r13]
lea r8, [rcx + rbx]
cmp rbx, rax
ja 0x1800b8130
cmp r8, r13
jae 0x1800b8241
lea rax, [rcx + r11]
cmp rbx, rax
ja 0x1800b8142
cmp r8, r11
jae 0x1800b8241
cmp r9d, 0x40
jb 0x1800b81f2
mov ecx, r9d
and ecx, 0x8000003f
jge 0x1800b815e
dec ecx
or ecx, 0xffffffc0
inc ecx
mov eax, r9d
sub eax, ecx
mov rcx, r11
movsxd r9, eax
sub rcx, r13
lea rax, [r13 + 0x10]
mov r8, rbx
sub r8, r13
nop word [rax + rax]
movdqu xmm0, xmmword [rax - 0x10]
add rdx, 0x40
movdqu xmm1, xmmword [rax + rcx - 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 [rax + rcx - 0x30]
movdqu xmmword [r8 + rax - 0x40], xmm2
paddb xmm1, xmm0
movdqu xmm0, xmmword [rax - 0x20]
movdqu xmm2, xmmword [rax + rcx - 0x20]
movdqu xmmword [r8 + rax - 0x30], xmm1
paddb xmm2, xmm0
movdqu xmmword [r8 + rax - 0x20], xmm2
cmp rdx, r9
jl 0x1800b8180
mov r9d, dword [rsp + 0x28]
mov eax, r9d
and al, 0x3f
cmp al, 8
jb 0x1800b8241
mov ecx, r9d
and ecx, 0x80000007
jge 0x1800b8204
dec ecx
or ecx, 0xfffffff8
inc ecx
mov eax, r9d
sub eax, ecx
mov rcx, r11
movsxd r9, eax
sub rcx, r13
lea rax, [rdx + r13]
mov r8, rbx
sub r8, r13
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 0x1800b8220
cmp rdx, rsi
jge 0x1800b8568
mov r8, rbx
lea rcx, [rdx + r13]
sub r8, r13
sub r11, r13
sub rsi, rdx
nop word [rax + rax]
movzx eax, byte [rcx + r11]
add al, byte [rcx]
mov byte [r8 + rcx], al
lea rcx, [rcx + 1]
sub rsi, 1
jne 0x1800b8260
jmp 0x1800b8568
test r10, r10
jle 0x1800b82aa
mov r8, r11
mov r9, rbx
sub r8, r13
mov rcx, r13
sub r9, r13
mov rdx, r10
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 0x1800b8291
cmp r10, rsi
jge 0x1800b8568
lea rdx, [r10 + r11]
mov r8, rbx
sub r8, r10
mov r9, r13
mov r10, rbx
sub r8, r11
sub r10, r11
sub r9, r11
sub rsi, qword [rsp + 0x30]
nop dword [rax]
nop word [rax + rax]
movzx ecx, byte [rdx + r8]
movzx eax, byte [rdx]
lea rdx, [rdx + 1]
add ecx, eax
shr ecx, 1
add cl, byte [r9 + rdx - 1]
mov byte [r10 + rdx - 1], cl
sub rsi, 1
jne 0x1800b82e0
jmp 0x1800b8568
mov r9d, dword [rsp + 0x2c]
mov rdx, r8
test r9d, r9d
jle 0x1800b8451
cmp r9d, 8
jb 0x1800b8451
lea eax, [r9 - 1]
movsxd rcx, eax
lea rax, [rcx + r13]
lea r8, [rcx + rbx]
cmp rbx, rax
ja 0x1800b833d
cmp r8, r13
jae 0x1800b8451
lea rax, [rcx + r11]
cmp rbx, rax
ja 0x1800b834f
cmp r8, r11
jae 0x1800b8451
cmp r9d, 0x40
jb 0x1800b8402
mov ecx, r9d
and ecx, 0x8000003f
jge 0x1800b836b
dec ecx
or ecx, 0xffffffc0
inc ecx
mov eax, r9d
sub eax, ecx
mov rcx, r11
movsxd r9, eax
sub rcx, r13
lea rax, [r13 + 0x10]
mov r8, rbx
sub r8, r13
nop dword [rax]
nop word [rax + rax]
movdqu xmm0, xmmword [rax - 0x10]
add rdx, 0x40
movdqu xmm1, xmmword [rax + rcx - 0x10]
movdqu xmm2, xmmword [rax]
lea rax, [rax + 0x40]
paddb xmm1, xmm0
movdqu xmm0, xmmword [rax + rcx - 0x40]
movdqu xmmword [r8 + rax - 0x50], xmm1
paddb xmm2, xmm0
movdqu xmm0, xmmword [rax - 0x30]
movdqu xmm1, xmmword [rax + rcx - 0x30]
movdqu xmmword [r8 + rax - 0x40], xmm2
paddb xmm1, xmm0
movdqu xmm0, xmmword [rax - 0x20]
movdqu xmm2, xmmword [rax + rcx - 0x20]
movdqu xmmword [r8 + rax - 0x30], xmm1
paddb xmm2, xmm0
movdqu xmmword [r8 + rax - 0x20], xmm2
cmp rdx, r9
jl 0x1800b8390
mov r9d, dword [rsp + 0x2c]
mov eax, r9d
and al, 0x3f
cmp al, 8
jb 0x1800b8451
mov ecx, r9d
and ecx, 0x80000007
jge 0x1800b8414
dec ecx
or ecx, 0xfffffff8
inc ecx
mov eax, r9d
sub eax, ecx
mov rcx, r11
movsxd r9, eax
sub rcx, r13
lea rax, [rdx + r13]
mov r8, rbx
sub r8, r13
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 0x1800b8430
cmp rdx, r10
jge 0x1800b848a
mov r8, qword [rsp + 0x30]
lea rcx, [rdx + r13]
mov r9, r11
mov r10, rbx
sub r9, r13
sub r10, r13
sub r8, rdx
nop
movzx eax, byte [rcx + r9]
add al, byte [rcx]
mov byte [r10 + rcx], al
lea rcx, [rcx + 1]
sub r8, 1
jne 0x1800b8470
mov r10, qword [rsp + 0x30]
cmp r10, rsi
jge 0x1800b8568
mov rax, qword [rsp + 0x30]
mov rbp, r11
mov r12, qword [rsp + 0x30]
sub rax, rbx
sub rbp, rbx
add r11, rax
sub rsi, qword [rsp + 0x30]
mov r10, rbx
lea r15, [rax + r13]
nop word [rax + rax]
movzx eax, byte [r11 + r10]
movzx r9d, byte [r10]
mov edx, eax
movzx ecx, byte [r10 + rbp]
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 [r15 + r10 - 1]
mov byte [r12 + r10 - 1], cl
sub rsi, 1
jne 0x1800b84c0
mov r12d, dword [rsp + 0x38]
mov ebp, dword [rsp + 0xd0]
mov r15d, dword [rsp + 0x3c]
jmp 0x1800b8568
mov r8, r10
mov rdx, r13
mov rcx, rbx
call sub.VCRUNTIME140.dll_memcpy
mov r10, qword [rsp + 0x30]
cmp r10, rsi
jge 0x1800b8568
mov rdx, rbx
lea rcx, [r10 + r13]
sub rdx, r10
mov r8, rbx
sub rdx, r13
sub r8, r13
sub rsi, r10
movzx eax, byte [rcx + rdx]
lea rcx, [rcx + 1]
shr al, 1
add al, byte [rcx - 1]
mov byte [r8 + rcx - 1], al
sub rsi, 1
jne 0x1800b8550
mov ecx, dword [rsp + 0xa0]
movsxd rsi, dword [rsp + 0x28]
add r13, rsi
cmp ebp, 8
jge 0x1800b876e
cmp dword [rsp + 0xd8], 0
jne 0x1800b8595
mov rax, qword [rsp + 0x50]
movzx r15d, byte [rax]
jmp 0x1800b8598
mov r15b, 1
mov eax, dword [rsp + 0xd0]
xor r8b, r8b
xor r11d, r11d
mov r9, rdi
cmp eax, 4
jne 0x1800b85f9
test r14d, r14d
je 0x1800b868d
mov r10d, r11d
and r10d, 1
jne 0x1800b85c3
movzx r8d, byte [rbx]
movzx eax, r8b
movzx ecx, r15b
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, r14d
jb 0x1800b85b6
jmp 0x1800b868d
cmp eax, 2
jne 0x1800b8647
test r14d, r14d
je 0x1800b868d
mov r10d, r11d
and r10d, 3
jne 0x1800b8614
movzx r8d, byte [rbx]
movzx eax, r8b
movzx ecx, r15b
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, r14d
jb 0x1800b8607
jmp 0x1800b868d
test r14d, r14d
je 0x1800b868d
nop dword [rax]
mov r10d, r11d
and r10d, 7
jne 0x1800b865d
movzx r8d, byte [rbx]
movzx eax, r8b
movzx ecx, r15b
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, r14d
jb 0x1800b8650
mov r15d, dword [rsp + 0x3c]
cmp r15d, dword [rsp + 0xb8]
je 0x1800b86d2
movsxd rcx, dword [rsp + 0xc0]
dec rcx
cmp r15d, 1
jne 0x1800b8717
test rcx, rcx
js 0x1800b86d2
nop dword [rax]
nop word [rax + rax]
mov byte [rdi + rcx*2 + 1], 0xff
movzx eax, byte [rcx + rdi]
mov byte [rdi + rcx*2], al
sub rcx, 1
jns 0x1800b86c0
mov ebp, dword [rsp + 0xd0]
mov r11, qword [rsp + 0x20]
mov r10, qword [rsp + 0x30]
inc r12d
mov r8d, 0
mov rdx, qword [rsp + 0x58]
mov dword [rsp + 0x38], r12d
cmp r12d, dword [rsp + 0xc8]
jb 0x1800b8020
mov rcx, r11
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov eax, 1
jmp 0x1800b89d0
test rcx, rcx
js 0x1800b86d2
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 0x1800b8740
jmp 0x1800b86d2
jne 0x1800b881e
cmp r15d, dword [rsp + 0xb8]
jne 0x1800b8791
mov r8d, r14d
mov rdx, rbx
mov rcx, rdi
call sub.VCRUNTIME140.dll_memcpy
jmp 0x1800b86d9
movsxd rcx, dword [rsp + 0xc0]
dec rcx
cmp r15d, 1
jne 0x1800b87c7
test rcx, rcx
js 0x1800b86d9
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 0x1800b87b0
jmp 0x1800b86d9
test rcx, rcx
js 0x1800b86d9
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 0x1800b87f0
jmp 0x1800b86d9
cmp ebp, 0x10
jne 0x1800b86d9
cmp r15d, dword [rsp + 0xb8]
jne 0x1800b8898
mov r11, qword [rsp + 0x20]
test r14d, r14d
je 0x1800b86de
mov edx, r12d
mov r8, rdi
and edx, 1
imul ecx, edx
imul edx, dword [rsp + 0xa0]
sub r8, rcx
sub r8, r11
mov r9d, edx
add r8, rbx
mov edx, r14d
sub r9, rdi
add r9, r11
nop dword [rax + rax]
movzx eax, byte [rbx]
lea rbx, [rbx + 2]
movzx ecx, byte [r8 + r9 + 1]
lea r8, [r8 + 2]
shl ax, 8
or cx, ax
mov word [r8 - 2], cx
sub rdx, 1
jne 0x1800b8870
jmp 0x1800b86de
mov eax, dword [rsp + 0xc0]
cmp r15d, 1
jne 0x1800b88db
test eax, eax
je 0x1800b86d9
mov edx, eax
nop
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 0x1800b88b0
jmp 0x1800b86d2
test eax, eax
je 0x1800b86d9
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 0x1800b88f0
mov r12d, dword [rsp + 0x38]
jmp 0x1800b86d9
mov edx, dword [0x18013b348]
mov rax, qword gs:[0x58]
mov ecx, 0x148
mov rax, qword [rax + rdx*8]
lea rdx, str.invalid_filter
mov qword [rcx + rax], rdx
mov rcx, r9
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
jmp 0x1800b89ce
mov rcx, r9
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov r8, r12
test ebx, ebx
setne r8b
mov eax, r8d
jmp 0x1800b89d0
mov edx, dword [0x18013b348]
mov rax, qword gs:[0x58]
mov rax, qword [rax + rdx*8]
lea rdx, str.too_large
jmp 0x1800b89c5
mov qword [rdi + 0x18], r9
mov edx, dword [0x18013b348]
mov rax, qword gs:[0x58]
mov rax, qword [rax + rdx*8]
lea rdx, str.outofmem
mov ecx, 0x148
mov qword [rcx + rax], rdx
xor eax, eax
mov rbx, qword [rsp + 0xa8]
add rsp, 0x60
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret