Function at 0x1401b6220
Capabilities:
Move file

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0xa8
lea rdx, str.main
mov rax, qword [rcx + 0x58]
mov rax, qword [rax]
mov qword [rsp + 0xf0], rcx
mov rcx, rax
mov qword [rsp + 0x48], rax
call dbg.sqlite3_db_filename
mov qword [rsp + 0x90], 0
test rax, rax
mov rsi, rax
mov qword [rsp + 0x98], 0
mov dword [rsp + 0x88], 0
mov dword [rsp + 0x84], 0
je 0x1401b6590
mov rcx, rax
call sym.strlen
mov ebx, eax
and ebx, 0x3fffffff
jne 0x1401b6308
mov dword [rsp + 0x30], 0
xor edi, edi
test rdi, rdi
je 0x1401b62ed
movsxd rbp, dword [rsp + 0x30]
mov r8, rdi
mov ecx, 0x10
lea rdx, str.sqlcipher_free:_calling_sqlcipher_memset__p_0__llu_
mov r9, rbp
call dbg.sqlcipher_log
mov r8, rbp
xor edx, edx
mov rcx, rdi
call dbg.sqlcipher_memset
mov rcx, rdi
mov rdx, rbp
call sym.sqlcipher_munlock
mov rcx, rdi
call sym.sqlite3_free
mov eax, ebx
add rsp, 0xa8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov rax, qword [rsp + 0xf0]
lea r14, [rsp + 0x98]
lea r13, [rsp + 0x88]
mov rax, qword [rax + 0x60]
mov r12d, dword [rax + 4]
lea ebx, [r12 + 1]
movsxd rbx, ebx
mov rcx, rbx
call dbg.sqlcipher_malloc
mov r8, rbx
xor edx, edx
mov rcx, rax
mov r15, rax
call sym.memset
mov rax, qword [rsp + 0xf0]
movsxd r8, r12d
mov rcx, r15
mov qword [rsp + 0x38], r8
mov rax, qword [rax + 0x60]
mov rdx, qword [rax + 0x18]
call sym.memcpy
mov qword [rsp + 0x28], r14
mov r8d, r12d
mov rdx, r15
mov qword [rsp + 0x20], r13
lea r9, [0x1403370ef]
mov rcx, rsi
call dbg.sqlcipher_check_connection
mov dword [rsp + 0x44], 3
test eax, eax
mov ebx, eax
je 0x1401b65a8
mov qword [rsp + 0x30], rsi
mov edi, 3
lea rcx, str.PRAGMA_cipher_compatibility___d_
mov edx, edi
call dbg.sqlite3_mprintf
mov rcx, qword [rsp + 0x30]
mov r8d, r12d
mov rdx, r15
mov qword [rsp + 0x28], r14
mov r9, rax
mov rbp, rax
mov qword [rsp + 0x20], r13
call dbg.sqlcipher_check_connection
test eax, eax
mov esi, eax
je 0x1401b6620
test rbp, rbp
je 0x1401b6427
mov rcx, rbp
call sym.strlen
mov r8, rbp
mov ecx, 0x10
lea rdx, str.sqlcipher_free:_calling_sqlcipher_memset__p_0__llu_
and eax, 0x3fffffff
mov rbx, rax
mov r9, rax
call dbg.sqlcipher_log
mov r8, rbx
xor edx, edx
mov rcx, rbp
call dbg.sqlcipher_memset
mov rcx, rbp
mov rdx, rbx
call sym.sqlcipher_munlock
mov rcx, rbp
call sym.sqlite3_free
sub edi, 1
jne 0x1401b63a3
lea rdx, str.Upgrade_format_not_determined
mov dword [rsp + 0x44], edi
mov ebx, esi
xor r12d, r12d
mov ecx, 1
xor ebp, ebp
call dbg.sqlcipher_log
mov r8d, esi
mov ecx, 1
lea rdx, str.An_error_occurred_attempting_to_migrate_the_database___last_error__d
call dbg.sqlcipher_log
mov rdi, qword [rsp + 0x38]
mov r8, r15
mov ecx, 0x10
lea rdx, str.sqlcipher_free:_calling_sqlcipher_memset__p_0__llu_
mov r9, rdi
call dbg.sqlcipher_log
mov r8, rdi
xor edx, edx
mov rcx, r15
call dbg.sqlcipher_memset
mov rdx, rdi
mov rcx, r15
xor edi, edi
call sym.sqlcipher_munlock
mov rcx, r15
call sym.sqlite3_free
mov rsi, qword [rsp + 0x98]
mov dword [rsp + 0x30], 0
test rsi, rsi
je 0x1401b64fa
mov rcx, rsi
call sym.strlen
mov r8, rsi
mov ecx, 0x10
lea rdx, str.sqlcipher_free:_calling_sqlcipher_memset__p_0__llu_
and eax, 0x3fffffff
mov r13, rax
mov r9, rax
call dbg.sqlcipher_log
mov r8, r13
xor edx, edx
mov rcx, rsi
call dbg.sqlcipher_memset
mov rcx, rsi
mov rdx, r13
call sym.sqlcipher_munlock
mov rcx, rsi
call sym.sqlite3_free
test rbp, rbp
je 0x1401b6546
mov rcx, rbp
call sym.strlen
mov r8, rbp
mov ecx, 0x10
lea rdx, str.sqlcipher_free:_calling_sqlcipher_memset__p_0__llu_
and eax, 0x3fffffff
mov rsi, rax
mov r9, rax
call dbg.sqlcipher_log
mov r8, rsi
xor edx, edx
mov rcx, rbp
call dbg.sqlcipher_memset
mov rcx, rbp
mov rdx, rsi
call sym.sqlcipher_munlock
mov rcx, rbp
call sym.sqlite3_free
test r12, r12
je 0x1401b62ac
movsxd rsi, dword [rsp + 0x44]
mov r8, r12
mov ecx, 0x10
lea rdx, str.sqlcipher_free:_calling_sqlcipher_memset__p_0__llu_
mov r9, rsi
call dbg.sqlcipher_log
mov r8, rsi
xor edx, edx
mov rcx, r12
call dbg.sqlcipher_memset
mov rcx, r12
mov rdx, rsi
call sym.sqlcipher_munlock
mov rcx, r12
call sym.sqlite3_free
jmp 0x1401b62ac
xor edi, edi
mov dword [rsp + 0x30], 0
xor ebx, ebx
jmp 0x1401b62ac
lea rdx, str.No_upgrade_required___exiting
mov ecx, 8
xor r12d, r12d
call dbg.sqlcipher_log
mov rdi, qword [rsp + 0x38]
mov r8, r15
xor ebp, ebp
lea rdx, str.sqlcipher_free:_calling_sqlcipher_memset__p_0__llu_
mov ecx, 0x10
mov r9, rdi
call dbg.sqlcipher_log
mov r8, rdi
xor edx, edx
mov rcx, r15
call dbg.sqlcipher_memset
mov rdx, rdi
mov rcx, r15
xor edi, edi
call sym.sqlcipher_munlock
mov rcx, r15
call sym.sqlite3_free
mov rsi, qword [rsp + 0x98]
mov dword [rsp + 0x30], 0
mov dword [rsp + 0x44], 0
jmp 0x1401b64ae
mov rsi, qword [rsp + 0x30]
mov r8d, edi
mov ecx, 8
mov ebx, eax
lea rdx, str.Version__d_format_found
call dbg.sqlcipher_log
lea rcx, str._s_migrated
mov rdx, rsi
call dbg.sqlite3_mprintf
test rax, rax
mov rdi, rax
je 0x1401b6e64
mov rcx, rax
call sym.strlen
and eax, 0x3fffffff
lea rcx, [rax + 2]
call dbg.sqlcipher_malloc
mov rcx, rdi
mov qword [rsp + 0x50], rax
call sym.strlen
and eax, 0x3fffffff
mov r8, rax
mov r14, qword [rsp + 0x50]
mov rdx, rdi
mov rcx, r14
call sym.memcpy
mov rcx, rdi
call sym.strlen
mov r8, rdi
mov ecx, 0x10
lea rdx, str.sqlcipher_free:_calling_sqlcipher_memset__p_0__llu_
and eax, 0x3fffffff
mov r9, rax
mov r13, rax
call dbg.sqlcipher_log
mov r8, r13
xor edx, edx
mov rcx, rdi
call dbg.sqlcipher_memset
mov rdx, r13
mov rcx, rdi
call sym.sqlcipher_munlock
mov rcx, rdi
call sym.sqlite3_free
mov r8, r15
mov rdx, r14
lea rcx, str.ATTACH_DATABASE__s_as_migrate_
call dbg.sqlite3_mprintf
mov edx, dword [rsp + 0x88]
lea rcx, str.PRAGMA_migrate.user_version___d_
mov r14, rax
call dbg.sqlite3_mprintf
mov rcx, qword [rsp + 0x48]
xor r9d, r9d
xor r8d, r8d
mov qword [rsp + 0x20], 0
mov rdx, rbp
mov qword [rsp + 0x60], rax
call dbg.sqlite3_exec
test eax, eax
mov dword [rsp + 0x58], eax
jne 0x1401b6e08
mov rcx, qword [rsp + 0x48]
xor r8d, r8d
xor r9d, r9d
mov qword [rsp + 0x20], 0
lea rdx, str.PRAGMA_journal_mode__delete_
call dbg.sqlite3_exec
lea rdx, str.force_journal_mode_DELETE_failed__error_code__d
test eax, eax
mov dword [rsp + 0x44], eax
mov edi, eax
mov r8d, eax
jne 0x1401b6dd8
mov rcx, qword [rsp + 0x48]
xor r8d, r8d
xor r9d, r9d
mov rdx, r14
mov qword [rsp + 0x20], 0
call dbg.sqlite3_exec
lea rdx, str.attach_failed__error_code__d
test eax, eax
mov dword [rsp + 0x58], eax
mov r8d, eax
jne 0x1401b6e45
mov rcx, qword [rsp + 0x48]
lea rdx, str.migrate
mov r8, r15
mov r9d, r12d
call sym.sqlite3_key_v2
lea rdx, str.keying_attached_database_failed__error_code__d
test eax, eax
mov dword [rsp + 0x44], eax
mov edi, eax
mov r8d, eax
jne 0x1401b6dd8
mov rcx, qword [rsp + 0x48]
xor r9d, r9d
xor r8d, r8d
mov qword [rsp + 0x20], 0
lea rdx, str.SELECT_sqlcipher_export_migrate__
call dbg.sqlite3_exec
test eax, eax
mov dword [rsp + 0x58], eax
jne 0x1401b6e3b
mov rdx, qword [rsp + 0x60]
xor r9d, r9d
xor r8d, r8d
mov qword [rsp + 0x20], 0
mov rcx, qword [rsp + 0x48]
call dbg.sqlite3_exec
test eax, eax
mov dword [rsp + 0x44], eax
jne 0x1401b6dc5
mov rax, qword [rsp + 0x48]
cmp byte [rax + 0x65], 0
je 0x1401b6ea9
mov rax, qword [rsp + 0x48]
cmp dword [rax + 0xd8], 1
jg 0x1401b6e7b
mov r13, qword [rsp + 0x48]
movsxd rax, dword [r13 + 0x28]
mov rdx, qword [r13 + 0x20]
shl rax, 5
mov rcx, qword [rdx + 8]
mov rdi, qword [rdx + rax - 0x18]
mov qword [rsp + 0x68], rcx
mov rcx, rdi
call sym.sqlite3BtreeGetRequestedReserve
mov rcx, qword [rsp + 0x68]
xor r9d, r9d
mov r12d, eax
mov edx, dword [0x1402137e8]
mov r8d, r12d
mov rax, qword [rcx + 8]
and word [rax + 0x28], 0xfffd
call dbg.sqlite3BtreeSetPageSize
mov r8d, dword [0x1402137e8]
mov r9d, r12d
mov ecx, 8
mov dword [rsp + 0x20], eax
lea rdx, str.set_btree_page_size_to__d_res__d_rc__d
mov dword [rsp + 0x58], eax
call dbg.sqlcipher_log
mov r10d, dword [rsp + 0x58]
test r10d, r10d
jne 0x1401b6e4f
mov eax, dword [r13 + 0x28]
lea r9, [rsp + 0x84]
mov rcx, r13
lea r8, [rsp + 0x90]
lea edx, [rax - 1]
mov dword [rsp + 0x30], eax
call dbg.sqlcipherCodecGetKey
mov rax, qword [rsp + 0xf0]
xor edx, edx
mov rcx, r13
mov r9d, dword [rsp + 0x84]
mov r8, qword [rsp + 0x90]
and dword [rax + 0x38], 0xfffffff7
call dbg.sqlcipherCodecAttach
mov rax, qword [rdi + 8]
mov rcx, qword [rsp + 0x68]
mov rax, qword [rax]
mov rdi, qword [rax + 0x48]
mov rax, qword [rcx + 8]
mov qword [rsp + 0x58], rdi
mov rax, qword [rax]
mov rax, qword [rax + 0x48]
mov qword [rsp + 0x70], rax
mov rax, qword [rdi]
test rax, rax
je 0x1401b6939
mov rcx, rdi
call qword [rax + 8]
xor r9d, r9d
mov qword [rdi], r9
mov rdi, qword [rsp + 0x70]
mov rax, qword [rdi]
test rax, rax
je 0x1401b6952
mov rcx, rdi
call qword [rax + 8]
xor r8d, r8d
mov qword [rdi], r8
lea rdx, str.performing_windows_MoveFileExA
mov ecx, 8
call dbg.sqlcipher_log
xor edx, edx
mov r9d, 0xffffffff
mov r8, rsi
mov r13, qword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov ecx, 0xfde9
mov dword [rsp + 0x28], 0
mov qword [rsp + 0x20], 0
call r13
movsxd rcx, eax
mov rdi, rcx
add rcx, rcx
call dbg.sqlcipher_malloc
xor edx, edx
mov dword [rsp + 0x28], edi
mov r8, rsi
mov r12, rax
mov r9d, 0xffffffff
mov ecx, 0xfde9
mov qword [rsp + 0x20], rax
call r13
xor edx, edx
mov r8, qword [rsp + 0x50]
mov r9d, 0xffffffff
mov ecx, 0xfde9
mov dword [rsp + 0x44], eax
mov dword [rsp + 0x28], 0
mov qword [rsp + 0x20], 0
call r13
movsxd rcx, eax
mov dword [rsp + 0x30], ecx
add rcx, rcx
call dbg.sqlcipher_malloc
mov edx, dword [rsp + 0x30]
mov r9d, 0xffffffff
mov ecx, 0xfde9
mov r8, qword [rsp + 0x50]
mov rdi, rax
mov qword [rsp + 0x20], rax
mov dword [rsp + 0x28], edx
xor edx, edx
call r13
mov r8d, 1
mov rdx, r12
mov rcx, rdi
mov dword [rsp + 0x30], eax
call qword [sym.imp.KERNEL32.dll_MoveFileExW]
test eax, eax
je 0x1401b6ebc
mov r13, qword [rsp + 0x50]
xor ecx, ecx
mov r9, rsi
mov dword [rsp + 0x20], ecx
lea rdx, str.renamed_migration_database__s_to_main_database__s:__d
mov ecx, 8
mov r8, r13
call dbg.sqlcipher_log
mov rax, qword [rsp + 0x48]
mov rdx, r13
mov r9d, 0x106
lea r10, [rsp + 0x8c]
mov r8, qword [rsp + 0x58]
mov qword [rsp + 0x78], r10
mov rax, qword [rax]
mov qword [rsp + 0x20], r10
mov rcx, rax
call qword [rax + 0x28]
lea rdx, str.reopened_migration_database:__d
mov ecx, 8
mov r13d, eax
mov r8d, eax
mov dword [rsp + 0x58], eax
call dbg.sqlcipher_log
test r13d, r13d
jne 0x1401b6ee3
mov rax, qword [rsp + 0x48]
mov rdx, rsi
mov r9d, 0x106
xor r13d, r13d
mov r10, qword [rsp + 0x78]
mov r8, qword [rsp + 0x70]
mov rax, qword [rax]
mov qword [rsp + 0x20], r10
mov rcx, rax
call qword [rax + 0x28]
lea rdx, str.reopened_main_database:__d
mov ecx, 8
mov esi, eax
mov r8d, eax
mov dword [rsp + 0x58], eax
call dbg.sqlcipher_log
test esi, esi
jne 0x1401b6bf8
mov rax, qword [rsp + 0x68]
mov rax, qword [rax + 8]
mov rdx, qword [rax]
mov rax, qword [rdx + 0x70]
add dword [rdx + 0x84], 1
test rax, rax
je 0x1401b6b22
mov dword [rax + 0x18], 1
mov rax, qword [rax + 0x40]
test rax, rax
jne 0x1401b6b12
mov rcx, qword [rdx + 0x140]
xor edx, edx
xor r13d, r13d
call dbg.sqlite3PcacheTruncate
lea rdx, str.reset_pager
mov ecx, 8
call dbg.sqlcipher_log
mov rcx, qword [rsp + 0x48]
xor edx, edx
xor r9d, r9d
xor r8d, r8d
mov qword [rsp + 0x20], rdx
lea rdx, str.DETACH_DATABASE_migrate_
call dbg.sqlite3_exec
lea rdx, str.DETACH_DATABASE_called__d
mov ecx, 8
mov r8d, eax
mov dword [rsp + 0x58], eax
call dbg.sqlcipher_log
cmp dword [rsp + 0x58], 0
mov rsi, qword [rsp + 0x98]
jne 0x1401b6c0e
mov rcx, qword [rsp + 0x48]
call dbg.sqlite3ResetAllSchemasOfConnection
lea rdx, str.reset_all_schemas
mov ecx, 8
call dbg.sqlcipher_log
lea rcx, str.PRAGMA_journal_mode___s_
mov rdx, rsi
call dbg.sqlite3_mprintf
mov rcx, qword [rsp + 0x48]
xor r9d, r9d
xor r8d, r8d
mov r13, rax
xor eax, eax
mov rdx, r13
mov qword [rsp + 0x20], rax
call dbg.sqlite3_exec
mov r8, r13
mov ecx, 8
lea rdx, str._s:__d
mov esi, eax
mov r9d, eax
mov dword [rsp + 0x58], eax
call dbg.sqlcipher_log
test esi, esi
je 0x1401b6c0e
nop dword [rax]
mov r8d, dword [rsp + 0x58]
lea rdx, str.An_error_occurred_attempting_to_migrate_the_database___last_error__d
mov ecx, 1
call dbg.sqlcipher_log
mov rax, qword [rsp + 0x48]
mov rcx, qword [rax]
mov rax, qword [rcx + 0x30]
test rax, rax
je 0x1401b6c2b
mov rdx, qword [rsp + 0x50]
xor r8d, r8d
call rax
mov ebx, eax
lea rdx, str.deleted_migration_database:__d
mov r8d, ebx
mov ecx, 8
call dbg.sqlcipher_log
mov rbx, qword [rsp + 0x38]
mov r8, r15
mov ecx, 0x10
lea rdx, str.sqlcipher_free:_calling_sqlcipher_memset__p_0__llu_
mov r9, rbx
call dbg.sqlcipher_log
mov r8, rbx
xor edx, edx
mov rcx, r15
call dbg.sqlcipher_memset
mov rdx, rbx
mov rcx, r15
call sym.sqlcipher_munlock
mov rcx, r15
call sym.sqlite3_free
test r14, r14
je 0x1401b6cc7
mov rcx, r14
call sym.strlen
mov r8, r14
mov ecx, 0x10
lea rdx, str.sqlcipher_free:_calling_sqlcipher_memset__p_0__llu_
and eax, 0x3fffffff
mov rbx, rax
mov r9, rax
call dbg.sqlcipher_log
mov r8, rbx
xor edx, edx
mov rcx, r14
call dbg.sqlcipher_memset
mov rcx, r14
mov rdx, rbx
call sym.sqlcipher_munlock
mov rcx, r14
call sym.sqlite3_free
mov rsi, qword [rsp + 0x50]
mov rcx, rsi
call sym.strlen
mov r8, rsi
mov ecx, 0x10
lea rdx, str.sqlcipher_free:_calling_sqlcipher_memset__p_0__llu_
and eax, 0x3fffffff
mov rbx, rax
mov r9, rax
call dbg.sqlcipher_log
mov r8, rbx
xor edx, edx
mov rcx, rsi
call dbg.sqlcipher_memset
mov rdx, rbx
mov rcx, rsi
call sym.sqlcipher_munlock
mov rcx, rsi
call sym.sqlite3_free
mov r15, qword [rsp + 0x60]
mov rsi, qword [rsp + 0x98]
mov ebx, dword [rsp + 0x58]
test r15, r15
je 0x1401b6d70
mov rcx, r15
call sym.strlen
mov r8, r15
mov ecx, 0x10
lea rdx, str.sqlcipher_free:_calling_sqlcipher_memset__p_0__llu_
and eax, 0x3fffffff
mov r14, rax
mov r9, rax
call dbg.sqlcipher_log
mov r8, r14
xor edx, edx
mov rcx, r15
call dbg.sqlcipher_memset
mov rcx, r15
mov rdx, r14
call sym.sqlcipher_munlock
mov rcx, r15
call sym.sqlite3_free
test r13, r13
je 0x1401b64ae
mov rcx, r13
call sym.strlen
mov r8, r13
mov ecx, 0x10
lea rdx, str.sqlcipher_free:_calling_sqlcipher_memset__p_0__llu_
and eax, 0x3fffffff
mov r14, rax
mov r9, rax
call dbg.sqlcipher_log
mov r8, r14
xor edx, edx
mov rcx, r13
call dbg.sqlcipher_memset
mov rcx, r13
mov rdx, r14
call sym.sqlcipher_munlock
mov rcx, r13
call sym.sqlite3_free
jmp 0x1401b64ae
lea rdx, str.set_user_version_failed__error_code__d
mov edi, eax
mov r8d, eax
nop dword [rax]
mov ecx, 1
xor r12d, r12d
xor r13d, r13d
call dbg.sqlcipher_log
mov dword [rsp + 0x58], edi
xor edi, edi
mov dword [rsp + 0x30], 0
mov dword [rsp + 0x44], 0
jmp 0x1401b6bf8
mov r8d, dword [rsp + 0x58]
mov ecx, 1
xor edi, edi
xor r12d, r12d
lea rdx, str.set_compatibility_mode_failed__error_code__d
xor r13d, r13d
call dbg.sqlcipher_log
mov dword [rsp + 0x30], 0
mov dword [rsp + 0x44], 0
jmp 0x1401b6bf8
lea rdx, str.sqlcipher_export_failed__error_code__d
mov r8d, eax
mov ecx, 1
call dbg.sqlcipher_log
mov dword [rsp + 0x30], 0
xor edi, edi
xor r12d, r12d
xor r13d, r13d
jmp 0x1401b6bf8
mov ecx, 2
call dbg.sqlcipher_malloc
xor r8d, r8d
mov qword [rsp + 0x50], rax
jmp 0x1401b6681
lea rdx, str.cannot_migrate___SQL_statements_in_progress
mov ecx, 1
call dbg.sqlcipher_log
mov dword [rsp + 0x30], 0
xor edi, edi
xor r12d, r12d
xor r13d, r13d
mov dword [rsp + 0x58], 0
jmp 0x1401b6bf8
lea rdx, str.cannot_migrate_from_within_a_transaction
mov ecx, 1
call dbg.sqlcipher_log
jmp 0x1401b6e8c
mov r8d, 1
mov ecx, 1
xor r13d, r13d
lea rdx, str.error_occurred_while_renaming__d
call dbg.sqlcipher_log
mov dword [rsp + 0x58], 1
jmp 0x1401b6bf8
xor r13d, r13d
jmp 0x1401b6bf8