Function at 0x140222bf0
Capabilities:
Encode data using xor

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x48
mov ebp, dword [rsp + 0xc0]
mov r13d, dword [rsp + 0xb0]
mov eax, dword [rcx]
mov esi, dword [rcx + 0x14]
mov edi, ebp
mov r12, rcx
mov qword [rsp + 0x98], rdx
sub edi, 1
mov dword [rsp + 0xa0], r8d
mov r14d, r13d
mov dword [rsp + 0xa8], r9d
mov dword [rsp + 0x2c], eax
mov dword [rsp + 0x3c], edi
js 0x1402231d0
mov rbx, qword [rsp + 0xb8]
movsxd rdx, edi
movsxd rax, ebp
add rdx, qword [rsp + 0xb8]
lea rcx, [rbx + rax - 2]
mov eax, edi
sub rcx, rax
mov eax, 0xd
nop word [rax + rax]
lea r8d, [rax*8]
sub rdx, 1
xor eax, r8d
movzx r8d, byte [rdx + 1]
xor eax, r8d
cmp rcx, rdx
jne 0x140222c70
lea edx, [rax*8]
movzx edi, r13b
xor eax, edx
xor edx, edx
mov rbx, qword [r12 + 0x20]
xor eax, edi
mov dword [rsp + 0x38], edi
div esi
mov qword [rsp + 0x30], rbx
mov eax, edx
mov dword [rsp + 0x28], edx
mov rbx, qword [rbx + rax*8]
lea rdi, [rax*8]
test rbx, rbx
je 0x140222e50
movsxd r15, ebp
jmp 0x140222cdc
mov rbx, qword [rbx]
test rbx, rbx
je 0x140222e50
cmp byte [rbx + 0x30], r14b
jne 0x140222cd0
cmp dword [rbx + 0x1c], ebp
jne 0x140222cd0
mov rdx, qword [rsp + 0xb8]
lea rcx, [rbx + 0x31]
mov r8, r15
call sub.msvcrt.dll_memcmp
test eax, eax
jne 0x140222cd0
mov esi, dword [rbx + 0x10]
mov r8d, eax
mov ebp, dword [rbx + 0x18]
mov eax, esi
sub eax, ebp
cmp eax, 0x15
jle 0x140222fa8
mov esi, ebp
mov rax, qword [rbx + 0x28]
neg esi
cmp rax, qword [rsp + 0x98]
je 0x140222f62
mov rdi, qword [rsp + 0x98]
xor r8d, r8d
mov rcx, r12
mov rdx, rbx
sub rdi, rax
call sym.fts5HashAddPoslistSize
movsxd rax, dword [rbx + 0x18]
cmp rdi, 0x7f
lea rcx, [rbx + rax]
jbe 0x1402231c2
cmp rdi, 0x3fff
jbe 0x140223176
mov rdx, rdi
call sym.putVarint64
mov r8d, eax
add r8d, dword [rbx + 0x18]
mov rax, qword [rsp + 0x98]
movd xmm1, r8d
mov qword [rbx + 0x28], rax
pshufd xmm0, xmm1, 0xe0
movq qword [rbx + 0x14], xmm0
mov eax, dword [r12]
cmp eax, 1
je 0x140223198
mov r9d, dword [rsp + 0xa0]
mov edi, eax
add r8d, 1
mov dword [rbx + 0x24], 0
neg edi
mov dword [rbx + 0x18], r8d
sbb dx, dx
mov word [rbx + 0x22], dx
test r9d, r9d
js 0x14022300f
movsx edx, dx
cmp dword [rsp + 0xa0], edx
mov ebp, r8d
mov edi, 1
je 0x140222dfb
test eax, eax
je 0x1402231ed
movzx eax, word [rsp + 0xa0]
mov word [rbx + 0x22], ax
mov eax, dword [rsp + 0xa0]
mov dword [rsp + 0xa8], eax
mov eax, dword [rsp + 0xa8]
movsxd rbp, ebp
sub eax, dword [rbx + 0x24]
add rbp, rbx
add eax, 2
movsxd rdx, eax
cmp rdx, 0x7f
jbe 0x1402231df
cmp rdx, 0x3fff
jbe 0x14022322e
mov rcx, rbp
call sym.putVarint64
mov r8d, eax
add r8d, dword [rbx + 0x18]
mov eax, dword [rsp + 0xa8]
mov dword [rbx + 0x18], r8d
add r8d, esi
mov dword [rbx + 0x24], eax
jmp 0x140223016
mov eax, dword [r12 + 0x10]
add eax, eax
cmp esi, eax
jle 0x140223022
call sym.sqlite3_initialize
test eax, eax
mov esi, eax
jne 0x140222ff9
movsxd r15, ebp
mov eax, pe_nt_image_headers64
lea rdx, [r15 + 0x72]
cmp rdx, rax
cmovl rdx, rax
mov rcx, rdx
mov qword [rsp + 0x30], rdx
call sym.sqlite3Malloc
test rax, rax
mov rbx, rax
je 0x140222ff9
mov rdx, qword [rsp + 0x30]
xor eax, eax
mov ecx, 6
mov rdi, rbx
rep stosq qword [rdi], rax
lea rcx, [rbx + 0x31]
mov byte [rbx + 0x30], r13b
mov r8, r15
mov dword [rbx + 0x10], edx
mov rdx, qword [rsp + 0xb8]
call sym.memcpy
mov dword [rbx + 0x1c], ebp
mov r14d, dword [rsp + 0x28]
add ebp, 0x32
mov byte [rbx + r15 + 0x31], 0
mov rax, qword [r12 + 0x20]
mov dword [rbx + 0x18], ebp
movsxd rbp, ebp
lea rcx, [rbx + rbp]
lea rax, [rax + r14*8]
mov rdx, qword [rax]
mov qword [rbx], rdx
mov qword [rax], rbx
add dword [r12 + 0x10], 1
cmp qword [rsp + 0x98], 0x7f
jbe 0x14022324d
cmp qword [rsp + 0x98], 0x3fff
jbe 0x140223261
mov rdx, qword [rsp + 0x98]
call sym.putVarint64
mov ebp, eax
add ebp, dword [rbx + 0x18]
mov rax, qword [rsp + 0x98]
movd xmm2, ebp
mov qword [rbx + 0x28], rax
pshufd xmm0, xmm2, 0xe0
movq qword [rbx + 0x14], xmm0
mov eax, dword [r12]
cmp eax, 1
je 0x140222f5f
add ebp, 1
neg eax
sbb ax, ax
mov dword [rbx + 0x18], ebp
mov word [rbx + 0x22], ax
mov r8d, ebp
mov ecx, dword [rsp + 0xa0]
test ecx, ecx
js 0x140223012
mov eax, dword [r12]
cmp eax, 1
je 0x1402231aa
mov edx, dword [rsp + 0x2c]
xor edi, edi
test edx, edx
movsx edx, word [rbx + 0x22]
sete dil
cmp edx, dword [rsp + 0xa0]
jne 0x140222dd9
lea r8d, [rsi + rbp]
test edi, edi
je 0x140223016
jmp 0x140222dfb
mov dword [rsp + 0x28], r8d
call sym.sqlite3_initialize
test eax, eax
jne 0x140222ff9
add esi, esi
mov rcx, rbx
movsxd rdx, esi
call sym.sqlite3Realloc
test rax, rax
je 0x140222ff9
add rdi, qword [r12 + 0x20]
mov dword [rax + 0x10], esi
mov r8d, dword [rsp + 0x28]
mov rdx, qword [rdi]
cmp rbx, rdx
je 0x140222feb
nop dword [rax]
mov rdi, rdx
mov rdx, qword [rdx]
cmp rdx, rbx
jne 0x140222fe0
mov ebp, dword [rax + 0x18]
mov qword [rdi], rax
mov rbx, rax
jmp 0x140222d15
mov eax, 7
add rsp, 0x48
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
sub r8d, ebp
mov byte [rbx + 0x20], 1
mov rax, qword [r12 + 8]
add dword [rax], r8d
xor eax, eax
jmp 0x140222ffe
call sym.sqlite3_initialize
test eax, eax
jne 0x140222ff9
add esi, esi
movsxd rax, esi
lea rdi, [rax*8]
mov rcx, rdi
call sym.sqlite3Malloc
test rax, rax
mov rbx, rax
je 0x140222ff9
xor edx, edx
mov r8, rdi
mov rcx, rax
call sub.msvcrt.dll_memset
movsxd rax, dword [r12 + 0x14]
test eax, eax
jle 0x1402230f6
mov rdi, qword [rsp + 0x30]
lea r15, [rdi + rax*8]
mov r14, rdi
nop
mov rdi, qword [r14]
test rdi, rdi
je 0x1402230e9
nop dword [rax + rax]
mov rax, qword [rdi]
lea rcx, [rdi + 0x30]
mov qword [r14], rax
call sym.strlen
mov edx, eax
sub edx, 1
js 0x1402231b8
cdqe
movsxd rcx, edx
mov edx, edx
lea r8, [rdi + rax - 2]
add rcx, rdi
mov eax, 0xd
sub r8, rdx
nop dword [rax]
lea edx, [rax*8]
sub rcx, 1
xor eax, edx
movzx edx, byte [rcx + 0x31]
xor eax, edx
cmp r8, rcx
jne 0x1402230b8
xor edx, edx
div esi
lea rax, [rbx + rdx*8]
mov rdx, qword [rax]
mov qword [rdi], rdx
mov qword [rax], rdi
mov rdi, qword [r14]
test rdi, rdi
jne 0x140223080
add r14, 8
cmp r14, r15
jne 0x140223070
mov rcx, qword [rsp + 0x30]
call sym.sqlite3_free
mov edi, dword [rsp + 0x3c]
mov dword [r12 + 0x14], esi
mov qword [r12 + 0x20], rbx
test edi, edi
js 0x14022328d
mov rbx, qword [rsp + 0xb8]
movsxd rcx, edi
movsxd rax, ebp
add rcx, qword [rsp + 0xb8]
lea r8, [rbx + rax - 2]
mov eax, edi
sub r8, rax
mov eax, 0xd
nop dword [rax + rax]
lea edx, [rax*8]
sub rcx, 1
xor eax, edx
movzx edx, byte [rcx + 1]
xor eax, edx
cmp rcx, r8
jne 0x140223140
lea edx, [rax*8]
mov edi, dword [rsp + 0x38]
xor eax, edx
xor edx, edx
xor edi, eax
mov eax, edi
div esi
mov dword [rsp + 0x28], edx
jmp 0x140222e5f
mov rdx, rdi
xor eax, eax
mov r8d, 2
shr rdx, 7
mov al, dl
mov edx, edi
or al, 0x80
and edx, 0x7f
mov ah, dl
mov word [rcx], ax
jmp 0x140222d6e
mov eax, dword [rsp + 0xa0]
sub r8d, ebp
test eax, eax
js 0x140223012
mov byte [rbx + 0x21], 1
jmp 0x140223016
mov eax, 0xd
jmp 0x1402230d0
mov byte [rcx], dil
mov r8d, 1
jmp 0x140222d6e
mov edx, 0x68
mov eax, 0xd
jmp 0x140222c93
mov byte [rbp], al
mov r8d, 1
jmp 0x140222e33
lea eax, [rbp + 1]
movsxd rbp, ebp
movsxd rdx, dword [rsp + 0xa0]
mov dword [rbx + 0x18], eax
mov byte [rbx + rbp], 1
movsxd rcx, dword [rbx + 0x18]
add rcx, rbx
call sym.sqlite3PutVarint
add eax, dword [rbx + 0x18]
mov dword [rbx + 0x24], 0
mov ebp, eax
mov dword [rbx + 0x18], eax
movzx eax, word [rsp + 0xa0]
mov word [rbx + 0x22], ax
jmp 0x140222f9b
xor ecx, ecx
shr rdx, 7
and eax, 0x7f
mov cl, dl
mov r8d, 2
or cl, 0x80
mov ch, al
mov word [rbp], cx
jmp 0x140222e33
movzx eax, byte [rsp + 0x98]
mov ebp, 1
mov byte [rcx], al
jmp 0x140222f2a
mov rdx, qword [rsp + 0x98]
xor eax, eax
mov ebp, 2
shr rdx, 7
mov al, dl
movzx edx, byte [rsp + 0x98]
or al, 0x80
and edx, 0x7f
mov ah, dl
mov word [rcx], ax
jmp 0x140222f2a
mov edx, 0x68
mov eax, 0xd
jmp 0x14022315f