Function at 0x414038
Capabilities:
Reference sql statements

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x88
cmp edx, 3
mov rbx, rcx
jne 0x41461d
test r8, r8
je 0x41461d
mov r13, qword [r8 + 8]
mov qword [rsp + 0xe0], r8
mov rdi, qword [r8]
test r13, r13
je 0x41461d
test rdi, rdi
je 0x41461d
mov esi, dword [rcx + 0x7c]
lea rdx, [0x004d57bc]
mov rcx, rdi
call sym.cli_strcmp
mov r8, qword [rsp + 0xe0]
mov r12d, esi
and esi, 0x200
and r12d, 0x100
or eax, esi
jne 0x4140c5
test r12d, r12d
jne 0x4141ae
mov rdx, qword [rbx + 0x40]
lea rcx, str.DELETE_FROM_sqlite_sequence__n
jmp 0x4140f0
lea rcx, str.sqlite_stat_
mov rdx, rdi
mov rbp, qword [r8 + 0x10]
call sym.sqlite3_strglob
or eax, esi
jne 0x4140fa
test r12d, r12d
jne 0x4141ae
mov rdx, qword [rbx + 0x40]
lea rcx, str.ANALYZE_sqlite_schema__n
call sym.fputs
jmp 0x4141ae
lea rdx, [0x004d692e]
mov r8d, 7
mov rcx, rdi
call sym.cli_strncmp
test eax, eax
je 0x41461d
test r12d, r12d
jne 0x4141ae
lea rdx, str.CREATE_VIRTUAL_TABLE
mov r8d, 0x14
mov rcx, rbp
call sym.cli_strncmp
test eax, eax
jne 0x414196
cmp dword [rbx + 0x64], 0
jne 0x414156
mov rdx, qword [rbx + 0x40]
lea rcx, str.PRAGMA_writable_schemaON__n
call sym.fputs
mov dword [rbx + 0x64], 1
mov r9, rbp
mov r8, rdi
mov rdx, rdi
lea rcx, str.INSERT_INTO_sqlite_schema_type_name_tbl_name_rootpage_sql_VALUES_table__q__q_0__q__
call sym.sqlite3_mprintf
mov rcx, rax
mov rsi, rax
call sym.shell_check_oom
mov rcx, qword [rbx + 0x40]
mov r8, rsi
lea rdx, [0x004d559f]
call sym.utf8_printf
mov rcx, rsi
call sym.sqlite3_free
jmp 0x41461d
test rbp, rbp
je 0x4141ae
mov rcx, qword [rbx + 0x40]
lea r8, [0x004d58ec]
mov rdx, rbp
call sym.printSchemaLine.part.66
lea rdx, [0x004d69c3]
mov rcx, r13
call sym.cli_strcmp
test eax, eax
jne 0x41461d
mov eax, dword [rbx + 0x7c]
lea rcx, str.PRAGMA_table_info_Q
mov rdx, rdi
lea rbp, [rsp + 0x70]
shr eax, 3
and eax, 1
mov byte [rsp + 0x5b], al
call sym.sqlite3_mprintf
mov rcx, rax
mov rsi, rax
call sym.shell_check_oom
mov rcx, qword [rbx]
or r8d, 0xffffffff
mov r9, rbp
mov qword [rsp + 0x20], 0
mov rdx, rsi
call sym.sqlite3_prepare_v2
mov rcx, rsi
mov r12d, eax
call sym.sqlite3_free
test r12d, r12d
jne 0x4144d0
xor r15d, r15d
mov dword [rsp + 0x5c], 0
xor r13d, r13d
xor esi, esi
xor r12d, r12d
mov rcx, qword [rsp + 0x70]
mov r14d, r12d
call sym.sqlite3_step
cmp eax, 0x64
jne 0x4142f7
lea eax, [r13 - 2]
cmp eax, r12d
jg 0x414272
lea r13d, [r14 + r13*2 + 0xa]
mov rcx, rsi
lea edx, [r13*8]
call sym.sqlite3_realloc
mov rcx, rax
mov rsi, rax
call sym.shell_check_oom
mov rcx, qword [rsp + 0x70]
mov edx, 1
inc r12
lea r14, [rsi + r12*8]
call sym.sqlite3_column_text
lea rcx, [0x004d40ca]
mov rdx, rax
call sym.sqlite3_mprintf
mov rcx, rax
mov qword [r14], rax
call sym.shell_check_oom
mov rcx, qword [rsp + 0x70]
mov edx, 5
call sym.sqlite3_column_int
test eax, eax
je 0x414233
inc dword [rsp + 0x5c]
xor r15d, r15d
cmp dword [rsp + 0x5c], 1
jne 0x414233
mov rcx, qword [rsp + 0x70]
mov edx, 2
xor r15d, r15d
call sym.sqlite3_column_text
lea rdx, [0x004d69de]
mov rcx, rax
call sym.sqlite3_stricmp
test eax, eax
sete r15b
jmp 0x414233
mov rcx, qword [rsp + 0x70]
call sym.sqlite3_finalize
test rsi, rsi
je 0x4144d0
movsxd rax, r12d
test r15d, r15d
mov qword [rsi], 0
mov qword [rsi + rax*8 + 8], 0
je 0x414329
cmp byte [rsp + 0x5b], 0
jne 0x414330
movzx eax, byte [rsp + 0x5b]
jmp 0x4143a2
lea rcx, str.SELECT_1_FROM_pragma_index_list__Q__WHERE_originpk
mov rdx, rdi
call sym.sqlite3_mprintf
mov rcx, rax
mov r12, rax
call sym.shell_check_oom
mov rcx, qword [rbx]
or r8d, 0xffffffff
mov r9, rbp
mov qword [rsp + 0x20], 0
mov rdx, r12
call sym.sqlite3_prepare_v2
mov rcx, r12
mov r13d, eax
call sym.sqlite3_free
test r13d, r13d
je 0x414382
mov rcx, rsi
call sym.freeColumnList
jmp 0x4144d0
mov rcx, qword [rsp + 0x70]
call sym.sqlite3_step
mov rcx, qword [rsp + 0x70]
mov r12d, eax
call sym.sqlite3_finalize
xor eax, eax
cmp r12d, 0x64
sete al
test eax, eax
je 0x41451c
lea r12, [0x004db8a0]
mov r13d, 1
cmp r14d, r13d
mov r15, qword [r12]
jl 0x4144d8
mov rdx, qword [rsi + r13*8]
mov rcx, r15
inc r13
call sym.sqlite3_stricmp
test eax, eax
jne 0x4143b7
jmp 0x414604
call sym.quoteChar
mov rdx, qword [r13]
mov rcx, r12
movsx r8d, al
call sym.appendText
cmp qword [r13 + 8], 0
je 0x414406
xor r8d, r8d
mov rdx, r14
mov rcx, r12
call sym.appendText
add r13, 8
mov rcx, qword [r13]
test rcx, rcx
jne 0x4143dc
mov rcx, rsi
call sym.freeColumnList
xor r8d, r8d
mov rcx, r12
lea rdx, str._FROM
call sym.appendText
mov rcx, rdi
call sym.quoteChar
mov rdx, rdi
mov rcx, r12
movsx r8d, al
call sym.appendText
mov rax, qword [rsp + 0x70]
xor r8d, r8d
mov rcx, rbx
mov rdx, qword [rsp + 0x60]
mov dword [rbx + 0x5c], 5
mov r13, qword [rbx + 0x90]
mov edi, dword [rbx + 0x54]
mov dword [rbx + 0x54], 5
mov qword [rbx + 0x90], rax
call sym.shell_exec
cmp al, 0xb
mov esi, eax
jne 0x4144ae
mov rdx, qword [rbx + 0x40]
lea rcx, str.__CORRUPTION_ERROR___n
call sym.fputs
mov rcx, qword [rbx]
call sym.toggleSelectOrder
mov rdx, qword [rsp + 0x60]
mov rcx, rbx
xor r8d, r8d
call sym.shell_exec
mov rcx, qword [rbx]
call sym.toggleSelectOrder
mov rcx, rbp
mov qword [rbx + 0x90], r13
mov dword [rbx + 0x54], edi
call sym.freeText
mov rcx, r12
call sym.freeText
test esi, esi
je 0x41461d
inc dword [rbx + 0x50]
jmp 0x41461d
mov rcx, qword [rbx]
xor edx, edx
mov r9, r15
mov r8, rdi
mov qword [rsp + 0x40], 0
mov qword [rsp + 0x38], 0
mov qword [rsp + 0x30], 0
mov qword [rsp + 0x28], 0
mov qword [rsp + 0x20], 0
call sym.sqlite3_table_column_metadata
test eax, eax
jne 0x41451c
mov qword [rsi], r15
lea r13, [rsi + 8]
mov rcx, rbp
call sym.initText
mov rcx, rdi
call sym.quoteChar
mov rdx, rdi
mov rcx, rbp
movsx r8d, al
call sym.appendText
cmp qword [rsi], 0
je 0x4145b4
xor r8d, r8d
mov rcx, rbp
mov r12, r13
lea rdx, [0x004d4777]
call sym.appendText
mov rdx, qword [rsi]
xor r8d, r8d
mov rcx, rbp
lea r14, [0x004d4739]
call sym.appendText
xor r8d, r8d
cmp qword [r12], 0
je 0x4145a5
mov rdx, r14
mov rcx, rbp
add r12, 8
call sym.appendText
mov rcx, qword [r12 - 8]
call sym.quoteChar
mov rdx, qword [r12 - 8]
mov rcx, rbp
movsx r8d, al
call sym.appendText
jmp 0x41456f
lea rdx, [0x004d479b]
mov rcx, rbp
call sym.appendText
lea r12, [rsp + 0x60]
mov rcx, r12
call sym.initText
xor r8d, r8d
mov rcx, r12
lea rdx, [0x004d6a1c]
call sym.appendText
mov rdx, qword [rsi]
test rdx, rdx
je 0x4145f8
xor r8d, r8d
mov rcx, r12
call sym.appendText
xor r8d, r8d
mov rcx, r12
lea rdx, [0x004d4739]
call sym.appendText
lea r14, [0x004d4739]
jmp 0x41440a
lea rax, [0x004db8b8]
add r12, 8
cmp rax, r12
jne 0x4143b1
jmp 0x41451c
xor eax, eax
add rsp, 0x88
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret