Function at 0x140016e90
Capabilities:
Reference sql statements

Disassembly:
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x48
mov rdi, qword [rcx]
mov r13, qword [rsp + 0xa0]
cmp qword [rdi + 0x20], 0
mov rbx, rcx
mov esi, edx
mov rcx, qword [rcx + 8]
je 0x140017080
call sym.sqlite3_finalize
mov qword [rbx + 8], 0
mov rcx, qword [rbx + 0x18]
mov dword [rbx + 0x10], 1
mov dword [rbx + 0x58], 0
mov qword [rbx + 0x28], 0
call sym.sqlite3_free
mov rcx, qword [rbx + 0x40]
call sym.sqlite3_free
cmp dword [rbx + 0x10], 1
mov qword [rbx + 0x40], 0
mov qword [rbx + 0x18], 0
je 0x140016f20
mov r8d, 0x3ac7
lea rdx, str.shell.c
lea rcx, str.pCsr__iPgno1
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__assert]
mov r12d, esi
and r12d, 2
and esi, 1
jne 0x140017090
lea rbp, [0x140150af4]
test r12d, r12d
je 0x140016ff0
movsxd rsi, esi
mov rcx, qword [r13 + rsi*8]
call sym.sqlite3_value_int
mov dword [rbx + 0x2c], 1
mov dword [rbx + 0x10], eax
mov rcx, qword [rdi + 0x20]
test rcx, rcx
je 0x140017108
mov qword [rbx + 8], rcx
mov qword [rdi + 0x20], 0
mov r9d, 0xffffffff
mov r8, rbp
mov edx, 1
mov qword [rsp + 0x20], 0xffffffffffffffff
call sym.sqlite3_bind_text
mov esi, eax
test eax, eax
jne 0x140017053
mov rcx, qword [rbx + 8]
lea r9, [rsp + 0x34]
lea r8, [rsp + 0x38]
mov edx, 1
call sym.dbdataLoadPage.isra.0
mov rcx, qword [rsp + 0x38]
mov esi, eax
test eax, eax
jne 0x1400171c8
cmp dword [rsp + 0x34], 0x3b
jle 0x140017270
mov eax, dword [rcx + 0x38]
bswap eax
mov dword [rbx + 0x70], eax
call sym.sqlite3_free
mov rcx, rbx
add rsp, 0x48
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
jmp sym.dbdataNext
mov qword [rsp + 0x38], 0
mov rsi, qword [rbx]
mov rdx, rbp
lea rcx, str.PRAGMA__Q.page_count
call sym.sqlite3_mprintf
mov r12, rax
test r12, r12
je 0x1400171b8
mov rcx, qword [rsi + 0x18]
lea r9, [rsp + 0x38]
mov r8d, 0xffffffff
mov rdx, r12
mov qword [rsp + 0x20], 0
call sym.sqlite3_prepare_v2
mov rcx, r12
mov esi, eax
call sym.sqlite3_free
mov rcx, qword [rsp + 0x38]
test esi, esi
je 0x140017160
call sym.sqlite3_finalize
mov rcx, qword [rdi + 0x18]
call sym.sqlite3_errmsg
lea rcx, [0x1401509b2]
mov rdx, rax
call sym.sqlite3_mprintf
mov qword [rdi + 0x10], rax
mov eax, esi
add rsp, 0x48
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
ret
mov qword [rdi + 0x20], rcx
jmp 0x140016ec0
mov rcx, qword [r13]
call sym.sqlite3_value_text
mov rbp, rax
test rax, rax
je 0x140017190
test r12d, r12d
jne 0x140016f40
mov qword [rsp + 0x38], 0
mov rcx, rax
mov rsi, qword [rbx]
call sym.strlen
cmp rax, 2
jbe 0x140016ffc
cmp byte [rbp + rax - 2], 0x28
jne 0x140016ffc
cmp byte [rbp + rax - 1], 0x29
jne 0x140016ffc
lea edx, [rax - 2]
test edx, edx
jle 0x140016ffc
mov r8, rbp
lea rcx, str.SELECT__.s_0_
call sym.sqlite3_mprintf
mov r12, rax
jmp 0x14001700e
mov rcx, rbp
call sym.strlen
cmp rax, 2
jbe 0x140017121
cmp byte [rbp + rax - 2], 0x28
je 0x1400171d8
mov rcx, qword [rdi + 0x18]
lea r9, [rbx + 8]
mov qword [rsp + 0x20], 0
mov r8d, 0xffffffff
lea rdx, str.SELECT_data_FROM_sqlite_dbpage____WHERE_pgno_
call sym.sqlite3_prepare_v2
mov esi, eax
test esi, esi
jne 0x140017053
mov rcx, qword [rbx + 8]
jmp 0x140016f70
call sym.sqlite3_step
cmp eax, 0x64
je 0x140017238
mov rcx, qword [rsp + 0x38]
call sym.sqlite3_finalize
mov esi, eax
test esi, esi
je 0x140016f57
jmp 0x140017053
test r12d, r12d
jne 0x140017260
mov qword [rsp + 0x38], 0
mov rsi, qword [rbx]
lea rbp, [0x140150568]
jmp 0x140016ffc
mov esi, 7
jmp 0x140017053
call sym.sqlite3_free
jmp 0x140017053
cmp byte [rbp + rax - 1], 0x29
jne 0x140017121
lea edx, [rax - 2]
test edx, edx
jle 0x140017121
mov r8, rbp
lea rcx, str.SELECT__.s__2_
call sym.sqlite3_mprintf
mov r12, rax
test rax, rax
je 0x1400171b8
mov rcx, qword [rdi + 0x18]
lea r9, [rbx + 8]
mov r8d, 0xffffffff
mov rdx, rax
mov qword [rsp + 0x20], 0
call sym.sqlite3_prepare_v2
mov rcx, r12
mov esi, eax
call sym.sqlite3_free
jmp 0x140017146
mov rcx, qword [rsp + 0x38]
xor edx, edx
call sym.sqlite3_column_int
mov rcx, qword [rsp + 0x38]
mov dword [rbx + 0x30], eax
call sym.sqlite3_finalize
mov esi, eax
jmp 0x14001717a
lea rbp, [0x140150568]
jmp 0x140016f40
call sym.sqlite3_free
jmp 0x140016fd5