Function at 0x6664f020
Capabilities:
Reference sql statements

Disassembly:
push ebp
push edi
push esi
mov esi, edx
push ebx
mov ebx, eax
sub esp, 0x7c
mov dword [eax + 0xc], edx
mov dword [esp + 0x34], ecx
mov ecx, dword [esp + 0x94]
test ecx, ecx
je 0x6664f187
mov dword [esp], edx
xor ebp, ebp
call sym.libsqlite3_0.dll_sqlite3_str_new
mov dword [esp + 4], str.CREATE_TABLE___w_.__w_rowid__rowid_INTEGER_PRIMARY_KEY_nodeno
mov edi, eax
mov eax, dword [esp + 0x90]
mov dword [esp], edi
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x34]
mov dword [esp + 8], eax
call sym.libsqlite3_0.dll_sqlite3_str_appendf
cmp byte [ebx + 0x19], 0
je 0x6664f09f
lea esi, [esi]
lea esi, [esi]
mov dword [esp + 8], ebp
add ebp, 1
mov dword [esp + 4], str._a_d
mov dword [esp], edi
call sym.libsqlite3_0.dll_sqlite3_str_appendf
movzx eax, byte [ebx + 0x19]
cmp eax, ebp
jg 0x6664f080
mov ebp, dword [esp + 0x34]
mov eax, dword [esp + 0x90]
mov dword [esp + 4], str.__CREATE_TABLE___w_.__w_node__nodeno_INTEGER_PRIMARY_KEY_data__
mov dword [esp], edi
mov dword [esp + 0xc], eax
mov dword [esp + 8], ebp
call sym.libsqlite3_0.dll_sqlite3_str_appendf
mov eax, dword [esp + 0x90]
mov dword [esp + 8], ebp
mov dword [esp + 4], str.CREATE_TABLE___w_.__w_parent__nodeno_INTEGER_PRIMARY_KEY_parentnode__
mov dword [esp + 0xc], eax
mov dword [esp], edi
call sym.libsqlite3_0.dll_sqlite3_str_appendf
mov eax, dword [ebx + 0x10]
mov dword [esp + 8], ebp
mov dword [esp + 4], str.INSERT_INTO___w_.__w_node_VALUES_1_zeroblob__d__
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x90]
mov dword [esp], edi
mov dword [esp + 0xc], eax
call sym.libsqlite3_0.dll_sqlite3_str_appendf
cmp edi, 0x6667cc80
je 0x6664f4c8
test edi, edi
je 0x6664f4c8
mov eax, dword [edi + 4]
test eax, eax
je 0x6664f4c0
mov edx, dword [edi + 0x10]
mov byte [eax + edx], 0
mov edx, dword [edi + 0xc]
test edx, edx
jne 0x6664f4f0
mov ebp, dword [edi + 4]
mov dword [esp], edi
call sym.libsqlite3_0.dll_sqlite3_free
test ebp, ebp
je 0x6664f4c8
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], ebp
mov dword [esp], esi
call sym.libsqlite3_0.dll_sqlite3_exec
mov dword [esp], ebp
mov dword [esp + 0x38], eax
call sym.libsqlite3_0.dll_sqlite3_free
mov eax, dword [esp + 0x38]
test eax, eax
jne 0x6664f22b
lea eax, [ebx + 0x50]
mov dword [esp + 0x20], 0
mov dword [esp + 0x50], eax
lea eax, [ebx + 0x54]
mov dword [esp + 0x54], eax
lea eax, [ebx + 0x58]
mov dword [esp + 0x58], eax
lea eax, [ebx + 0x5c]
mov dword [esp + 0x5c], eax
lea eax, [ebx + 0x60]
mov dword [esp + 0x60], eax
lea eax, [ebx + 0x64]
mov dword [esp + 0x64], eax
lea eax, [ebx + 0x68]
mov dword [esp + 0x68], eax
lea eax, [ebx + 0x6c]
mov dword [esp + 0x6c], eax
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x66682d6c
mov eax, dword [ebx + 0x20]
mov dword [esp], esi
mov dword [esp + 4], eax
call sym.libsqlite3_0.dll_sqlite3_table_column_metadata
test eax, eax
je 0x6664f238
mov dword [ebx + 0x30], 0x100000
mov dword [ebx + 0x34], 0
cmp eax, 1
je 0x6664f2b1
cmp byte [ebx + 0x19], 0
jne 0x6664f35b
add esp, 0x7c
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [ebx + 0x24]
mov dword [esp + 8], eax
mov eax, dword [ebx + 0x20]
mov dword [esp], str.SELECT_stat_FROM__Q.sqlite_stat1_WHERE_tbl___q_rowid
mov dword [esp + 4], eax
call sym.libsqlite3_0.dll_sqlite3_mprintf
mov edi, eax
mov eax, 7
test edi, edi
je 0x6664f221
lea eax, [esp + 0x4c]
mov dword [esp], pe_nt_image_headers32
mov edx, edi
mov ecx, 0xffffffff
mov dword [esp + 8], eax
mov eax, esi
mov dword [esp + 0xc], 0
mov dword [esp + 4], 0
call fcn.666445b0
test eax, eax
je 0x6664f510
cmp eax, 7
je 0x6664f537
mov dword [ebx + 0x30], 0x100000
mov dword [ebx + 0x34], 0
mov dword [esp], edi
call sym.libsqlite3_0.dll_sqlite3_free
mov dword [esp + 0x38], ebx
xor edi, edi
jmp 0x6664f30b
mov dword [esp + 0xc], 0
mov eax, dword [esp + edi*4 + 0x50]
mov edx, ebx
add edi, 1
mov dword [esp + 4], 0
mov ecx, 0xffffffff
mov dword [esp + 8], eax
mov eax, esi
mov dword [esp], 0x85
call fcn.666445b0
mov dword [esp], ebx
mov ebp, eax
call sym.libsqlite3_0.dll_sqlite3_free
cmp edi, 7
jg 0x6664f5e1
test ebp, ebp
jne 0x6664f5e1
cmp edi, 3
je 0x6664f4d8
mov eax, dword [edi*4 + str.0hfhhf]
mov ecx, dword [esp + 0x90]
mov edx, dword [esp + 0x34]
mov dword [esp], eax
mov dword [esp + 8], ecx
mov dword [esp + 4], edx
call sym.libsqlite3_0.dll_sqlite3_mprintf
mov ebx, eax
test eax, eax
jne 0x6664f2c0
mov dword [esp], 0
mov ebx, dword [esp + 0x38]
call sym.libsqlite3_0.dll_sqlite3_free
cmp byte [ebx + 0x19], 0
mov eax, 7
je 0x6664f22b
mov eax, dword [esp + 0x90]
mov ebp, dword [esp + 0x34]
mov dword [esp], str.SELECT__FROM___w_.__w_rowid__WHERE_rowid_1
mov dword [esp + 8], eax
mov dword [esp + 4], ebp
call sym.libsqlite3_0.dll_sqlite3_mprintf
mov dword [ebx + 0x40], eax
test eax, eax
je 0x6664f4c8
mov dword [esp], esi
call sym.libsqlite3_0.dll_sqlite3_str_new
mov dword [esp + 8], ebp
xor ebp, ebp
mov edi, eax
mov eax, dword [esp + 0x90]
mov dword [esp + 4], str.UPDATE___w_.__w_rowid_SET
mov dword [esp], edi
mov dword [esp + 0xc], eax
call sym.libsqlite3_0.dll_sqlite3_str_appendf
cmp byte [ebx + 0x19], 0
je 0x6664f42e
movzx edx, byte [ebx + 0x1a]
lea eax, [ebp + 2]
cmp edx, ebp
jle 0x6664f40b
mov dword [esp + 0x10], ebp
mov dword [esp + 0xc], eax
mov dword [esp + 8], ebp
add ebp, 1
mov dword [esp + 4], str.a_dcoalesce___d_a_d_
mov dword [esp], edi
call sym.libsqlite3_0.dll_sqlite3_str_appendf
movzx eax, byte [ebx + 0x19]
cmp eax, ebp
jle 0x6664f42e
mov eax, dword [edi + 0x10]
lea edx, [eax + 1]
cmp edx, dword [edi + 8]
jae 0x6664f550
add eax, dword [edi + 4]
mov dword [edi + 0x10], edx
mov byte [eax], 0x2c
movzx edx, byte [ebx + 0x1a]
lea eax, [ebp + 2]
cmp edx, ebp
jg 0x6664f3c1
mov dword [esp + 0xc], eax
mov dword [esp + 8], ebp
add ebp, 1
mov dword [esp + 4], str.a_d__d
mov dword [esp], edi
call sym.libsqlite3_0.dll_sqlite3_str_appendf
movzx eax, byte [ebx + 0x19]
cmp eax, ebp
jg 0x6664f3e8
mov dword [esp + 4], str._WHERE_rowid_1
mov dword [esp], edi
call sym.libsqlite3_0.dll_sqlite3_str_appendf
cmp edi, 0x6667cc80
je 0x6664f4c8
test edi, edi
je 0x6664f4c8
mov eax, dword [edi + 4]
test eax, eax
je 0x6664f4c0
mov edx, dword [edi + 0x10]
mov byte [eax + edx], 0
mov eax, dword [edi + 0xc]
test eax, eax
jne 0x6664f566
mov ebp, dword [edi + 4]
mov dword [esp], edi
call sym.libsqlite3_0.dll_sqlite3_free
test ebp, ebp
je 0x6664f4c8
add ebx, 0x70
mov dword [esp + 0xc], 0
mov edx, ebp
mov eax, esi
mov dword [esp + 8], ebx
mov ecx, 0xffffffff
mov dword [esp + 4], 0
mov dword [esp], 0x85
call fcn.666445b0
mov dword [esp], ebp
mov dword [esp + 0x34], eax
call sym.libsqlite3_0.dll_sqlite3_free
mov eax, dword [esp + 0x34]
add esp, 0x7c
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp], edi
call sym.libsqlite3_0.dll_sqlite3_free
add esp, 0x7c
mov eax, 7
pop ebx
pop esi
pop edi
pop ebp
ret
mov ecx, dword [esp + 0x38]
mov eax, str.INSERT_INTO__w_.__w_rowid__rowid_nodeno_VALUES__1__2_ON_CONFLICT_rowid_DO_UPDATE_SET_nodenoexcluded.nodeno
cmp byte [ecx + 0x19], 0
jne 0x6664f31b
jmp 0x6664f314
test byte [edi + 0x15], 4
jne 0x6664f138
mov eax, edi
call fcn.66599800
mov ebp, eax
jmp 0x6664f13b
mov eax, dword [esp + 0x4c]
mov dword [esp], eax
call sym.libsqlite3_0.dll_sqlite3_step
mov ebp, eax
cmp eax, 0x64
je 0x6664f57e
mov eax, dword [esp + 0x4c]
mov dword [esp], eax
call sym.libsqlite3_0.dll_sqlite3_finalize
test eax, eax
je 0x6664f29b
mov dword [esp], edi
mov dword [esp + 0x38], eax
call sym.libsqlite3_0.dll_sqlite3_free
mov eax, dword [esp + 0x38]
jmp 0x6664f221
mov ecx, 1
mov edx, 0x6667e0c2
mov eax, edi
call fcn.665a1860
jmp 0x6664f3b6
test byte [edi + 0x15], 4
jne 0x6664f467
mov eax, edi
call fcn.66599800
mov ebp, eax
jmp 0x6664f46a
mov eax, dword [esp + 0x4c]
mov dword [esp + 4], 0
mov dword [esp], eax
call sym.libsqlite3_0.dll_sqlite3_column_int64
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0x4c]
mov dword [esp + 0x3c], edx
mov dword [esp], eax
call sym.libsqlite3_0.dll_sqlite3_finalize
mov edx, dword [esp + 0x3c]
test eax, eax
jne 0x6664f537
mov ecx, edx
or ecx, dword [esp + 0x38]
je 0x6664f29b
mov ecx, edx
cmp dword [esp + 0x38], 0x64
sbb ecx, 0
mov ecx, dword [esp + 0x38]
cmovge eax, edx
cmovl ecx, ebp
mov dword [ebx + 0x34], eax
mov dword [ebx + 0x30], ecx
mov dword [esp], edi
call sym.libsqlite3_0.dll_sqlite3_free
jmp 0x6664f2b1
mov ebx, dword [esp + 0x38]
mov eax, ebp
jmp 0x6664f221