Function at 0x413037
Capabilities:
Reference sql statements

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0xb8
lea rsi, [rsp + 0x8c]
mov rdi, rcx
mov r13, rdx
mov dword [rsp + 0x8c], 0
mov edx, 0x2060
mov rcx, rsi
call sym.idxMalloc
cmp dword [rsp + 0x8c], 0
mov rbx, rax
jne 0x41377a
mov qword [rax + 8], rdi
lea rdx, [rax + 0x18]
mov dword [rax], 0x64
lea rcx, [0x004d4d0f]
call sym.sqlite3_open
test eax, eax
mov dword [rsp + 0x8c], eax
jne 0x41377a
lea rdx, [rbx + 0x10]
lea rcx, [0x004d4d0f]
call sym.sqlite3_open
test eax, eax
mov dword [rsp + 0x8c], eax
jne 0x41377a
mov rcx, qword [rbx + 0x10]
xor r9d, r9d
mov r8d, 1
mov edx, 0x3f0
call sym.sqlite3_db_config
cmp dword [rsp + 0x8c], 0
jne 0x41377a
mov rcx, qword [rbx + 8]
lea rdx, [rsp + 0xa8]
mov r8, r13
mov qword [rsp + 0xa8], 0
lea r9, str.SELECT_sql_FROM_sqlite_schema_WHERE_name_NOT_LIKE_sqlite____AND_sql_NOT_LIKE_CREATE_VIRTUAL___
call sym.idxPrintfPrepareStmt
mov dword [rsp + 0x8c], eax
cmp dword [rsp + 0x8c], 0
mov rcx, qword [rsp + 0xa8]
je 0x413199
mov rdx, qword [rsp + 0xa8]
mov rcx, rsi
call sym.idxFinalize
cmp dword [rsp + 0x8c], 0
jne 0x41377a
mov rcx, qword [rbx + 0x18]
mov r9, rbx
lea r8, [0x004cf280]
lea rdx, str.expert
call sym.sqlite3_create_module
mov rcx, qword [rbx + 8]
lea rdx, [rsp + 0x98]
mov r8, r13
lea r9, str.SELECT_type__name__sql__1_FROM_sqlite_schema_WHERE_type_IN__table_view__AND_name_NOT_LIKE_sqlite_____UNION_ALL_SELECT_type__name__sql__2_FROM_sqlite_schema_WHERE_type__trigger__AND_tbl_name_IN_SELECT_name_FROM_sqlite_schema_WHERE_type__view__ORDER_BY_4__1
mov dword [rsp + 0x90], eax
mov qword [rsp + 0x98], 0
call sym.idxPrepareStmt
jmp 0x4132d0
call sym.sqlite3_step
cmp eax, 0x64
jne 0x41312e
mov rcx, qword [rsp + 0xa8]
xor edx, edx
call sym.sqlite3_column_text
test rax, rax
je 0x41311c
mov rcx, qword [rbx + 0x10]
xor r9d, r9d
mov qword [rsp + 0x20], r13
xor r8d, r8d
mov rdx, rax
call sym.sqlite3_exec
jmp 0x413115
lea r8, [0x004d479b]
mov rcx, rsi
mov rdx, rax
call sym.idxAppendText
mov r9, qword [rsp + 0x50]
xor edx, edx
mov rcx, rsi
mov qword [rsp + 0x20], rax
lea r8, str.CREATE_VIRTUAL_TABLE__Q_USING_expert__Q_
mov rbp, rax
call sym.idxAppendText
cmp dword [rsp + 0x90], 0
mov rsi, rax
jne 0x413232
mov rcx, qword [rbx + 0x18]
xor r9d, r9d
mov qword [rsp + 0x20], r13
xor r8d, r8d
mov rdx, rax
call sym.sqlite3_exec
mov dword [rsp + 0x90], eax
mov rcx, rbp
call sym.sqlite3_free
mov rcx, rsi
call sym.sqlite3_free
mov esi, dword [rsp + 0x90]
mov rcx, qword [rsp + 0x98]
test esi, esi
jne 0x4132dc
call sym.sqlite3_step
cmp eax, 0x64
jne 0x4132dc
mov rcx, qword [rsp + 0x98]
xor edx, edx
call sym.sqlite3_column_text
mov rcx, qword [rsp + 0x98]
mov edx, 1
mov rbp, rax
call sym.sqlite3_column_text
mov rcx, qword [rsp + 0x98]
mov edx, 2
mov qword [rsp + 0x50], rax
call sym.sqlite3_column_text
test rbp, rbp
mov rdx, rax
je 0x413242
cmp qword [rsp + 0x50], 0
sete al
je 0x413242
cmp byte [rbp], 0x76
jne 0x41330c
test rdx, rdx
je 0x413242
mov rcx, qword [rbx + 0x18]
xor r9d, r9d
mov qword [rsp + 0x20], r13
xor r8d, r8d
call sym.sqlite3_exec
mov dword [rsp + 0x90], eax
jmp 0x413242
mov rdx, qword [rsp + 0x98]
lea rcx, [rsp + 0x90]
call sym.idxFinalize
mov eax, dword [rsp + 0x90]
test eax, eax
mov dword [rsp + 0x8c], eax
je 0x41375d
jmp 0x41377a
cmp byte [rbp + 1], 0x72
je 0x4132b7
mov rdi, qword [rbx + 8]
or r14, 0xffffffffffffffff
mov r8, r13
mov qword [rsp + 0xa0], 0
lea rdx, [rsp + 0xa0]
mov rcx, r14
lea r9, str.PRAGMA_table_xinfo_Q
lea r15, [rsp + 0xa8]
mov qword [rsp + 0x58], rdi
mov rdi, qword [rsp + 0x50]
repne scasb al, byte [rdi]
mov rax, rcx
mov rcx, qword [rsp + 0x58]
not rax
add rax, r14
mov qword [rsp + 0x68], rax
mov eax, dword [rsp + 0x68]
lea ebp, [rax + 0x21]
mov rax, qword [rsp + 0x50]
mov qword [rsp + 0x20], rax
call sym.idxPrintfPrepareStmt
mov dword [rsp + 0x74], 0
mov dword [rsp + 0x94], eax
cmp dword [rsp + 0x94], 0
mov rcx, qword [rsp + 0xa0]
jne 0x41348d
call sym.sqlite3_step
cmp eax, 0x64
jne 0x41348d
mov rcx, qword [rsp + 0xa0]
mov edx, 1
call sym.sqlite3_column_text
mov qword [rsp + 0xa8], 0
test rax, rax
mov r9, rax
jne 0x4133e1
mov dword [rsp + 0x94], 1
jmp 0x41348d
xor eax, eax
mov rdi, r9
mov rcx, r14
mov r8, qword [rsp + 0x50]
repne scasb al, byte [rdi]
lea rdx, [0x004d45f9]
mov qword [rsp + 0x28], r15
mov qword [rsp + 0x40], 0
mov qword [rsp + 0x38], 0
mov qword [rsp + 0x30], 0
mov qword [rsp + 0x20], 0
mov rax, rcx
mov rcx, qword [rsp + 0x58]
not eax
add ebp, eax
call sym.sqlite3_table_column_metadata
cmp qword [rsp + 0xa8], 0
mov dword [rsp + 0x94], eax
jne 0x413452
lea rax, str.binary
mov qword [rsp + 0xa8], rax
mov rdi, qword [rsp + 0xa8]
xor eax, eax
mov rcx, r14
inc esi
mov edx, 5
repne scasb al, byte [rdi]
mov rax, rcx
mov rcx, qword [rsp + 0xa0]
not eax
add ebp, eax
call sym.sqlite3_column_int
test eax, eax
setg al
movzx eax, al
add dword [rsp + 0x74], eax
jmp 0x413387
mov rcx, qword [rsp + 0xa0]
call sym.sqlite3_reset
cmp dword [rsp + 0x94], 0
jne 0x413657
test eax, eax
mov dword [rsp + 0x94], eax
jne 0x413657
imul edx, esi, 0x18
lea rcx, [rsp + 0x94]
add edx, ebp
call sym.idxMalloc
mov r14d, dword [rsp + 0x94]
mov r12, rax
test r14d, r14d
jne 0x41365a
mov dword [rax], esi
lea rbp, [rax + 0x20]
movsxd rsi, esi
imul rsi, rsi, 0x18
mov qword [rax + 0x10], rbp
lea rax, [rsp + 0xa8]
mov qword [rsp + 0x78], rax
add rbp, rsi
cmp dword [rsp + 0x94], 0
mov rcx, qword [rsp + 0xa0]
jne 0x41365c
call sym.sqlite3_step
cmp eax, 0x64
jne 0x41365c
mov rcx, qword [rsp + 0xa0]
mov edx, 1
call sym.sqlite3_column_text
mov qword [rsp + 0xa8], 0
test rax, rax
mov r9, rax
je 0x4134fe
mov rdi, r9
xor eax, eax
mov qword [rsp + 0x60], r9
or rcx, 0xffffffffffffffff
repne scasb al, byte [rdi]
movsxd r11, r14d
mov edx, 5
mov rdi, rbp
imul r15, r11, 0x18
mov rax, rcx
mov rcx, qword [rsp + 0xa0]
not rax
lea rsi, [rax - 1]
mov rax, qword [r12 + 0x10]
mov qword [rax + r15], rbp
call sym.sqlite3_column_int
mov rdx, qword [r12 + 0x10]
dec eax
mov r9, qword [rsp + 0x60]
sete cl
xor eax, eax
cmp dword [rsp + 0x74], 1
mov r8, qword [rsp + 0x50]
sete al
and eax, ecx
lea ecx, [rsi + 1]
mov dword [rdx + r15 + 0x10], eax
mov rsi, r9
mov rax, qword [rsp + 0x78]
lea rdx, [0x004d45f9]
movsxd rcx, ecx
rep movsb byte [rdi], byte [rsi]
mov rcx, qword [rsp + 0x58]
mov qword [rsp + 0x40], 0
mov qword [rsp + 0x38], 0
mov qword [rsp + 0x30], 0
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], 0
mov qword [rsp + 0x60], rdi
mov rbp, rdi
call sym.sqlite3_table_column_metadata
test eax, eax
mov dword [rsp + 0x94], eax
jne 0x41364f
cmp qword [rsp + 0xa8], 0
jne 0x413623
lea rax, str.binary
mov qword [rsp + 0xa8], rax
mov rsi, qword [rsp + 0xa8]
xor eax, eax
or rcx, 0xffffffffffffffff
mov rdi, rsi
repne scasb al, byte [rdi]
mov rax, qword [r12 + 0x10]
mov rdi, qword [rsp + 0x60]
mov qword [rax + r15 + 8], rdi
not ecx
movsxd rcx, ecx
rep movsb byte [rdi], byte [rsi]
mov rbp, rdi
inc r14d
jmp 0x4134fe
xor r12d, r12d
xor ebp, ebp
mov rdx, qword [rsp + 0xa0]
lea rcx, [rsp + 0x94]
call sym.idxFinalize
cmp dword [rsp + 0x94], 0
je 0x413688
mov rcx, r12
xor r12d, r12d
call sym.sqlite3_free
jmp 0x4136cb
test r12, r12
mov r8d, 0x2c26
je 0x4136b8
test rbp, rbp
mov qword [r12 + 8], rbp
je 0x4136b2
mov ecx, dword [rsp + 0x68]
mov rdi, rbp
mov rsi, qword [rsp + 0x50]
inc ecx
movsxd rcx, ecx
rep movsb byte [rdi], byte [rsi]
jmp 0x4136cb
mov r8d, 0x2c28
lea rdx, str.src_shell.c
lea rcx, [0x004d549f]
call sym._assert
mov eax, dword [rsp + 0x94]
test eax, eax
mov dword [rsp + 0x90], eax
jne 0x413242
mov rax, qword [rbx + 0x20]
lea r8, [0x004d6779]
xor edx, edx
xor r15d, r15d
lea rsi, [rsp + 0x90]
lea rbp, [0x004d4196]
mov rcx, rsi
lea r14, str._s_Q_COLLATE__s
mov qword [r12 + 0x18], rax
mov qword [rbx + 0x20], r12
call sym.idxAppendText
cmp r15d, dword [r12]
jge 0x4131d7
imul rcx, r15, 0x18
add rcx, qword [r12 + 0x10]
lea r9, [0x004d4af1]
test r15d, r15d
cmove r9, rbp
inc r15
mov r8, qword [rcx + 8]
mov rdx, qword [rcx]
mov rcx, rsi
mov qword [rsp + 0x28], r8
mov r8, r14
mov qword [rsp + 0x20], rdx
mov rdx, rax
call sym.idxAppendText
jmp 0x413718
mov rcx, qword [rbx + 0x18]
lea rdx, [sym.idxAuthCallback]
mov r8, rbx
call sym.sqlite3_set_authorizer
cmp dword [rsp + 0x8c], 0
je 0x413784
mov rcx, rbx
xor ebx, ebx
call sym.sqlite3_expert_destroy
mov rax, rbx
add rsp, 0xb8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret