Function at 0x1400409b0
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov dword [rsp + 0x20], r9d
push rbx
push rbp
push rsi
push rdi
push r12
push r14
push r15
sub rsp, 0xb0
mov r15d, dword [rsp + 0x110]
mov eax, r9d
mov r14d, dword [rsp + 0x120]
mov ebp, r8d
mov r9d, dword [rsp + 0x118]
xor r8d, r8d
cmp r14d, 0x10
mov qword [rsp + 0x78], r8
mov r10d, r8d
mov dword [rsp + 0x48], r15d
sete r10b
mov rsi, rcx
inc r10d
mov rbx, rdx
mov edi, r10d
imul edi, eax
mov rax, qword [rcx]
mov ecx, dword [rax + 8]
mov r11d, edi
imul r11d, r15d
mov r12d, ecx
imul r12d, r10d
mov dword [rsp + 0xf0], ecx
mov dword [rsp + 0x38], r11d
mov dword [rsp + 0x50], r12d
test r15d, r15d
js 0x140041bcc
test r9d, r9d
js 0x140041bcc
je 0x140040a57
xor edx, edx
mov eax, 0x7fffffff
div r9d
cmp r15d, eax
jg 0x140041bcc
mov ecx, r15d
imul ecx, r9d
test ecx, ecx
js 0x140041bcc
test edi, edi
js 0x140041bcc
je 0x140040a80
mov eax, 0x7fffffff
cdq
idiv edi
cmp ecx, eax
jg 0x140041bcc
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 [rsi + 0x18], rax
mov r10, rax
test rax, rax
je 0x140041bd0
movsxd r11, dword [rsp + 0xf0]
mov qword [rsp + 0xf8], r13
test r11d, r11d
js 0x140041baf
test r15d, r15d
je 0x140040ad1
xor edx, edx
mov eax, 0x7fffffff
div r15d
cmp r11d, eax
jg 0x140041baf
mov r13d, r11d
imul r13d, r15d
mov dword [rsp + 0x20], r13d
test r13d, r13d
js 0x140041baf
test r14d, r14d
js 0x140041baf
je 0x140040b04
xor edx, edx
mov eax, 0x7fffffff
div r14d
cmp r13d, eax
jg 0x140041baf
mov eax, r13d
imul eax, r14d
cmp eax, 0x7ffffff8
jg 0x140041baf
mov esi, dword [rsp + 0x118]
mov ecx, r13d
imul ecx, r14d
add ecx, 7
shr ecx, 3
mov dword [rsp + 0x54], ecx
lea eax, [rcx + 1]
imul eax, esi
cmp ebp, eax
jae 0x140040b70
mov rax, qword gs:[0x58]
mov edx, 0x18
mov rcx, qword [rax]
lea rax, str.not_enough_pixels
mov qword [rdx + rcx], rax
xor eax, eax
mov r13, qword [rsp + 0xf8]
add rsp, 0xb0
pop r15
pop r14
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret
xor r9d, r9d
mov qword [rsp + 0x30], r10
lea r8, [0x140000000]
mov edx, r9d
mov dword [rsp + 0x4c], edx
test esi, esi
je 0x1400416e8
mov eax, dword [rsp + 0x20]
mov r8, r11
movsxd r13, edi
mov rdi, r10
movsxd r14, r12d
mov qword [rsp + 0x68], r14
mov qword [rsp + 0x98], r13
mov qword [rsp + 0x28], r11
mov dword [rsp + 0x20], eax
mov qword [rsp + 0x30], r10
mov qword [rsp + 0xa0], r10
movzx r10d, byte [rbx]
mov ebp, edx
imul ebp, dword [rsp + 0x38]
inc rbx
add rbp, rdi
mov qword [rsp + 0x60], rbp
mov rsi, rbp
cmp r10d, 4
ja 0x1400416b7
cmp dword [rsp + 0x120], 8
jge 0x140040c1e
cmp ecx, r15d
ja 0x14004169a
mov eax, dword [rsp + 0x108]
mov r12d, 1
imul eax, r15d
mov r14d, r12d
mov dword [rsp + 0x50], r12d
mov qword [rsp + 0x68], r12
mov dword [rsp + 0x48], ecx
sub eax, ecx
add rsi, rax
mov eax, dword [rsp + 0x38]
lea rcx, [0x140000000]
mov r15, rsi
sub r15, rax
test edx, edx
jne 0x140040c3c
movzx r10d, byte [r10 + rcx + 0xb3eec]
test r14, r14
jle 0x140040d75
mov rdi, r15
mov r11, rsi
sub rdi, rbx
mov rdx, rbx
sub r11, rbx
mov r9, r14
mov r8, rdx
cmp r10d, 6
ja case.default.0x140040c6d
movsxd rax, r10d
mov eax, dword [rcx + rax*4 + 0x41bf4]
add rax, rcx
jmp rax
inc rdx
sub r9, 1
je 0x140040d65
lea rcx, [0x140000000]
jmp 0x140040c57
movzx eax, byte [rdx]
inc rdx
mov byte [r11 + r8], al
sub r9, 1
je 0x140040d65
mov r8, rdx
jmp case.0x140040c6d.0
movzx eax, byte [rdx]
inc rdx
mov byte [r11 + r8], al
sub r9, 1
je 0x140040d65
mov r8, rdx
jmp case.0x140040c6d.1
movzx eax, byte [rdi + r8]
add al, byte [rdx]
inc rdx
mov byte [r11 + r8], al
sub r9, 1
je 0x140040d65
mov r8, rdx
jmp case.0x140040c6d.2
movzx eax, byte [rdi + r8]
shr al, 1
add al, byte [rdx]
inc rdx
mov byte [r11 + r8], al
sub r9, 1
je 0x140040d65
mov r8, rdx
jmp case.0x140040c6d.3
movzx eax, byte [rdi + r8]
xor ecx, ecx
test al, al
cmovne ecx, eax
add cl, byte [rdx]
inc rdx
mov byte [r11 + r8], cl
sub r9, 1
je 0x140040d65
mov r8, rdx
jmp case.0x140040c6d.4
movzx eax, byte [rdx]
inc rdx
mov byte [r11 + r8], al
sub r9, 1
je 0x140040d65
mov r8, rdx
jmp case.0x140040c6d.5
movzx eax, byte [rdx]
inc rdx
mov byte [r11 + r8], al
sub r9, 1
je 0x140040d65
mov r8, rdx
jmp case.0x140040c6d.6
mov r8, qword [rsp + 0x28]
xor r9d, r9d
mov r11d, dword [rsp + 0xf0]
mov eax, dword [rsp + 0x120]
cmp eax, 8
jne 0x140040dac
movsxd rax, dword [rsp + 0x108]
cmp r11d, eax
je 0x140040d93
mov byte [r8 + rsi], 0xff
add rbx, r8
lea r11, [rax + r15]
add rax, rsi
mov qword [rsp + 0x58], r11
mov qword [rsp + 0x40], rax
mov r8, rbx
jmp 0x140040e05
cmp eax, 0x10
jne 0x140040ddf
cmp r11d, dword [rsp + 0x108]
je 0x140040dc2
mov word [r14 + rsi], 0xffff
movsxd rax, r12d
lea r11, [r15 + r13]
add rbx, rax
mov qword [rsp + 0x58], r11
lea rax, [rsi + r13]
mov r8, rbx
mov qword [rsp + 0x40], rax
jmp 0x140040e05
inc rbx
lea r11, [r15 + 1]
cmp dword [rsp + 0x120], 8
lea rax, [rsi + 1]
mov r8, rbx
mov qword [rsp + 0x58], r11
mov qword [rsp + 0x40], rax
jl 0x140041334
mov ecx, dword [rsp + 0xf0]
cmp ecx, dword [rsp + 0x108]
je 0x140041334
cmp r10d, 6
ja case.default.0x140040e3b
movsxd rcx, r10d
mov rbx, r8
lea r10, [0x140000000]
mov edx, dword [r10 + rcx*4 + 0x41c10]
add rdx, r10
jmp rdx
mov edx, dword [rsp + 0x110]
lea ecx, [rdx - 1]
cmp ecx, 1
jb 0x1400412fd
movsxd r11, r12d
mov r10d, ecx
test r14, r14
jle 0x140040e81
mov r9, rbx
mov rdx, rax
sub r9, rax
mov r8, r14
nop word [rax + rax]
movzx ecx, byte [rdx + r9]
mov byte [rdx], cl
lea rdx, [rdx + 1]
sub r8, 1
jne 0x140040e70
mov byte [r14 + rax], 0xff
add rbx, r11
add rax, r13
sub r10, 1
jne 0x140040e56
jmp case.default.0x140040e3b
mov edx, dword [rsp + 0x110]
lea ecx, [rdx - 1]
cmp ecx, 1
jb 0x1400412fd
movsxd rdi, r12d
mov r11d, ecx
test r14, r14
jle 0x140040ee5
mov r8, rax
mov r10, rax
sub r8, r13
mov rdx, rbx
sub r8, rbx
mov r9, r14
sub r10, rbx
nop word [rax + rax]
movzx ecx, byte [rdx + r8]
add cl, byte [rdx]
mov byte [r10 + rdx], cl
lea rdx, [rdx + 1]
sub r9, 1
jne 0x140040ed0
mov byte [r14 + rax], 0xff
add rbx, rdi
add rax, r13
sub r11, 1
jne 0x140040eb0
jmp case.default.0x140040e3b
mov edx, dword [rsp + 0x110]
lea ecx, [rdx - 1]
cmp ecx, 1
jb 0x1400412fd
movsxd rbp, r12d
mov esi, ecx
mov r8, r9
test r12d, r12d
jle 0x140041051
cmp r12d, 8
jb 0x140041051
lea ecx, [r12 - 1]
movsxd rdx, ecx
lea rcx, [rdx + rbx]
lea r9, [rdx + rax]
cmp rax, rcx
ja 0x140040f47
cmp r9, rbx
jae 0x140041051
lea rcx, [rdx + r11]
cmp rax, rcx
ja 0x140040f59
cmp r9, r11
jae 0x140041051
cmp r12d, 0x40
jb 0x140040fff
mov edx, r12d
and edx, 0x8000003f
jge 0x140040f75
dec edx
or edx, 0xffffffc0
inc edx
mov ecx, r12d
sub ecx, edx
mov rdx, r11
movsxd r10, ecx
sub rdx, rbx
lea rcx, [rbx + 0x10]
mov r9, rax
sub r9, rbx
nop dword [rax]
movdqu xmm0, xmmword [rcx - 0x10]
add r8, 0x40
movdqu xmm1, xmmword [rcx + rdx - 0x10]
movdqu xmm2, xmmword [rcx + rdx]
lea rcx, [rcx + 0x40]
paddb xmm1, xmm0
movdqu xmm0, xmmword [rcx - 0x40]
movdqu xmmword [r9 + rcx - 0x50], xmm1
paddb xmm2, xmm0
movdqu xmm0, xmmword [rcx - 0x30]
movdqu xmm1, xmmword [rcx + rdx - 0x30]
movdqu xmmword [r9 + rcx - 0x40], xmm2
paddb xmm1, xmm0
movdqu xmm0, xmmword [rcx - 0x20]
movdqu xmm2, xmmword [rcx + rdx - 0x20]
movdqu xmmword [r9 + rcx - 0x30], xmm1
paddb xmm2, xmm0
movdqu xmmword [r9 + rcx - 0x20], xmm2
cmp r8, r10
jl 0x140040f90
mov ecx, r12d
and cl, 0x3f
cmp cl, 8
jb 0x140041051
mov edx, r12d
and edx, 0x80000007
jge 0x140041011
dec edx
or edx, 0xfffffff8
inc edx
mov ecx, r12d
sub ecx, edx
mov rdx, r11
movsxd r10, ecx
sub rdx, rbx
lea rcx, [r8 + rbx]
mov r9, rax
sub r9, rbx
nop dword [rax]
movq xmm1, qword [rcx + rdx]
add r8, 8
movq xmm0, qword [rcx]
lea rcx, [rcx + 8]
paddb xmm1, xmm0
movq qword [r9 + rcx - 8], xmm1
cmp r8, r10
jl 0x140041030
cmp r8, r14
jge 0x140041084
mov r10, r11
lea rdx, [r8 + rbx]
mov rdi, rax
sub r10, rbx
sub rdi, rbx
mov r9, r14
sub r9, r8
nop dword [rax]
movzx ecx, byte [rdx + r10]
add cl, byte [rdx]
mov byte [rdi + rdx], cl
lea rdx, [rdx + 1]
sub r9, 1
jne 0x140041070
mov byte [r14 + rax], 0xff
add rbx, rbp
add rax, r13
add r11, r13
mov r9d, 0
sub rsi, 1
jne 0x140040f13
mov rbp, qword [rsp + 0x60]
jmp case.default.0x140040e3b
mov edx, dword [rsp + 0x110]
lea ecx, [rdx - 1]
cmp ecx, 1
jb 0x1400412fd
movsxd r15, r12d
mov ebp, ecx
test r14, r14
jle 0x140041111
mov r9, rax
mov rdi, rbx
sub r9, r13
sub rdi, r11
sub r9, r11
mov rsi, rax
sub rsi, r11
mov r8, r11
mov r10, r14
nop dword [rax]
nop dword [rax + rax]
movzx edx, byte [r8 + r9]
movzx ecx, byte [r8]
lea r8, [r8 + 1]
add edx, ecx
shr edx, 1
add dl, byte [rdi + r8 - 1]
mov byte [rsi + r8 - 1], dl
sub r10, 1
jne 0x1400410f0
mov byte [r14 + rax], 0xff
add rbx, r15
add rax, r13
add r11, r13
sub rbp, 1
jne 0x1400410c4
mov rbp, qword [rsp + 0x60]
jmp case.default.0x140040e3b
mov edx, dword [rsp + 0x110]
lea ecx, [rdx - 1]
cmp ecx, 1
jb 0x1400412fd
movsxd rdx, r12d
mov qword [rsp + 0x90], rdx
mov qword [rsp + 0x70], rcx
test r14, r14
jle 0x140041205
mov rcx, r11
mov r10, rax
sub rcx, rax
sub r10, r13
mov qword [rsp + 0x80], rcx
mov r12, r14
mov r14, qword [rsp + 0x80]
mov rcx, r13
sub rcx, rax
lea rax, [rcx + r11]
lea r11, [rbx + rcx]
nop dword [rax + rax]
movzx r9d, byte [r10]
movzx ebp, byte [r10 + r14]
mov edx, r9d
movzx r15d, byte [rax + r10]
sub edx, ebp
mov esi, edx
lea r8d, [r15 + rdx]
mov ecx, r8d
sub ecx, r9d
mov edi, ecx
neg edi
cmovs edi, ecx
neg esi
cmovs esi, edx
sub r8d, ebp
mov ecx, r8d
neg ecx
cmovs ecx, r8d
cmp edi, esi
jg 0x1400411cf
cmp edi, ecx
jle 0x1400411d8
cmp esi, ecx
mov r9d, ebp
cmovle r9d, r15d
add r9b, byte [r11 + r10]
mov byte [r10 + r13], r9b
inc r10
sub r12, 1
jne 0x140041190
mov rax, qword [rsp + 0x40]
mov r11, qword [rsp + 0x58]
mov r14, qword [rsp + 0x68]
mov rcx, qword [rsp + 0x70]
mov rdx, qword [rsp + 0x90]
add r11, r13
mov byte [r14 + rax], 0xff
add rax, r13
mov qword [rsp + 0x58], r11
add rbx, rdx
mov qword [rsp + 0x40], rax
sub rcx, 1
mov qword [rsp + 0x70], rcx
jne 0x140041152
mov rbp, qword [rsp + 0x60]
jmp case.default.0x140040e3b
mov edx, dword [rsp + 0x110]
lea ecx, [rdx - 1]
cmp ecx, 1
jb 0x1400412fd
movsxd rdi, r12d
mov r11d, ecx
nop
test r14, r14
jle 0x140041289
mov r8, rax
mov r10, rax
sub r8, r13
mov rdx, rbx
sub r8, rbx
mov r9, r14
sub r10, rbx
nop word [rax + rax]
movzx ecx, byte [rdx + r8]
lea rdx, [rdx + 1]
shr cl, 1
add cl, byte [rdx - 1]
mov byte [r10 + rdx - 1], cl
sub r9, 1
jne 0x140041270
mov byte [r14 + rax], 0xff
add rbx, rdi
add rax, r13
sub r11, 1
jne 0x140041250
jmp case.default.0x140040e3b
mov edx, dword [rsp + 0x110]
lea ecx, [rdx - 1]
cmp ecx, 1
jb 0x1400412fd
movsxd rdi, r12d
mov r11d, ecx
test r14, r14
jle 0x1400412e5
mov r8, rax
mov r10, rax
sub r8, r13
mov rdx, rbx
sub r8, rbx
mov r9, r14
sub r10, rbx
nop dword [rax + rax]
movzx ecx, byte [rdx + r8]
add cl, byte [rdx]
mov byte [r10 + rdx], cl
lea rdx, [rdx + 1]
sub r9, 1
jne 0x1400412d0
mov byte [r14 + rax], 0xff
add rbx, rdi
add rax, r13
sub r11, 1
jne 0x1400412b1
mov edx, dword [rsp + 0x110]
cmp dword [rsp + 0x120], 0x10
jne 0x14004165a
test edx, edx
je 0x14004165a
mov eax, edx
nop word [rax + rax]
mov byte [r14 + rbp + 1], 0xff
add rbp, r13
sub rax, 1
jne 0x140041320
jmp 0x14004165a
mov esi, dword [rsp + 0x48]
dec esi
imul esi, r12d
mov dword [rsp + 0x40], esi
cmp r10d, 6
ja case.default.0x140041364
movsxd rcx, r10d
lea r10, [0x140000000]
movsxd r8, esi
mov edx, dword [r10 + rcx*4 + 0x41c2c]
add rdx, r10
jmp rdx
mov rdx, rbx
mov rcx, rax
call sub.VCRUNTIME140.dll_memcpy
jmp case.default.0x140041364
test esi, esi
jle case.default.0x140041364
mov r9, rax
mov rdx, rbx
sub r9, r14
sub r9, rbx
sub rax, rbx
nop dword [rax]
movzx ecx, byte [rdx + r9]
add cl, byte [rdx]
mov byte [rax + rdx], cl
lea rdx, [rdx + 1]
sub r8, 1
jne 0x140041390
jmp case.default.0x140041364
test esi, esi
jle 0x1400414e1
cmp esi, 8
jb 0x1400414e1
lea ecx, [rsi - 1]
xor r9d, r9d
movsxd rdx, ecx
lea rcx, [rdx + rbx]
lea r10, [rdx + rax]
cmp rax, rcx
ja 0x1400413d9
cmp r10, rbx
jae 0x1400414e1
lea rcx, [rdx + r11]
cmp rax, rcx
ja 0x1400413eb
cmp r10, r11
jae 0x1400414e1
cmp esi, 0x40
jb 0x14004148e
mov edx, esi
and edx, 0x8000003f
jge 0x140041405
dec edx
or edx, 0xffffffc0
inc edx
mov ecx, esi
sub ecx, edx
mov rdx, r11
movsxd rdi, ecx
sub rdx, rbx
lea rcx, [rbx + 0x10]
mov r10, rax
sub r10, rbx
nop dword [rax]
movdqu xmm0, xmmword [rcx - 0x10]
add r9, 0x40
movdqu xmm1, xmmword [rcx + rdx - 0x10]
movdqu xmm2, xmmword [rcx]
lea rcx, [rcx + 0x40]
paddb xmm1, xmm0
movdqu xmm0, xmmword [rcx + rdx - 0x40]
movdqu xmmword [r10 + rcx - 0x50], xmm1
paddb xmm2, xmm0
movdqu xmm0, xmmword [rcx - 0x30]
movdqu xmm1, xmmword [rcx + rdx - 0x30]
movdqu xmmword [r10 + rcx - 0x40], xmm2
paddb xmm1, xmm0
movdqu xmm0, xmmword [rcx - 0x20]
movdqu xmm2, xmmword [rcx + rdx - 0x20]
movdqu xmmword [r10 + rcx - 0x30], xmm1
paddb xmm2, xmm0
movdqu xmmword [r10 + rcx - 0x20], xmm2
cmp r9, rdi
jl 0x140041420
mov ecx, esi
and cl, 0x3f
cmp cl, 8
jb 0x1400414e1
mov edx, esi
and edx, 0x80000007
jge 0x14004149f
dec edx
or edx, 0xfffffff8
inc edx
mov ecx, esi
sub ecx, edx
mov rdx, r11
movsxd rdi, ecx
sub rdx, rbx
lea rcx, [r9 + rbx]
mov r10, rax
sub r10, rbx
nop word [rax + rax]
movq xmm1, qword [rcx + rdx]
add r9, 8
movq xmm0, qword [rcx]
lea rcx, [rcx + 8]
paddb xmm1, xmm0
movq qword [r10 + rcx - 8], xmm1
cmp r9, rdi
jl 0x1400414c0
cmp r9, r8
jge case.default.0x140041364
sub r11, rbx
lea rdx, [r9 + rbx]
sub rax, rbx
sub r8, r9
nop word [rax + rax]
movzx ecx, byte [rdx + r11]
add cl, byte [rdx]
mov byte [rax + rdx], cl
lea rdx, [rdx + 1]
sub r8, 1
jne 0x140041500
jmp case.default.0x140041364
test esi, esi
jle case.default.0x140041364
mov r9, rax
mov r10, rbx
sub r9, r14
sub r10, r11
sub r9, r11
sub rax, r11
nop dword [rax]
nop word [rax + rax]
movzx edx, byte [r11 + r9]
movzx ecx, byte [r11]
lea r11, [r11 + 1]
add edx, ecx
shr edx, 1
add dl, byte [r10 + r11 - 1]
mov byte [rax + r11 - 1], dl
sub r8, 1
jne 0x140041540
jmp case.default.0x140041364
test esi, esi
jle case.default.0x140041364
mov r10, rax
mov r12, r11
sub r10, r14
sub r12, rax
mov rcx, r14
sub rcx, rax
lea r13, [rcx + r11]
lea r15, [rcx + rbx]
nop dword [rax + rax]
movzx r9d, byte [r10]
movzx esi, byte [r10 + r12]
mov ecx, r9d
movzx ebp, byte [r10 + r13]
sub ecx, esi
mov edi, ecx
lea edx, [rcx + rbp]
mov eax, edx
sub eax, r9d
mov r11d, eax
neg r11d
cmovs r11d, eax
neg edi
cmovs edi, ecx
sub edx, esi
mov eax, edx
neg eax
cmovs eax, edx
cmp r11d, edi
jg 0x1400415cf
cmp r11d, eax
jle 0x1400415d8
cmp edi, eax
mov r9d, esi
cmovle r9d, ebp
add r9b, byte [r15 + r10]
mov byte [r14 + r10], r9b
inc r10
sub r8, 1
jne 0x140041590
mov r13, qword [rsp + 0x98]
mov esi, dword [rsp + 0x40]
jmp case.default.0x140041364
test esi, esi
jle case.default.0x140041364
mov r9, rax
mov rdx, rbx
sub r9, r14
sub r9, rbx
sub rax, rbx
nop word [rax + rax]
movzx ecx, byte [rdx + r9]
lea rdx, [rdx + 1]
shr cl, 1
add cl, byte [rdx - 1]
mov byte [rax + rdx - 1], cl
sub r8, 1
jne 0x140041610
jmp case.default.0x140041364
test esi, esi
jle case.default.0x140041364
mov r9, rax
mov rdx, rbx
sub r9, r14
sub r9, rbx
sub rax, rbx
nop dword [rax]
movzx ecx, byte [rdx + r9]
add cl, byte [rdx]
mov byte [rax + rdx], cl
lea rdx, [rdx + 1]
sub r8, 1
jne 0x140041640
movsxd rax, esi
add rbx, rax
mov edx, dword [rsp + 0x4c]
xor r9d, r9d
mov esi, dword [rsp + 0x118]
inc edx
mov r15d, dword [rsp + 0x110]
mov ecx, dword [rsp + 0x54]
mov r11d, dword [rsp + 0xf0]
mov dword [rsp + 0x4c], edx
cmp edx, esi
jae 0x1400416d4
mov r12d, dword [rsp + 0x50]
mov r8, qword [rsp + 0x28]
mov rdi, qword [rsp + 0x30]
jmp 0x140040bc1
mov rax, qword gs:[0x58]
mov edx, 0x18
mov rcx, qword [rax]
lea rax, str.invalid_width
jmp 0x140040b50
mov rax, qword gs:[0x58]
mov edx, 0x18
mov rcx, qword [rax]
lea rax, str.invalid_filter
jmp 0x140040b50
mov r13d, dword [rsp + 0x20]
lea r8, [0x140000000]
mov r10, qword [rsp + 0xa0]
movsxd rbx, dword [rsp + 0x120]
cmp ebx, 8
jge 0x140041b65
test esi, esi
je 0x140041ba5
mov r14d, dword [rsp + 0x108]
lea rsi, [rbx + 0xb3ef8]
mov r12d, dword [rsp + 0x128]
add rsi, r8
imul r14d, r15d
movsxd rbp, r15d
mov r15d, ecx
nop word [rax + rax]
mov rax, qword [rsp + 0x30]
mov edi, r9d
imul edi, dword [rsp + 0x38]
mov r9, r14
sub r9, r15
add r9, rdi
add r9, rax
lea r8, [rdi + rax]
test r12d, r12d
jne 0x140041758
movzx r10d, byte [rsi]
jmp 0x14004175b
mov r10b, 1
mov ecx, r13d
cmp ebx, 4
jne 0x1400417f3
mov dword [rsp + 0x20], ecx
mov ebx, ecx
cmp ecx, 2
jl 0x1400417c5
mov r11d, ecx
mov dword [rsp + 0x20], ecx
shr r11, 1
mov eax, r11d
neg eax
lea ebx, [rcx + rax*2]
nop dword [rax]
nop dword [rax + rax]
movzx eax, byte [r9]
shr al, 4
movzx edx, al
movzx ecx, r10b
imul edx, ecx
movzx ecx, r10b
mov byte [r8], dl
movzx eax, byte [r9]
inc r9
and al, 0xf
movzx edx, al
imul edx, ecx
mov byte [r8 + 1], dl
add r8, 2
sub r11, 1
jne 0x140041790
mov r13d, dword [rsp + 0x20]
mov r11d, dword [rsp + 0xf0]
test ebx, ebx
jle 0x140041ab8
movzx eax, byte [r9]
shr al, 4
movzx edx, al
movzx ecx, r10b
imul edx, ecx
mov byte [r8], dl
jmp 0x140041ab8
cmp ebx, 2
jne 0x1400418e4
mov dword [rsp + 0x20], ecx
mov rbx, rcx
cmp ecx, 4
jl 0x140041885
mov r11, rcx
mov dword [rsp + 0x20], ecx
shr r11, 2
mov eax, r11d
neg eax
lea ebx, [rcx + rax*4]
nop dword [rax + rax]
movzx eax, byte [r9]
shr al, 6
movzx edx, al
movzx ecx, r10b
imul edx, ecx
movzx eax, r10b
mov byte [r8], dl
movzx ecx, byte [r9]
shr cl, 4
and cl, 3
movzx ecx, cl
imul ecx, eax
movzx eax, r10b
mov byte [r8 + 1], cl
movzx ecx, byte [r9]
shr cl, 2
and cl, 3
movzx ecx, cl
imul ecx, eax
mov byte [r8 + 2], cl
movzx eax, byte [r9]
inc r9
and al, 3
movzx ecx, r10b
movzx edx, al
imul edx, ecx
mov byte [r8 + 3], dl
add r8, 4
sub r11, 1
jne 0x140041820
test ebx, ebx
jle 0x1400418a0
movzx eax, byte [r9]
shr al, 6
movzx edx, al
movzx ecx, r10b
imul edx, ecx
mov byte [r8], dl
inc r8
cmp ebx, 1
jle 0x1400418bf
movzx ecx, byte [r9]
shr cl, 4
and cl, 3
movzx eax, r10b
movzx ecx, cl
imul ecx, eax
mov byte [r8], cl
inc r8
mov r13d, dword [rsp + 0x20]
mov r11d, dword [rsp + 0xf0]
cmp ebx, 2
jle 0x140041ab8
movzx ecx, byte [r9]
shr cl, 2
and cl, 3
jmp 0x140041aab
mov r13d, ecx
cmp ebx, 1
jne 0x140041abd
mov r11, rcx
cmp ecx, 8
jl 0x1400419d8
mov rbx, rcx
shr rbx, 3
mov eax, ebx
neg eax
lea r11d, [rcx + rax*8]
nop dword [rax + rax]
movzx eax, byte [r9]
shr al, 7
movzx edx, al
movzx ecx, r10b
imul edx, ecx
movzx eax, r10b
mov byte [r8], dl
movzx ecx, byte [r9]
shr cl, 6
and cl, 1
movzx ecx, cl
imul ecx, eax
movzx eax, r10b
mov byte [r8 + 1], cl
movzx ecx, byte [r9]
shr cl, 5
and cl, 1
movzx ecx, cl
imul ecx, eax
movzx eax, r10b
mov byte [r8 + 2], cl
movzx ecx, byte [r9]
shr cl, 4
and cl, 1
movzx ecx, cl
imul ecx, eax
movzx eax, r10b
mov byte [r8 + 3], cl
movzx ecx, byte [r9]
shr cl, 3
and cl, 1
movzx ecx, cl
imul ecx, eax
movzx eax, r10b
mov byte [r8 + 4], cl
movzx ecx, byte [r9]
shr cl, 2
and cl, 1
movzx ecx, cl
imul ecx, eax
movzx eax, r10b
mov byte [r8 + 5], cl
movzx ecx, byte [r9]
shr cl, 1
and cl, 1
movzx ecx, cl
imul ecx, eax
mov byte [r8 + 6], cl
movzx eax, byte [r9]
inc r9
and al, 1
movzx ecx, r10b
movzx edx, al
imul edx, ecx
mov byte [r8 + 7], dl
add r8, 8
sub rbx, 1
jne 0x140041910
test r11d, r11d
jle 0x1400419f4
movzx eax, byte [r9]
shr al, 7
movzx edx, al
movzx ecx, r10b
imul edx, ecx
mov byte [r8], dl
inc r8
cmp r11d, 1
jle 0x140041a14
movzx ecx, byte [r9]
shr cl, 6
and cl, 1
movzx eax, r10b
movzx ecx, cl
imul ecx, eax
mov byte [r8], cl
inc r8
cmp r11d, 2
jle 0x140041a34
movzx ecx, byte [r9]
shr cl, 5
and cl, 1
movzx eax, r10b
movzx ecx, cl
imul ecx, eax
mov byte [r8], cl
inc r8
cmp r11d, 3
jle 0x140041a54
movzx ecx, byte [r9]
shr cl, 4
and cl, 1
movzx eax, r10b
movzx ecx, cl
imul ecx, eax
mov byte [r8], cl
inc r8
cmp r11d, 4
jle 0x140041a74
movzx ecx, byte [r9]
shr cl, 3
and cl, 1
movzx eax, r10b
movzx ecx, cl
imul ecx, eax
mov byte [r8], cl
inc r8
cmp r11d, 5
jle 0x140041a94
movzx ecx, byte [r9]
shr cl, 2
and cl, 1
movzx eax, r10b
movzx ecx, cl
imul ecx, eax
mov byte [r8], cl
inc r8
cmp r11d, 6
mov r11d, dword [rsp + 0xf0]
jle 0x140041ab8
movzx ecx, byte [r9]
shr cl, 1
and cl, 1
movzx eax, r10b
movzx ecx, cl
imul ecx, eax
mov byte [r8], cl
mov rax, qword [rsp + 0x30]
cmp r11d, dword [rsp + 0x108]
je 0x140041b39
lea rdx, [rdi + rax]
lea rcx, [rbp - 1]
cmp r11d, 1
jne 0x140041af4
test rcx, rcx
js 0x140041b39
nop word [rax + rax]
mov byte [rdx + rcx*2 + 1], 0xff
movzx eax, byte [rcx + rdx]
mov byte [rdx + rcx*2], al
sub rcx, 1
jns 0x140041ae0
jmp 0x140041b39
test rcx, rcx
js 0x140041b39
lea r8, [rcx*2 + 1]
add r8, rdx
lea rdx, [rdx + rcx*4]
add r8, rcx
add rdx, 2
nop
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 0x140041b10
mov r9, qword [rsp + 0x78]
mov ebx, dword [rsp + 0x120]
inc r9d
mov qword [rsp + 0x78], r9
cmp r9d, dword [rsp + 0x118]
jb 0x140041730
mov eax, 1
jmp 0x140040b56
cmp ebx, 0x10
jne 0x140041ba5
mov eax, dword [rsp + 0x108]
mov r8, r10
imul eax, r15d
imul eax, esi
test eax, eax
je 0x140041ba5
mov r9d, eax
movzx edx, byte [r10]
lea r10, [r10 + 2]
movzx ecx, byte [r8 + 1]
lea r8, [r8 + 2]
shl dx, 8
or dx, cx
mov word [r8 - 2], dx
sub r9, 1
jne 0x140041b82
mov eax, 1
jmp 0x140040b56
mov rax, qword gs:[0x58]
mov edx, 0x18
mov rcx, qword [rax]
lea rax, str.too_large
jmp 0x140040b50
mov qword [rsi + 0x18], r8
mov rax, qword gs:[0x58]
mov edx, 0x18
mov rcx, qword [rax]
lea rax, str.outofmem
mov qword [rdx + rcx], rax
xor eax, eax
jmp 0x140040b5e