Function at 0x6664db50
Capabilities:
Reference sql statements
Resolve function by parsing pe exports

Disassembly:
push ebp
push edi
push esi
mov esi, eax
push ebx
mov ebx, edx
sub esp, 0x9c
cmp byte [edx + 0x51], 0
je 0x6664dda0
cmp dword [edx + 0xb4], 1
jg 0x6664dd70
mov eax, dword [edx + 0x3c]
mov edi, dword [esp + 0xb0]
mov dword [esp + 0x1c], eax
test edi, edi
je 0x6664ddd0
mov eax, dword [esp + 0xb0]
movzx eax, word [eax + 8]
mov edx, eax
and edx, 0x3f
cmp byte [edx + 0x66689780], 3
je 0x6664dbd8
mov edx, dword [esi]
test edx, edx
je 0x6664dbb1
mov eax, ebx
call fcn.665926e0
mov eax, ebx
mov edx, str.non_text_filename
mov edi, 1
call fcn.66591c60
mov dword [esi], eax
add esp, 0x9c
mov eax, edi
pop ebx
pop esi
pop edi
pop ebp
ret
mov edx, eax
and dx, 0x202
cmp dx, 0x202
je 0x6664dde0
test al, 1
jne 0x6664de00
mov eax, dword [esp + 0xb0]
mov edx, 1
mov dword [esp + 0x20], ecx
call fcn.665ac380
mov edx, dword [ebx + 0x3c]
mov ecx, dword [esp + 0x20]
and edx, 0xfffffffe
or edx, 6
mov dword [ebx + 0x3c], edx
mov edx, dword [ebx + 0x18]
mov edi, dword [ebx + 0x20]
shl ecx, 4
mov ebp, dword [ebx + 0x24]
mov dword [esp + 0x38], ecx
mov dword [esp + 0x20], edx
mov edx, dword [ebx + 0x68]
mov dword [esp + 0x2c], edi
and edi, 0xefffafff
mov dword [esp + 0x24], edx
mov edx, dword [ebx + 0x6c]
mov dword [esp + 0x30], ebp
mov dword [esp + 0x28], edx
movzx edx, byte [ebx + 0x5a]
mov byte [ebx + 0x5a], 0
mov byte [esp + 0x46], dl
mov edx, dword [esp + 0x20]
or edx, 6
mov dword [ebx + 0x18], edx
mov edx, edi
mov edi, ebp
or edx, 0x201
and edi, 0xfffffffe
mov dword [ebx + 0x20], edx
mov edx, dword [ebx + 0x10]
mov dword [ebx + 0x24], edi
add edx, ecx
mov ebp, dword [edx + 4]
mov edi, dword [edx]
mov edx, dword [ebp + 4]
mov dword [esp + 0x40], edi
mov edi, dword [ebx + 0x14]
mov edx, dword [edx]
mov dword [esp + 0x34], edi
movzx ecx, byte [edx + 0xc]
mov dword [esp + 0xc], eax
mov dword [esp + 8], str.ATTACH__Q_AS_vacuum_db
mov byte [esp + 0x47], cl
mov dword [esp + 4], esi
mov dword [esp], ebx
call fcn.6664db00
mov ecx, dword [esp + 0x1c]
mov edi, eax
mov dword [ebx + 0x3c], ecx
test eax, eax
jne 0x6664e0a0
mov eax, dword [esp + 0x34]
mov ecx, dword [esp + 0xb0]
shl eax, 4
add eax, dword [ebx + 0x10]
mov dword [esp + 0x3c], eax
mov eax, dword [eax + 4]
mov dword [esp + 0x1c], eax
test ecx, ecx
je 0x6664dd21
mov eax, dword [eax + 4]
mov eax, dword [eax]
mov ecx, dword [eax + 0x3c]
mov dword [esp + 0x60], 0
mov dword [esp + 0x64], 0
mov eax, dword [ecx]
test eax, eax
je 0x6664dd1d
lea edx, [esp + 0x60]
mov dword [esp], ecx
mov dword [esp + 4], edx
call dword [eax + 0x18]
test eax, eax
jne 0x6664e000
cmp eax, dword [esp + 0x60]
sbb eax, dword [esp + 0x64]
jl 0x6664e000
or dword [ebx + 0x18], 8
cmp byte [ebp + 9], 0
je 0x6664de10
mov eax, dword [ebp + 0xc]
cmp byte [ebp + 0xa], 0
lea edx, [eax + 1]
mov dword [ebp + 0xc], edx
jne 0x6664e0f0
mov eax, ebp
call fcn.6658e4e0
mov eax, dword [ebp + 4]
movzx ecx, byte [eax + 0x16]
mov edx, dword [eax + 0x24]
sub edx, dword [eax + 0x28]
cmp byte [ebp + 9], 0
mov dword [esp + 0x4c], ecx
mov dword [esp + 0x48], edx
je 0x6664de25
mov eax, dword [ebp + 0xc]
sub eax, 1
jmp 0x6664e105
mov edx, dword [eax]
test edx, edx
je 0x6664dd7d
mov eax, ebx
call fcn.665926e0
mov eax, ebx
mov edx, str.cannot_VACUUM___SQL_statements_in_progress
mov edi, 1
call fcn.66591c60
mov dword [esi], eax
add esp, 0x9c
mov eax, edi
pop ebx
pop esi
pop edi
pop ebp
ret
mov edx, dword [eax]
test edx, edx
je 0x6664ddad
mov eax, ebx
call fcn.665926e0
mov eax, ebx
mov edx, str.cannot_VACUUM_from_within_a_transaction
mov edi, 1
call fcn.66591c60
mov dword [esi], eax
add esp, 0x9c
mov eax, edi
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, 0x6667d542
jmp 0x6664dc17
mov edi, dword [esp + 0xb0]
cmp byte [edi + 0xa], 1
jne 0x6664dbea
mov eax, dword [edi + 0x10]
mov edx, dword [esp + 0x1c]
jmp 0x6664dc0e
mov edx, dword [esp + 0x1c]
xor eax, eax
jmp 0x6664dc0e
mov eax, dword [ebp + 4]
movzx ecx, byte [eax + 0x16]
mov edx, dword [eax + 0x24]
sub edx, dword [eax + 0x28]
mov dword [esp + 0x4c], ecx
mov dword [esp + 0x48], edx
mov edi, dword [esp + 0x38]
mov eax, dword [ebx + 0x10]
mov eax, dword [eax + edi + 0xc]
mov edi, dword [esp + 0x1c]
mov edx, dword [eax + 0x50]
mov eax, edi
call fcn.66596fa0
xor edx, edx
mov eax, ebp
call fcn.665972d0
mov edx, eax
mov eax, edi
call fcn.665972d0
mov eax, edi
mov edx, 0x21
call fcn.665996d0
mov ecx, str.BEGIN
mov edx, esi
mov eax, ebx
call fcn.6664d950
mov edi, eax
test eax, eax
jne 0x6664e020
mov edx, dword [esp + 0xb0]
mov eax, 2
test edx, edx
cmove edi, eax
xor ecx, ecx
mov eax, ebp
mov edx, edi
call fcn.665f7b10
mov edi, eax
test eax, eax
jne 0x6664e020
mov eax, dword [ebp + 4]
mov edx, dword [eax]
cmp byte [edx + 5], 5
je 0x6664e150
mov edi, dword [esp + 0x48]
mov ecx, dword [esp + 0x4c]
mov edx, dword [eax + 0x24]
mov eax, dword [esp + 0x1c]
mov dword [esp], 0
cmp edi, ecx
cmovge ecx, edi
mov dword [esp + 0x38], ecx
call fcn.6659d680
test eax, eax
jne 0x6664e140
cmp byte [esp + 0x47], 0
je 0x6664e120
cmp byte [ebx + 0x53], 0
jne 0x6664e140
movsx edx, byte [ebx + 0x56]
test dl, dl
js 0x6664e15c
mov eax, dword [esp + 0x1c]
call fcn.66596e20
movzx ecx, byte [esp + 0x34]
mov byte [ebx + 0xa8], cl
mov ecx, dword [esp + 0x40]
mov dword [esp + 8], str.SELECT_sql_FROM___w_.sqlite_schema_WHERE_typetableAND_name__sqlite_sequence_AND_coalesce_rootpage_1__0
mov dword [esp + 0xc], ecx
mov dword [esp + 4], esi
mov dword [esp], ebx
call fcn.6664db00
mov edi, eax
test eax, eax
jne 0x6664e020
mov ecx, dword [esp + 0x40]
mov dword [esp + 8], str.SELECT_sql_FROM___w_.sqlite_schema_WHERE_typeindex
mov dword [esp + 4], esi
mov dword [esp + 0xc], ecx
mov dword [esp], ebx
call fcn.6664db00
mov edi, eax
test eax, eax
jne 0x6664e020
mov ecx, dword [esp + 0x40]
mov byte [ebx + 0xa8], 0
mov dword [esp + 8], str.SELECTINSERT_INTO_vacuum_db.quote_name__SELECTFROM__w_.quote_name_FROM_vacuum_db.sqlite_schema_WHERE_typetableAND_coalesce_rootpage_1__0
mov dword [esp + 0xc], ecx
mov dword [esp + 4], esi
mov dword [esp], ebx
call fcn.6664db00
and dword [ebx + 0x18], 0xfffffffb
mov edi, eax
test eax, eax
jne 0x6664e020
mov ecx, dword [esp + 0x40]
mov dword [esp + 8], str.INSERT_INTO_vacuum_db.sqlite_schema_SELECTFROM___w_.sqlite_schema_WHERE_type_IN_view_trigger__OR_typetableAND_rootpage0_
mov dword [esp + 4], esi
mov dword [esp + 0xc], ecx
mov dword [esp], ebx
call fcn.6664db00
mov edi, eax
test eax, eax
jne 0x6664e020
mov dword [esp + 0x34], ebx
mov eax, 1
mov esi, dword [esp + 0x1c]
mov edx, eax
movzx ebx, dl
lea ecx, [esp + 0x5c]
mov eax, ebp
mov edx, ebx
call fcn.66597040
movzx ecx, byte [edi + 0x666886e9]
mov edx, ebx
mov eax, esi
add ecx, dword [esp + 0x5c]
call fcn.665df880
test eax, eax
jne 0x6664e189
add edi, 2
cmp edi, 0xa
je 0x6664e16a
movzx edx, byte [edi + 0x666886e8]
jmp 0x6664dfb8
mov edx, dword [esi]
test edx, edx
je 0x6664e00d
mov eax, ebx
call fcn.665926e0
mov edx, str.output_file_already_exists
mov eax, ebx
mov edi, 1
call fcn.66591c60
mov dword [esi], eax
mov eax, dword [esp + 0x20]
mov byte [ebx + 0xa8], 0
xor ecx, ecx
mov edx, 0xffffffff
mov dword [ebx + 0x18], eax
mov eax, dword [esp + 0x2c]
mov dword [ebx + 0x20], eax
mov eax, dword [esp + 0x30]
mov dword [ebx + 0x24], eax
mov eax, dword [esp + 0x24]
mov dword [ebx + 0x68], eax
mov eax, dword [esp + 0x28]
mov dword [ebx + 0x6c], eax
movzx eax, byte [esp + 0x46]
mov byte [ebx + 0x5a], al
mov eax, ebp
mov dword [esp], 1
call fcn.6659d680
mov esi, dword [esp + 0x3c]
mov byte [ebx + 0x51], 1
mov eax, dword [esi + 4]
call fcn.665fa060
mov dword [esi + 4], 0
mov dword [esi + 0xc], 0
mov eax, ebx
call fcn.66598530
add esp, 0x9c
mov eax, edi
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [esp + 0x20]
mov byte [ebx + 0xa8], 0
xor ecx, ecx
mov edx, 0xffffffff
mov dword [ebx + 0x18], eax
mov eax, dword [esp + 0x2c]
mov dword [ebx + 0x20], eax
mov eax, dword [esp + 0x30]
mov dword [ebx + 0x24], eax
mov eax, dword [esp + 0x24]
mov dword [ebx + 0x68], eax
mov eax, dword [esp + 0x28]
mov dword [ebx + 0x6c], eax
movzx eax, byte [esp + 0x46]
mov byte [ebx + 0x5a], al
mov eax, ebp
mov dword [esp], 1
call fcn.6659d680
mov byte [ebx + 0x51], 1
jmp 0x6664e085
mov edx, dword [ebp + 4]
movzx ecx, byte [edx + 0x16]
mov dword [esp + 0x4c], ecx
mov ecx, dword [edx + 0x24]
sub ecx, dword [edx + 0x28]
mov dword [esp + 0x48], ecx
mov dword [ebp + 0xc], eax
test eax, eax
jne 0x6664de25
mov eax, ebp
call fcn.66582810
jmp 0x6664de25
mov edx, dword [ebx + 0x60]
mov ecx, dword [esp + 0x38]
mov dword [esp], 0
mov eax, dword [esp + 0x1c]
call fcn.6659d680
test eax, eax
je 0x6664dee0
nop
mov edi, 7
jmp 0x6664e020
mov dword [ebx + 0x60], 0
jmp 0x6664dea9
mov eax, ebp
call fcn.66595b40
mov edx, eax
jmp 0x6664def6
mov eax, dword [esp + 0xb0]
mov ebx, dword [esp + 0x34]
test eax, eax
je 0x6664e194
mov eax, dword [esp + 0x1c]
call fcn.665f7240
mov edi, eax
jmp 0x6664e020
mov ebx, dword [esp + 0x34]
mov edi, eax
jmp 0x6664e020
cmp byte [ebp + 9], 0
je 0x6664e1ab
add dword [ebp + 0xc], 1
cmp byte [ebp + 0xa], 0
jne 0x6664e1ab
mov eax, ebp
call fcn.6658e4e0
mov eax, dword [esp + 0x1c]
cmp byte [eax + 9], 0
je 0x6664e1c4
add dword [eax + 0xc], 1
cmp byte [eax + 0xa], 0
jne 0x6664e1c4
call fcn.6658e4e0
mov eax, dword [ebp + 4]
lea edx, [esp + 0x60]
mov eax, dword [eax]
mov eax, dword [eax + 0x3c]
mov ecx, dword [eax]
mov dword [esp + 0x34], eax
test ecx, ecx
je 0x6664e22f
mov eax, dword [esp + 0x1c]
mov eax, dword [eax + 4]
mov esi, dword [eax + 0x24]
mov edi, esi
mov edx, esi
sar edi, 0x1f
mov esi, edi
imul esi, dword [eax + 0x30]
mov edi, eax
mov eax, edx
mul dword [edi + 0x30]
mov dword [esp + 4], 0xb
add edx, esi
mov dword [esp + 0x60], eax
mov eax, dword [esp + 0x34]
mov dword [esp + 0x64], edx
lea edx, [esp + 0x60]
mov dword [esp + 8], edx
mov dword [esp + 0x40], edx
mov dword [esp], eax
call dword [ecx + 0x28]
mov edx, dword [esp + 0x40]
cmp eax, 0xc
mov edi, eax
je 0x6664e22f
test eax, eax
jne 0x6664e286
mov edi, edx
xor eax, eax
mov ecx, 0xc
mov esi, dword [esp + 0x1c]
rep stosd dword es:[edi], eax
mov dword [esp + 0x34], edx
mov eax, dword [esi]
mov dword [esp], edx
mov dword [esp + 4], 0x7fffffff
mov dword [esp + 0x74], eax
mov dword [esp + 0x78], esi
mov dword [esp + 0x64], ebp
mov dword [esp + 0x70], 1
call sym.libsqlite3_0.dll_sqlite3_backup_step
mov edx, dword [esp + 0x34]
mov dword [esp], edx
call sym.libsqlite3_0.dll_sqlite3_backup_finish
mov edi, eax
test eax, eax
jne 0x6664e301
mov eax, dword [ebp + 4]
and word [eax + 0x18], 0xfffd
mov esi, dword [esp + 0x1c]
cmp byte [esi + 9], 0
je 0x6664e2a3
mov eax, dword [esi + 0xc]
mov dword [esp + 0x34], eax
sub eax, 1
mov dword [esi + 0xc], eax
je 0x6664e347
cmp byte [ebp + 9], 0
je 0x6664e2b3
sub dword [ebp + 0xc], 1
je 0x6664e33b
test edi, edi
jne 0x6664e020
mov eax, dword [esp + 0x1c]
call fcn.665f7240
mov edi, eax
test eax, eax
jne 0x6664e020
mov esi, dword [esp + 0x1c]
mov eax, esi
call fcn.66595b40
mov edx, eax
mov eax, ebp
call fcn.66596e20
mov eax, dword [esi + 4]
mov ecx, dword [esp + 0x38]
mov edx, dword [eax + 0x24]
mov dword [esp], 1
mov eax, ebp
call fcn.6659d680
mov edi, eax
jmp 0x6664e020
mov eax, dword [esp + 0x64]
mov eax, dword [eax + 4]
mov eax, dword [eax]
cmp byte [eax + 0xc], 0
jne 0x6664e286
add dword [eax + 0x64], 1
mov edx, dword [eax + 0x58]
jmp 0x6664e327
mov dword [edx + 0x10], 1
mov edx, dword [edx + 0x2c]
test edx, edx
jne 0x6664e31d
mov eax, dword [eax + 0xd4]
call fcn.6658ec50
jmp 0x6664e286
mov eax, ebp
call fcn.66582810
jmp 0x6664e2b3
mov eax, esi
call fcn.66582810
jmp 0x6664e2a3