Function at 0x40e1d0
Capabilities:
Reference sql statements

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x58
mov rsi, rcx
mov rdi, rdx
mov rdx, r8
mov qword [rsp + 0x40], 0
lea rcx, str.SELECT_name__sql_FROM_sqlite_schema_WHERE__s_ORDER_BY_rowid_ASC
mov r15, r8
mov rbp, r9
mov qword [rsp + 0x48], 0
call sym.sqlite3_mprintf
lea r14, [rsp + 0x40]
mov rcx, rax
mov rbx, rax
call sym.shell_check_oom
mov rcx, qword [rsi]
or r8d, 0xffffffff
mov r9, r14
mov qword [rsp + 0x20], 0
mov rdx, rbx
call sym.sqlite3_prepare_v2
test eax, eax
jne 0x40e39c
lea rax, [rsp + 0x48]
mov qword [rsp + 0x30], rax
mov rcx, qword [rsp + 0x40]
call sym.sqlite3_step
mov rcx, qword [rsp + 0x40]
cmp eax, 0x64
jne 0x40e341
xor edx, edx
call sym.sqlite3_column_text
mov rcx, qword [rsp + 0x40]
mov edx, 1
mov r12, rax
call sym.sqlite3_column_text
test r12, r12
mov r13, rax
je 0x40e24a
test rax, rax
je 0x40e24a
lea rdx, [0x004d57bc]
mov rcx, r12
call sym.sqlite3_stricmp
test eax, eax
je 0x40e320
lea rcx, str._s...
mov rdx, r12
call sym.printf
mov ecx, 1
call qword [sym.__acrt_iob_func]
mov rcx, rax
call sym.fflush
mov rax, qword [rsp + 0x30]
xor r8d, r8d
xor r9d, r9d
mov rdx, r13
mov rcx, rdi
mov qword [rsp + 0x20], rax
call sym.sqlite3_exec
mov r8, qword [rsp + 0x48]
test r8, r8
mov qword [rsp + 0x38], r8
je 0x40e320
mov ecx, 2
call qword [sym.__acrt_iob_func]
mov r8, qword [rsp + 0x38]
mov r9, r13
lea rdx, str.Error:__s_nSQL:___s__n
mov rcx, rax
call sym.utf8_printf
mov rcx, qword [rsp + 0x48]
call sym.sqlite3_free
mov qword [rsp + 0x48], 0
test rbp, rbp
je 0x40e330
mov r8, r12
mov rdx, rdi
mov rcx, rsi
call rbp
lea rcx, str.done
call sym.puts
jmp 0x40e24a
cmp eax, 0x65
je 0x40e4ce
call sym.sqlite3_finalize
mov rcx, rbx
call sym.sqlite3_free
lea rcx, str.SELECT_name__sql_FROM_sqlite_schema_WHERE__s_ORDER_BY_rowid_DESC
mov rdx, r15
call sym.sqlite3_mprintf
lea r15, [rsp + 0x48]
mov rcx, rax
mov rbx, rax
call sym.shell_check_oom
mov rcx, qword [rsi]
mov r9, r14
or r8d, 0xffffffff
mov qword [rsp + 0x20], 0
mov rdx, rbx
lea r14, [0x004d57bc]
call sym.sqlite3_prepare_v2
test eax, eax
je 0x40e409
mov rcx, qword [rsi]
call sym.sqlite3_errmsg
mov rcx, qword [rsi]
mov qword [rsp + 0x38], rax
call sym.sqlite3_extended_errcode
mov ecx, 2
mov dword [rsp + 0x30], eax
call qword [sym.__acrt_iob_func]
mov r9, qword [rsp + 0x38]
mov qword [rsp + 0x20], rbx
lea rdx, str.Error:___d___s_on___s__n
mov r8d, dword [rsp + 0x30]
mov rcx, rax
call sym.utf8_printf
jmp 0x40e4ce
mov rcx, qword [rsp + 0x40]
xor edx, edx
call sym.sqlite3_column_text
mov rcx, qword [rsp + 0x40]
mov edx, 1
mov r12, rax
call sym.sqlite3_column_text
test r12, r12
mov r13, rax
jne 0x40e41d
mov rcx, qword [rsp + 0x40]
call sym.sqlite3_step
cmp eax, 0x64
je 0x40e3e3
jmp 0x40e4ce
test rax, rax
je 0x40e409
mov rdx, r14
mov rcx, r12
call sym.sqlite3_stricmp
test eax, eax
je 0x40e409
lea rcx, str._s...
mov rdx, r12
call sym.printf
mov ecx, 1
call qword [sym.__acrt_iob_func]
mov rcx, rax
call sym.fflush
xor r8d, r8d
xor r9d, r9d
mov qword [rsp + 0x20], r15
mov rdx, r13
mov rcx, rdi
call sym.sqlite3_exec
mov r8, qword [rsp + 0x48]
test r8, r8
mov qword [rsp + 0x30], r8
je 0x40e4ad
mov ecx, 2
call qword [sym.__acrt_iob_func]
mov r8, qword [rsp + 0x30]
mov r9, r13
lea rdx, str.Error:__s_nSQL:___s__n
mov rcx, rax
call sym.utf8_printf
mov rcx, qword [rsp + 0x48]
call sym.sqlite3_free
mov qword [rsp + 0x48], 0
test rbp, rbp
je 0x40e4bd
mov r8, r12
mov rdx, rdi
mov rcx, rsi
call rbp
lea rcx, str.done
call sym.puts
jmp 0x40e409
mov rcx, qword [rsp + 0x40]
call sym.sqlite3_finalize
mov rcx, rbx
call sym.sqlite3_free
nop
add rsp, 0x58
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret