Function at 0x1402ad640
Capabilities:
Move file

Disassembly:
mov qword [rsp + 8], rcx
push rsi
push rdi
push r12
sub rsp, 0xc0
mov rax, qword [rcx + 0x60]
lea rdx, str.main
mov rsi, rcx
mov r12, qword [rax]
mov rcx, r12
call fcn.1402ca910
test eax, eax
js 0x1402ae02e
movsxd rdx, eax
mov rax, qword [r12 + 0x20]
shl rdx, 5
mov rax, qword [rdx + rax + 8]
test rax, rax
je 0x1402ae02e
mov rax, qword [rax + 8]
mov qword [rsp + 0xb8], rbx
mov qword [rsp + 0xb0], rbp
mov qword [rsp + 0xa8], r13
mov qword [rsp + 0x98], r15
mov r15, qword [rax]
cmp byte [r15 + 0x13], 0
je 0x1402ad6c2
lea r15, [0x14052772c]
jmp 0x1402ad6c9
mov r15, qword [r15 + 0xd8]
xor edi, edi
mov qword [rsp + 0x68], rdi
mov r13d, edi
mov qword [rsp + 0x80], rdi
mov ebp, edi
mov qword [rsp + 0x70], rdi
mov qword [rsp + 0x50], rdi
mov qword [rsp + 0x48], rdi
mov qword [rsp + 0x38], rdi
mov qword [rsp + 0x58], rdi
mov dword [rsp + 0xe8], edi
mov dword [rsp + 0xf0], edi
mov dword [rsp + 0xf8], edi
mov dword [rsp + 0x40], edi
test r15, r15
je 0x1402ae02a
mov qword [rsp + 0xa0], r14
mov r14, 0xffffffffffffffff
mov rax, r14
nop word [rax + rax]
inc rax
cmp byte [r15 + rax], dil
jne 0x1402ad730
and eax, 0x3fffffff
cmp eax, 1
jb 0x1402ae026
mov rax, qword [rsi + 0x68]
mov eax, dword [rax + 4]
mov dword [rsp + 0x30], eax
inc eax
movsxd rbx, eax
mov rcx, rbx
call fcn.1402b10d0
mov r8, rbx
mov qword [rsp + 0x60], rax
xor edx, edx
mov rcx, rax
mov rsi, rax
call fcn.14035c350
movsxd rbx, dword [rsp + 0x30]
mov rcx, rsi
mov rdx, qword [rsp + 0xe0]
mov r8, rbx
mov qword [rsp + 0x88], rbx
mov rdx, qword [rdx + 0x68]
mov rdx, qword [rdx + 0x18]
call fcn.14035bc80
lea rax, [rsp + 0x50]
mov r8d, ebx
mov qword [rsp + 0x28], rax
lea r9, [0x1405e4ea8]
lea rax, [rsp + 0xf8]
mov rdx, rsi
mov rcx, r15
mov qword [rsp + 0x20], rax
call fcn.1402aa630
mov esi, eax
test eax, eax
jne 0x1402ad7e2
lea rdx, str.No_upgrade_required___exiting
lea ecx, [rax + 8]
call fcn.1402b0f80
jmp 0x1402adeba
mov r13, qword [rsp + 0x60]
mov ebx, 3
nop dword [rax]
mov edx, ebx
lea rcx, str.PRAGMA_cipher_compatibility___d_
call fcn.140234d20
mov r8d, dword [rsp + 0x30]
mov rbp, rax
lea rax, [rsp + 0x50]
mov r9, rbp
mov qword [rsp + 0x28], rax
mov rdx, r13
lea rax, [rsp + 0xf8]
mov rcx, r15
mov qword [rsp + 0x20], rax
call fcn.1402aa630
mov esi, eax
test eax, eax
je 0x1402ad8a3
test rbp, rbp
je 0x1402ad857
mov rdx, r14
nop dword [rax]
inc rdx
cmp byte [rdx + rbp], dil
jne 0x1402ad840
and edx, 0x3fffffff
mov rcx, rbp
call fcn.1402b0e80
dec ebx
test ebx, ebx
jg 0x1402ad7f0
lea rdx, str.Upgrade_format_not_determined
mov ecx, 1
call fcn.1402b0f80
mov rbp, rdi
mov qword [rsp + 0x48], rdi
mov qword [rsp + 0x38], rdi
mov r13, rdi
mov qword [rsp + 0x58], rdi
mov dword [rsp + 0xe8], edi
mov dword [rsp + 0xf0], edi
mov qword [rsp + 0x68], rdi
mov qword [rsp + 0x80], rdi
jmp 0x1402ade76
mov r8d, ebx
lea rdx, str.Version__d_format_found
mov ecx, 8
call fcn.1402b0f80
mov rdx, r15
lea rcx, str._s_migrated
call fcn.140234d20
mov rsi, rax
test rax, rax
jne 0x1402ad8de
lea ecx, [rax + 2]
mov rbx, rdi
call fcn.1402b10d0
mov r13, rax
jmp 0x1402ad90f
mov rcx, r14
inc rcx
cmp byte [rax + rcx], dil
jne 0x1402ad8e1
and ecx, 0x3fffffff
add rcx, 2
call fcn.1402b10d0
mov r13, rax
mov rbx, r14
nop
inc rbx
cmp byte [rsi + rbx], dil
jne 0x1402ad900
and ebx, 0x3fffffff
mov r8, rbx
mov dword [rsp + 0xf0], edi
mov rdx, rsi
mov dword [rsp + 0xe8], edi
mov rcx, r13
mov qword [rsp + 0x58], rdi
mov qword [rsp + 0x38], rdi
mov qword [rsp + 0x48], rdi
call fcn.14035bc80
test rsi, rsi
jne 0x1402ad944
mov rdx, rdi
jmp 0x1402ad956
mov rdx, r14
inc rdx
cmp byte [rsi + rdx], dil
jne 0x1402ad947
and edx, 0x3fffffff
mov rcx, rsi
call fcn.1402b0e80
mov r8, qword [rsp + 0x60]
lea rcx, str.ATTACH_DATABASE__s_as_migrate_
mov rdx, r13
call fcn.140234d20
mov edx, dword [rsp + 0xf8]
lea rcx, str.PRAGMA_migrate.user_version___d_
mov rbx, rax
mov qword [rsp + 0x80], rax
call fcn.140234d20
xor r9d, r9d
mov qword [rsp + 0x68], rax
xor r8d, r8d
mov qword [rsp + 0x20], rdi
mov rdx, rbp
mov rcx, r12
call fcn.140232ea0
mov esi, eax
test eax, eax
je 0x1402ad9ca
mov r8d, eax
lea rdx, str.set_compatibility_mode_failed__error_code__d
mov ecx, 1
call fcn.1402b0f80
jmp 0x1402ade76
xor r9d, r9d
mov qword [rsp + 0x20], rdi
xor r8d, r8d
lea rdx, str.PRAGMA_journal_mode__delete_
mov rcx, r12
call fcn.140232ea0
mov esi, eax
test eax, eax
je 0x1402ada03
mov r8d, eax
lea rdx, str.force_journal_mode_DELETE_failed__error_code__d
mov ecx, 1
call fcn.1402b0f80
jmp 0x1402ade76
xor r9d, r9d
mov qword [rsp + 0x20], rdi
xor r8d, r8d
mov rdx, rbx
mov rcx, r12
call fcn.140232ea0
mov esi, eax
test eax, eax
je 0x1402ada38
mov r8d, eax
lea rdx, str.attach_failed__error_code__d
mov ecx, 1
call fcn.1402b0f80
jmp 0x1402ade76
mov r9d, dword [rsp + 0x30]
lea rdx, str.migrate
mov r8, qword [rsp + 0x60]
mov rcx, r12
call fcn.140315720
mov esi, eax
test eax, eax
je 0x1402ada70
mov r8d, eax
lea rdx, str.keying_attached_database_failed__error_code__d
mov ecx, 1
call fcn.1402b0f80
jmp 0x1402ade76
xor r9d, r9d
mov qword [rsp + 0x20], rdi
xor r8d, r8d
lea rdx, str.SELECT_sqlcipher_export_migrate__
mov rcx, r12
call fcn.140232ea0
mov esi, eax
test eax, eax
je 0x1402adaa9
mov r8d, eax
lea rdx, str.sqlcipher_export_failed__error_code__d
mov ecx, 1
call fcn.1402b0f80
jmp 0x1402ade76
mov rdx, qword [rsp + 0x68]
xor r9d, r9d
xor r8d, r8d
mov qword [rsp + 0x20], rdi
mov rcx, r12
call fcn.140232ea0
mov esi, eax
test eax, eax
je 0x1402adae0
mov r8d, eax
lea rdx, str.set_user_version_failed__error_code__d
mov ecx, 1
call fcn.1402b0f80
jmp 0x1402ade76
cmp byte [r12 + 0x65], dil
jne 0x1402adafd
lea rdx, str.cannot_migrate_from_within_a_transaction
mov ecx, 1
call fcn.1402b0f80
jmp 0x1402ade76
cmp dword [r12 + 0xd8], 1
jle 0x1402adb1e
lea rdx, str.cannot_migrate___SQL_statements_in_progress
mov ecx, 1
call fcn.1402b0f80
jmp 0x1402ade76
mov rcx, qword [r12 + 0x20]
movsxd rax, dword [r12 + 0x28]
shl rax, 5
mov rsi, qword [rcx + 8]
mov qword [rsp + 0xe0], rsi
mov rax, qword [rax + rcx - 0x18]
mov rcx, rax
mov qword [rsp + 0xf8], rax
call fcn.1402b8b30
mov rcx, qword [rsi + 8]
mov ebx, eax
mov edx, dword [0x14066f1f8]
mov eax, 0xfffd
xor r9d, r9d
mov r8d, ebx
and word [rcx + 0x28], ax
mov rcx, rsi
call fcn.1402babd0
mov r8d, dword [0x14066f1f8]
lea rdx, str.set_btree_page_size_to__d_res__d_rc__d
mov r9d, ebx
mov dword [rsp + 0x20], eax
mov ecx, 8
mov esi, eax
call fcn.1402b0f80
test esi, esi
jne 0x1402ade76
mov edx, dword [r12 + 0x28]
lea r9, [rsp + 0x40]
dec edx
lea r8, [rsp + 0x70]
mov rcx, r12
call fcn.1402aa140
mov r9d, dword [rsp + 0x40]
xor edx, edx
mov r8, qword [rsp + 0x70]
mov rcx, r12
call fcn.1402a9e00
mov rcx, qword [rsp + 0xf8]
mov rax, qword [rcx + 8]
mov rcx, qword [rax]
mov rax, qword [rsp + 0xe0]
mov rdx, qword [rcx + 0x48]
mov rax, qword [rax + 8]
mov qword [rsp + 0xf8], rdx
mov rcx, qword [rax]
mov rbx, qword [rcx + 0x48]
mov rcx, rdx
mov qword [rsp + 0x70], rbx
call fcn.1402dfb80
mov rcx, rbx
call fcn.1402dfb80
lea rdx, str.performing_windows_MoveFileExA
lea ecx, [rsi + 8]
call fcn.1402b0f80
mov r9d, r14d
mov dword [rsp + 0x28], edi
mov r8, r15
mov qword [rsp + 0x20], rdi
xor edx, edx
mov ecx, 0xfde9
call qword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
movsxd rbx, eax
mov rcx, rbx
add rcx, rcx
call fcn.1402b10d0
mov r9d, r14d
mov dword [rsp + 0x28], ebx
mov r8, r15
mov qword [rsp + 0x38], rax
xor edx, edx
mov qword [rsp + 0x20], rax
mov ecx, 0xfde9
call qword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov r9d, r14d
mov dword [rsp + 0x28], edi
mov r8, r13
mov dword [rsp + 0xe8], eax
xor edx, edx
mov qword [rsp + 0x20], rdi
mov ecx, 0xfde9
call qword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
movsxd rbx, eax
mov rcx, rbx
add rcx, rcx
call fcn.1402b10d0
mov r9d, r14d
mov dword [rsp + 0x28], ebx
mov r8, r13
mov qword [rsp + 0x58], rax
xor edx, edx
mov qword [rsp + 0x20], rax
mov ecx, 0xfde9
mov rsi, rax
call qword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov rdx, qword [rsp + 0x38]
mov r8d, 1
mov rcx, rsi
mov dword [rsp + 0xf0], eax
call qword [sym.imp.KERNEL32.dll_MoveFileExW]
test eax, eax
jne 0x1402adcf2
mov esi, 1
lea rdx, str.error_occurred_while_renaming__d
mov r8d, esi
mov ecx, esi
call fcn.1402b0f80
jmp 0x1402ade76
mov r9, r15
mov dword [rsp + 0x20], edi
mov r8, r13
lea rdx, str.renamed_migration_database__s_to_main_database__s:__d
mov ecx, 8
call fcn.1402b0f80
mov rax, qword [r12]
lea rcx, [rsp + 0x78]
mov r8, qword [rsp + 0xf8]
mov r9d, 0x106
mov qword [rsp + 0x20], rcx
mov rdx, r13
mov rcx, rax
call qword [rax + 0x28]
lea rdx, str.reopened_migration_database:__d
mov ecx, 8
mov r8d, eax
mov esi, eax
call fcn.1402b0f80
test esi, esi
jne 0x1402ade76
mov rax, qword [r12]
lea rcx, [rsp + 0x78]
mov r8, qword [rsp + 0x70]
mov r9d, 0x106
mov qword [rsp + 0x20], rcx
mov rdx, r15
mov rcx, rax
call qword [rax + 0x28]
lea rdx, str.reopened_main_database:__d
mov ecx, 8
mov r8d, eax
mov esi, eax
call fcn.1402b0f80
test esi, esi
jne 0x1402ade76
mov rax, qword [rsp + 0xe0]
mov rax, qword [rax + 8]
mov rcx, qword [rax]
inc dword [rcx + 0x84]
mov rax, qword [rcx + 0x70]
test rax, rax
je 0x1402addc0
nop
mov dword [rax + 0x18], 1
mov rax, qword [rax + 0x40]
test rax, rax
jne 0x1402addb0
mov rcx, qword [rcx + 0x140]
xor edx, edx
call fcn.1402e2e30
lea rdx, str.reset_pager
mov ecx, 8
call fcn.1402b0f80
xor r9d, r9d
mov qword [rsp + 0x20], rdi
xor r8d, r8d
lea rdx, str.DETACH_DATABASE_migrate_
mov rcx, r12
call fcn.140232ea0
mov r8d, eax
lea rdx, str.DETACH_DATABASE_called__d
mov ecx, 8
mov esi, eax
call fcn.1402b0f80
test esi, esi
jne 0x1402ade8a
mov rcx, r12
call fcn.1402ea8c0
lea rdx, str.reset_all_schemas
lea ecx, [rsi + 8]
call fcn.1402b0f80
mov rdx, qword [rsp + 0x50]
lea rcx, str.PRAGMA_journal_mode___s_
call fcn.140234d20
xor r9d, r9d
mov qword [rsp + 0x48], rax
xor r8d, r8d
mov qword [rsp + 0x20], rdi
mov rdx, rax
mov rcx, r12
mov rbx, rax
call fcn.140232ea0
mov r9d, eax
lea rdx, str._s:__d
mov r8, rbx
mov ecx, 8
mov esi, eax
call fcn.1402b0f80
test esi, esi
je 0x1402ade8a
mov r8d, esi
lea rdx, str.An_error_occurred_attempting_to_migrate_the_database___last_error__d
mov ecx, 1
call fcn.1402b0f80
test r13, r13
je 0x1402adeba
mov rcx, qword [r12]
mov rax, qword [rcx + 0x30]
test rax, rax
je 0x1402adea6
xor r8d, r8d
mov rdx, r13
call rax
mov edi, eax
mov r8d, edi
lea rdx, str.deleted_migration_database:__d
mov ecx, 8
call fcn.1402b0f80
mov rax, qword [rsp + 0x60]
test rax, rax
je 0x1402aded4
mov rdx, qword [rsp + 0x88]
mov rcx, rax
call fcn.1402b0e80
mov rax, qword [rsp + 0x80]
test rax, rax
je 0x1402adefb
mov rdx, r14
inc rdx
cmp byte [rax + rdx], 0
jne 0x1402adee4
and edx, 0x3fffffff
mov rcx, rax
call fcn.1402b0e80
test r13, r13
je 0x1402adf1b
mov rdx, r14
inc rdx
cmp byte [rdx + r13], 0
jne 0x1402adf03
and edx, 0x3fffffff
mov rcx, r13
call fcn.1402b0e80
mov rax, qword [rsp + 0x68]
test rax, rax
je 0x1402adf47
mov rdx, r14
nop dword [rax + rax]
inc rdx
cmp byte [rax + rdx], 0
jne 0x1402adf30
and edx, 0x3fffffff
mov rcx, rax
call fcn.1402b0e80
mov rax, qword [rsp + 0x48]
test rax, rax
je 0x1402adf6b
mov rdx, r14
inc rdx
cmp byte [rax + rdx], 0
jne 0x1402adf54
and edx, 0x3fffffff
mov rcx, rax
call fcn.1402b0e80
mov rax, qword [rsp + 0x50]
test rax, rax
je 0x1402adf99
mov rdx, r14
nop dword [rax + rax]
inc rdx
cmp byte [rax + rdx], 0
jne 0x1402adf80
mov rcx, qword [rsp + 0x50]
and edx, 0x3fffffff
call fcn.1402b0e80
test rbp, rbp
je 0x1402adfbc
nop
inc r14
cmp byte [r14 + rbp], 0
jne 0x1402adfa0
and r14d, 0x3fffffff
mov rcx, rbp
mov edx, r14d
call fcn.1402b0e80
mov rax, qword [rsp + 0x38]
test rax, rax
je 0x1402adfd6
movsxd rdx, dword [rsp + 0xe8]
mov rcx, rax
call fcn.1402b0e80
mov rax, qword [rsp + 0x58]
test rax, rax
je 0x1402adff0
movsxd rdx, dword [rsp + 0xf0]
mov rcx, rax
call fcn.1402b0e80
mov eax, esi
mov r14, qword [rsp + 0xa0]
mov r13, qword [rsp + 0xa8]
mov rbp, qword [rsp + 0xb0]
mov rbx, qword [rsp + 0xb8]
mov r15, qword [rsp + 0x98]
add rsp, 0xc0
pop r12
pop rdi
pop rsi
ret
mov eax, edi
jmp 0x1402adff2
mov eax, edi
jmp 0x1402adffa
xor edi, edi
mov eax, edi
add rsp, 0xc0
pop r12
pop rdi
pop rsi
ret