Function at 0x140022260
Capabilities:
Reference sql statements

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x88
mov r12, rcx
cmp edx, 3
jne 0x1400226da
test r8, r8
je 0x1400226da
mov rsi, qword [r8 + 8]
mov r14, qword [r8]
mov rdi, qword [r8 + 0x10]
test rsi, rsi
je 0x1400226da
test r14, r14
je 0x1400226da
mov eax, dword [rcx + 0x7c]
lea rdx, [0x140152298]
mov rcx, r14
mov ebp, eax
and eax, 0x200
and ebp, 0x100
mov ebx, eax
call sym.strcmp
test eax, eax
jne 0x140022790
test ebx, ebx
jne 0x1400226f0
test ebp, ebp
je 0x140022880
lea rdx, [0x1401557b4]
mov rcx, rsi
call sym.strcmp
test eax, eax
jne 0x1400226da
mov eax, dword [r12 + 0x7c]
mov rdx, r14
lea rcx, str.PRAGMA_table_info_Q
mov dword [rsp + 0x5c], eax
call sym.sqlite3_mprintf
mov rbx, rax
test rax, rax
je 0x14002292e
mov rcx, qword [r12]
lea rax, [rsp + 0x70]
mov r8d, 0xffffffff
mov rdx, rbx
mov qword [rsp + 0x20], 0
mov r9, rax
mov qword [rsp + 0x50], rax
call sym.sqlite3_prepare_v2
mov rcx, rbx
mov esi, eax
call sym.sqlite3_free
test esi, esi
jne 0x1400226d4
mov dword [rsp + 0x58], 0
xor r13d, r13d
xor edi, edi
xor ebx, ebx
xor esi, esi
lea r15, [0x1401509b2]
nop dword [rax + rax]
mov rcx, qword [rsp + 0x70]
mov ebp, ebx
call sym.sqlite3_step
cmp eax, 0x64
jne 0x140022438
lea eax, [rdi - 2]
cmp eax, ebx
jg 0x1400223ab
lea edi, [rbp + rdi*2 + 0xa]
mov rcx, rsi
lea edx, [rdi*8]
call sym.sqlite3_realloc
mov rsi, rax
test rax, rax
je 0x14002292e
mov rcx, qword [rsp + 0x70]
mov edx, 1
add rbx, 1
lea rbp, [rsi + rbx*8]
call sym.sqlite3_column_text
mov rcx, r15
mov rdx, rax
call sym.sqlite3_mprintf
mov qword [rbp], rax
test rax, rax
je 0x14002292e
mov rcx, qword [rsp + 0x70]
mov edx, 5
call sym.sqlite3_column_int
test eax, eax
je 0x140022370
add r13d, 1
mov dword [rsp + 0x58], 0
cmp r13d, 1
jne 0x140022370
mov rcx, qword [rsp + 0x70]
mov edx, 2
call sym.sqlite3_column_text
lea rdx, [0x1401557cf]
mov rcx, rax
call sym.sqlite3_stricmp
test eax, eax
sete al
movzx eax, al
mov dword [rsp + 0x58], eax
jmp 0x140022370
mov rcx, qword [rsp + 0x70]
call sym.sqlite3_finalize
test rsi, rsi
je 0x1400226d4
movsxd rax, ebx
mov qword [rsi], 0
mov qword [rsi + rax*8 + 8], 0
mov eax, dword [rsp + 0x5c]
and eax, 8
je 0x1400224e0
mov edx, dword [rsp + 0x58]
test edx, edx
je 0x1400227c0
mov rdx, r14
lea rcx, str.SELECT_1_FROM_pragma_index_list__Q__WHERE_originpk
call sym.sqlite3_mprintf
mov rbx, rax
test rax, rax
je 0x14002292e
mov rcx, qword [r12]
mov r9, qword [rsp + 0x50]
mov r8d, 0xffffffff
mov rdx, rax
mov qword [rsp + 0x20], 0
call sym.sqlite3_prepare_v2
mov rcx, rbx
mov edi, eax
call sym.sqlite3_free
test edi, edi
jne 0x1400228f9
mov rcx, qword [rsp + 0x70]
call sym.sqlite3_step
mov rcx, qword [rsp + 0x70]
mov ebx, eax
call sym.sqlite3_finalize
cmp ebx, 0x64
je 0x1400227c8
nop
pxor xmm0, xmm0
mov rcx, r14
lea rbx, [rsi + 8]
movups xmmword [rsp + 0x70], xmm0
call sym.quoteChar
mov rdi, qword [rsp + 0x50]
mov rdx, r14
movsx r8d, al
mov rcx, rdi
call sym.appendText
cmp qword [rsi], 0
je 0x14002258a
xor r8d, r8d
mov rcx, rdi
lea rdx, [0x14015254c]
call sym.appendText
mov rdx, qword [rsi]
xor r8d, r8d
mov rcx, rdi
lea rbp, [0x140150eed]
mov rdi, rbx
call sym.appendText
cmp qword [rsi + 8], 0
je 0x140022576
mov r15, qword [rsp + 0x50]
xor r8d, r8d
mov rdx, rbp
add rdi, 8
mov rcx, r15
call sym.appendText
mov rcx, qword [rdi - 8]
call sym.quoteChar
mov rdx, qword [rdi - 8]
mov rcx, r15
movsx r8d, al
call sym.appendText
cmp qword [rdi], 0
jne 0x140022540
mov rcx, qword [rsp + 0x50]
xor r8d, r8d
lea rdx, [0x140152555]
call sym.appendText
lea rdi, [rsp + 0x60]
pxor xmm0, xmm0
lea rdx, [0x14015580e]
xor r8d, r8d
mov rcx, rdi
movups xmmword [rsp + 0x60], xmm0
call sym.appendText
mov rdx, qword [rsi]
test rdx, rdx
je 0x1400225cf
xor r8d, r8d
mov rcx, rdi
call sym.appendText
xor r8d, r8d
lea rdx, [0x140150eed]
mov rcx, rdi
call sym.appendText
mov rcx, qword [rsi + 8]
lea rbp, [0x140150eed]
test rcx, rcx
je 0x140022639
nop
call sym.quoteChar
mov rdx, qword [rbx]
mov rcx, rdi
movsx r8d, al
call sym.appendText
cmp qword [rbx + 8], 0
je 0x140022609
xor r8d, r8d
mov rdx, rbp
mov rcx, rdi
call sym.appendText
mov rcx, qword [rbx + 8]
add rbx, 8
test rcx, rcx
jne 0x1400225e0
mov rcx, qword [rsi + 8]
test rcx, rcx
je 0x140022639
lea rbx, [rsi + 0x10]
nop dword [rax + rax]
call sym.sqlite3_free
mov rcx, qword [rbx]
add rbx, 8
test rcx, rcx
jne 0x140022628
mov rcx, rsi
call sym.sqlite3_free
xor r8d, r8d
lea rdx, str._FROM
mov rcx, rdi
call sym.appendText
mov rcx, r14
call sym.quoteChar
mov rcx, rdi
mov rdx, r14
movsx r8d, al
call sym.appendText
mov rdi, qword [rsp + 0x70]
xor r8d, r8d
mov rcx, r12
mov r13, qword [r12 + 0x90]
mov ebp, dword [r12 + 0x54]
mov dword [r12 + 0x5c], 5
mov rsi, qword [rsp + 0x60]
mov qword [r12 + 0x90], rdi
mov dword [r12 + 0x54], 5
mov rdx, rsi
call sym.shell_exec
mov ebx, eax
cmp al, 0xb
je 0x140022891
mov qword [r12 + 0x90], r13
mov rcx, rdi
mov dword [r12 + 0x54], ebp
call sym.free
mov rcx, rsi
call sym.free
test ebx, ebx
je 0x1400226da
add dword [r12 + 0x50], 1
xor eax, eax
add rsp, 0x88
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov rdx, r14
lea rcx, str.sqlite_stat_
call sym.sqlite3_strglob
mov r8d, 7
lea rdx, [0x14015572e]
mov rcx, r14
call sym.strncmp
test eax, eax
je 0x1400226da
test ebp, ebp
jne 0x1400222de
test rdi, rdi
je 0x1400222de
mov r8d, 0x14
lea rdx, str.CREATE_VIRTUAL_TABLE
mov rcx, rdi
call sym.strncmp
test eax, eax
jne 0x140022816
mov ecx, dword [r12 + 0x64]
test ecx, ecx
je 0x1400228df
mov r9, rdi
mov r8, r14
lea rcx, str.INSERT_INTO_sqlite_schema_type_name_tbl_name_rootpage_sql_VALUES_table__q__q_0__q__
mov rdx, r14
call sym.sqlite3_mprintf
mov rbx, rax
test rax, rax
je 0x14002292e
mov rdx, rax
lea rcx, [0x140151227]
call sym.oPrintfUtf8
mov rcx, rbx
call sym.sqlite3_free
jmp 0x1400226da
mov rdx, r14
lea rcx, str.sqlite_stat_
call sym.sqlite3_strglob
or eax, ebx
jne 0x1400226ff
test ebp, ebp
jne 0x1400222de
lea rcx, str.ANALYZE_sqlite_schema__n
call sym.oPutsUtf8.isra.0
jmp 0x1400222de
test eax, eax
je 0x1400224e0
lea r15, [0x140159690]
lea rdi, [0x1401556e5]
lea r13, [r15 + 0x18]
test ebp, ebp
je 0x140022830
mov ebx, 1
jmp 0x1400227f0
add rbx, 1
cmp ebp, ebx
jl 0x140022830
mov rdx, qword [rsi + rbx*8]
mov rcx, qword [r15]
call sym.sqlite3_stricmp
test eax, eax
jne 0x1400227e8
cmp ebp, ebx
jl 0x140022830
add r15, 8
cmp r13, r15
je 0x1400224e0
mov rdi, qword [r15]
jmp 0x1400227de
lea rdx, [0x1401518db]
mov rcx, rdi
call sym.printSchemaLine.part.0
jmp 0x1400222de
mov rcx, qword [r12]
xor edx, edx
mov r9, rdi
mov r8, r14
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 0x1400224e0
mov qword [rsi], rdi
jmp 0x1400224e0
lea rcx, str.DELETE_FROM_sqlite_sequence__n
call sym.oPutsUtf8.isra.0
jmp 0x1400222de
lea rcx, str.__CORRUPTION_ERROR___n
call sym.oPutsUtf8.isra.0
mov rcx, qword [r12]
call sym.toggleSelectOrder
xor r8d, r8d
mov rdx, rsi
mov rcx, r12
call sym.shell_exec
mov rcx, qword [r12]
call sym.toggleSelectOrder
mov qword [r12 + 0x90], r13
mov rcx, rdi
mov dword [r12 + 0x54], ebp
call sym.free
mov rcx, rsi
call sym.free
jmp 0x1400226d4
lea rcx, str.PRAGMA_writable_schemaON__n
call sym.oPutsUtf8.isra.0
mov dword [r12 + 0x64], 1
jmp 0x140022753
mov rcx, qword [rsi + 8]
lea rbx, [rsi + 0x10]
test rcx, rcx
je 0x140022921
nop word cs:[rax + rax]
call sym.sqlite3_free
mov rcx, qword [rbx]
add rbx, 8
test rcx, rcx
jne 0x140022910
mov rcx, rsi
call sym.sqlite3_free
jmp 0x1400226d4
call sym.shell_out_of_memory
nop
nop word cs:[rax + rax]
nop