Function at 0x140169e00
Capabilities:
Encode data using xor

Disassembly:
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x68
mov eax, dword [rcx + 0x10]
mov dword [rsp + 0x28], eax
mov eax, dword [rcx + 8]
mov rbp, rdx
mov rbx, rcx
lea rdx, str.sqlcipher_cipher_ctx_key_derive:_ctx__kdf_salt_sz_d_ctx__kdf_iter_d_ctx__fast_kdf_iter_d_ctx__key_sz_d
mov dword [rsp + 0x20], eax
mov r9d, dword [rcx + 4]
mov r8d, dword [rcx + 0xc]
mov ecx, 8
call dbg.sqlcipher_log
mov rax, qword [rbp + 0x18]
test rax, rax
je 0x14016a108
mov ecx, dword [rbp + 4]
test ecx, ecx
je 0x14016a108
test byte [rbx + 0x38], 0x10
je 0x14016a238
mov edx, dword [rbx + 0x10]
lea r9d, [rdx + rdx]
lea esi, [r9 + 3]
cmp ecx, esi
je 0x14016a130
add edx, dword [rbx + 0xc]
add edx, edx
lea r8d, [rdx + 3]
cmp ecx, r8d
jne 0x140169edf
movzx ecx, byte [rax]
test cl, cl
je 0x140169edf
lea r8, [0x1403489c0]
cmp byte [r8 + rcx], 0x78
jne 0x140169edf
movzx ecx, byte [rax + 1]
test cl, cl
je 0x140169edf
movsxd rcx, ecx
cmp byte [r8 + rcx], 0x27
jne 0x140169edf
lea rsi, [rax + 2]
test edx, edx
jle 0x14016a1b5
movsxd rdx, edx
mov rcx, rsi
lea r8, [rax + rdx + 2]
nop word [rax + rax]
movzx eax, byte [rcx]
mov edx, eax
and edx, 0xffffffdf
sub edx, 0x41
cmp dl, 5
jbe 0x14016a1a8
sub eax, 0x30
cmp al, 9
jbe 0x14016a1a8
mov r8d, dword [rbx + 4]
lea rdx, str.cipher_ctx_key_derive:_deriving_key_using_full_PBKDF2_with__d_iterations
mov ecx, 8
call dbg.sqlcipher_log
mov r8, qword [rbp + 8]
mov edx, dword [rbx + 0x34]
mov rcx, qword [rbx + 0x78]
mov rax, qword [rbx + 0x70]
mov qword [rsp + 0x40], r8
mov r8d, dword [rbx + 0x10]
mov dword [rsp + 0x38], r8d
mov r8d, dword [rbx + 4]
mov dword [rsp + 0x30], r8d
mov r8d, dword [rbx + 0xc]
mov dword [rsp + 0x28], r8d
mov r8, qword [rbx + 0x40]
mov qword [rsp + 0x20], r8
mov r9d, dword [rbp + 4]
mov r8, qword [rbp + 0x18]
call qword [rax + 0x30]
test eax, eax
jne 0x14016a280
mov rsi, qword [rbp + 0x20]
lea rdx, str.sqlcipher_free:_calling_sqlcipher_memset__p_0__llu_
mov ecx, 0x10
movsxd r12, dword [rbx + 0x20]
mov rdi, qword [rbp + 8]
mov r8, rsi
mov r9, r12
call dbg.sqlcipher_log
mov r8, r12
xor edx, edx
mov rcx, rsi
call dbg.sqlcipher_memset
mov rdx, r12
mov rcx, rsi
call sym.sqlcipher_munlock
mov rcx, rsi
call sym.sqlite3_free
movsxd rcx, dword [rbx + 0x20]
mov qword [rbp + 0x20], 0
call dbg.sqlcipher_malloc
test rax, rax
mov qword [rbp + 0x20], rax
je 0x14016a2a0
mov byte [rax], 0x78
mov rax, qword [rbp + 0x20]
mov byte [rax + 1], 0x27
movsxd r12, dword [rbx + 0x10]
mov rsi, qword [rbp + 0x20]
test r12d, r12d
jle 0x140169ff9
lea r13, str._02x
add rsi, 2
add r12, rdi
nop word cs:[rax + rax]
movzx r9d, byte [rdi]
mov rdx, rsi
mov r8, r13
mov ecx, 3
add rdi, 1
add rsi, 2
call dbg.sqlite3_snprintf
cmp r12, rdi
jne 0x140169fd0
mov rsi, qword [rbp + 0x20]
mov r12d, dword [rbx + 0x10]
mov eax, dword [rbx + 0xc]
add r12d, r12d
movsxd r12, r12d
mov rdi, qword [rbx + 0x40]
add r12, 2
test eax, eax
jle 0x14016a045
lea r13, str._02x
add rsi, r12
movsxd r12, eax
add r12, rdi
nop
movzx r9d, byte [rdi]
mov rdx, rsi
mov r8, r13
mov ecx, 3
add rdi, 1
add rsi, 2
call dbg.sqlite3_snprintf
cmp rdi, r12
jne 0x14016a020
mov rsi, qword [rbp + 0x20]
movsxd rax, dword [rbx + 0x20]
mov byte [rsi + rax - 1], 0x27
test byte [rbx + 0x38], 1
je 0x14016a0ed
mov rdx, qword [rbx + 0x40]
mov rcx, qword [rbx + 0x48]
movsxd r8, dword [rbx + 0xc]
call sym.memcpy
mov edx, dword [rbx + 0xc]
xor eax, eax
test edx, edx
jle 0x14016a091
nop word [rax + rax]
mov rdx, qword [rbx + 0x48]
movzx ecx, byte [0x1402137f0]
add rdx, rax
add rax, 1
xor byte [rdx], cl
cmp dword [rbx + 0xc], eax
jg 0x14016a078
mov r8d, dword [rbx + 8]
lea rdx, str.cipher_ctx_key_derive:_deriving_hmac_key_from_encryption_key_using_PBKDF2_with__d_iterations
mov ecx, 8
call dbg.sqlcipher_log
mov r8, qword [rbp + 0x10]
mov r9d, dword [rbx + 0x10]
mov edx, dword [rbx + 0x34]
mov rcx, qword [rbx + 0x78]
mov rax, qword [rbx + 0x70]
mov qword [rsp + 0x40], r8
mov dword [rsp + 0x38], r9d
mov r8d, dword [rbx + 8]
mov dword [rsp + 0x30], r8d
mov r8d, dword [rbx + 0xc]
mov dword [rsp + 0x28], r8d
mov r8, qword [rbx + 0x48]
mov qword [rsp + 0x20], r8
mov r8, qword [rbp + 8]
call qword [rax + 0x30]
test eax, eax
jne 0x14016a2c8
mov dword [rbp], 0
xor eax, eax
add rsp, 0x68
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
ret
lea rdx, str.cipher_ctx_key_derive:_key_material_is_not_present_on_the_context_for_key_derivation
mov ecx, 1
call dbg.sqlcipher_log
mov eax, 1
jmp 0x14016a0f6
mov rax, qword [rbp + 0x18]
test rax, rax
je 0x140169edf
nop dword [rax]
movzx ecx, byte [rax]
test cl, cl
je 0x14016a18d
lea r8, [0x1403489c0]
cmp byte [r8 + rcx], 0x78
jne 0x14016a18d
movzx ecx, byte [rax + 1]
test cl, cl
je 0x14016a18d
movsxd rcx, ecx
cmp byte [r8 + rcx], 0x27
jne 0x14016a18d
lea rdi, [rax + 2]
test r9d, r9d
jle 0x14016a20d
movsxd r9, r9d
mov r8, rdi
lea r10, [rax + r9 + 2]
nop
movzx ecx, byte [r8]
mov r9d, ecx
and r9d, 0xffffffdf
sub r9d, 0x41
cmp r9b, 5
jbe 0x14016a200
sub ecx, 0x30
cmp cl, 9
jbe 0x14016a200
add edx, dword [rbx + 0xc]
add edx, edx
lea ecx, [rdx + 3]
cmp esi, ecx
je 0x140169e7c
jmp 0x140169edf
add rcx, 1
cmp rcx, r8
jne 0x140169ec0
lea rdx, str.cipher_ctx_key_derive:_using_raw_key_from_hex
mov ecx, 8
call dbg.sqlcipher_log
mov eax, dword [rbx + 0x10]
mov rcx, rsi
mov r8, qword [rbp + 8]
lea edx, [rax + rax]
call dbg.cipher_hex2bin
mov eax, dword [rbx + 0xc]
mov r8, qword [rbx + 0x40]
lea edx, [rax + rax]
mov eax, dword [rbx + 0x10]
add eax, eax
cdqe
lea rcx, [rsi + rax]
call dbg.cipher_hex2bin
jmp 0x140169f3f
add r8, 1
cmp r10, r8
jne 0x14016a170
lea rdx, str.cipher_ctx_key_derive:_using_raw_key_from_hex
mov ecx, 8
call dbg.sqlcipher_log
mov r8, qword [rbp + 8]
lea edx, [rsi - 3]
mov rcx, rdi
call dbg.cipher_hex2bin
jmp 0x140169f3f
mov rcx, rbx
call dbg.sqlcipher_codec_ctx_init_kdf_salt
test eax, eax
jne 0x14016a2e0
mov edx, dword [rbx + 0x10]
mov esi, dword [rbp + 4]
lea r9d, [rdx + rdx]
lea eax, [r9 + 3]
cmp esi, eax
je 0x14016a120
add edx, dword [rbx + 0xc]
add edx, edx
lea eax, [rdx + 3]
cmp esi, eax
jne 0x140169edf
mov rax, qword [rbp + 0x18]
test rax, rax
je 0x140169edf
jmp 0x140169e7c
lea rdx, str.cipher_ctx_key_derive:_error_occurred_from_provider_kdf_generating_encryption_key
mov ecx, 1
call dbg.sqlcipher_log
jmp 0x14016a119
mov r8d, 7
mov ecx, 1
lea rdx, str.sqlcipher_cipher_ctx_key_derive:_error__d_from_sqlcipher_cipher_ctx_set_keyspec
call dbg.sqlcipher_log
mov eax, 7
jmp 0x14016a0f6
lea rdx, str.cipher_ctx_key_derive:_error_occurred_from_provider_kdf_generating_HMAC_key
mov ecx, 1
call dbg.sqlcipher_log
jmp 0x14016a119
mov r8d, eax
mov ecx, 1
mov dword [rsp + 0x5c], eax
lea rdx, str.sqlcipher_cipher_ctx_key_derive:_error__d_from_sqlcipher_codec_ctx_init_kdf_salt
call dbg.sqlcipher_log
mov eax, dword [rsp + 0x5c]
jmp 0x14016a0f6