Function at 0x1005fca0
Capabilities:
Check if file exists
Get file attributes
Reference sql statements

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
push ebx
mov ebx, dword [ebp + 0xc]
mov eax, dword [ebx + 8]
xor ecx, ecx
mov dword [ebp - 0x18], eax
or eax, 0x2800
push esi
push edi
mov dword [ebp - 0x10], ecx
mov dword [ebp - 0xc], ecx
mov dword [ebx + 8], eax
cmp byte [ebx + 0x10], cl
jne 0x1005fce3
mov eax, dword [ebp + 8]
push ecx
push str.cannot_VACUUM_from_within_a_transaction
push eax
call fcn.1002dc00
add esp, 0xc
mov edi, 1
jmp 0x1005ff5f
mov ecx, dword [ebx + 4]
mov eax, dword [ecx + 4]
mov edx, dword [eax + 4]
mov dword [ebp - 4], eax
mov eax, dword [edx]
mov eax, dword [eax + 0x4c]
cmp byte [eax], 0
mov dword [ebp - 8], eax
jne 0x1005fd05
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x1005fd08
sub eax, edx
mov esi, eax
lea ecx, [esi + 0x64]
push 1
push ecx
mov dword [ebp - 0x14], esi
call fcn.1002da60
mov edi, eax
add esp, 8
mov dword [ebp - 0x10], edi
test edi, edi
jne 0x1005fd35
lea edi, [eax + 7]
jmp 0x1005ff5f
mov eax, dword [ebp - 8]
mov edx, edi
sub edx, eax
lea esp, [esp]
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x1005fd40
jmp 0x1005fd53
mov esi, dword [ebp - 0x14]
lea eax, [esi + edi + 1]
mov byte [esi + edi], 0x2d
call fcn.1005fa70
mov ecx, edi
call fcn.1003c340
mov esi, eax
test esi, esi
je 0x1005fd8d
push esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
xor edx, edx
cmp eax, 0xffffffff
setne dl
push esi
mov dword [ebp - 8], edx
call fcn.1009cc76
mov eax, dword [ebp - 8]
add esp, 4
jmp 0x1005fd9e
push edi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
xor ecx, ecx
cmp eax, 0xffffffff
setne cl
mov eax, ecx
test eax, eax
jne 0x1005fd50
push edi
push str.ATTACH__q_AS_vacuum_db_
call fcn.10046b10
mov esi, eax
add esp, 8
test esi, esi
jne 0x1005fdbe
lea edi, [eax + 7]
jmp 0x1005ff5f
mov ecx, esi
mov eax, ebx
call fcn.1005fb00
push esi
mov edi, eax
call fcn.1009cc76
add esp, 4
test edi, edi
jne 0x1005ff5f
mov eax, dword [ebx]
lea edx, [eax + eax*2]
mov eax, dword [ebx + 4]
lea eax, [eax + edx*8]
mov edx, dword [ebp - 4]
lea ecx, [eax - 0x18]
mov eax, dword [eax - 0x14]
mov dword [ebp - 0xc], ecx
mov ecx, dword [edx + 4]
movzx esi, word [ecx + 0x14]
movzx ecx, word [ecx + 0x16]
mov edx, esi
sub edx, ecx
mov dword [ebp - 8], eax
call fcn.1002ffa0
mov ecx, str.PRAGMA_vacuum_db.synchronousOFF
mov eax, ebx
call fcn.1005fb00
mov edi, eax
test edi, edi
jne 0x1005ff5f
mov edx, dword [ebp - 4]
mov eax, dword [edx + 4]
movzx ecx, byte [eax + 0x12]
mov eax, dword [ebp - 8]
push ecx
call fcn.10030000
add esp, 4
mov ecx, str.BEGIN_EXCLUSIVE_
mov eax, ebx
call fcn.1005fb00
mov edi, eax
test edi, edi
jne 0x1005ff5f
mov ecx, str.SELECT_CREATE_TABLE_vacuum_db.__substr_sql_14_100000000____FROM_sqlite_master_WHERE_typetable_AND_name_sqlite_sequence
call fcn.1005fbc0
mov edi, eax
test edi, edi
jne 0x1005ff5f
mov ecx, str.SELECT_CREATE_INDEX_vacuum_db.__substr_sql_14_100000000___FROM_sqlite_master_WHERE_sql_LIKE_CREATE_INDEX__
call fcn.1005fbc0
mov edi, eax
test edi, edi
jne 0x1005ff5f
mov ecx, str.SELECT_CREATE_UNIQUE_INDEX_vacuum_db.__substr_sql_21_100000000____FROM_sqlite_master_WHERE_sql_LIKE_CREATE_UNIQUE_INDEX__
call fcn.1005fbc0
mov edi, eax
test edi, edi
jne 0x1005ff5f
mov ecx, str.SELECT_CREATE_VIEW_vacuum_db.__substr_sql_13_100000000____FROM_sqlite_master_WHERE_typeview
call fcn.1005fbc0
mov edi, eax
test edi, edi
jne 0x1005ff5f
mov ecx, str.SELECT_INSERT_INTO_vacuum_db.__quote_name____SELECT__FROM___quote_name____FROM_sqlite_master_WHERE_type__table_AND_name_sqlite_sequence_
call fcn.1005fbc0
mov edi, eax
test edi, edi
jne 0x1005ff5f
mov ecx, str.SELECT_DELETE_FROM_vacuum_db.__quote_name_____FROM_vacuum_db.sqlite_master_WHERE_namesqlite_sequence
call fcn.1005fbc0
mov edi, eax
test edi, edi
jne 0x1005ff5f
mov ecx, str.SELECT_INSERT_INTO_vacuum_db.__quote_name____SELECT__FROM___quote_name_____FROM_vacuum_db.sqlite_master_WHERE_namesqlite_sequence_
call fcn.1005fbc0
mov edi, eax
test edi, edi
jne 0x1005ff5f
mov ecx, str.SELECT_CREATE_TRIGGER__vacuum_db.__substr_sql__16__1000000__FROM_sqlite_master_WHERE_typetrigger
call fcn.1005fbc0
mov edi, eax
test edi, edi
jne 0x1005ff5f
xor esi, esi
movzx edi, byte [esi + 0x100d31b0]
mov eax, dword [ebp - 4]
lea edx, [ebp - 0x14]
push edx
call fcn.10035440
mov edi, eax
add esp, 4
test edi, edi
jne 0x1005ff5c
movzx ebx, byte [esi + 0x100d31b1]
movzx edi, byte [esi + 0x100d31b0]
add ebx, dword [ebp - 0x14]
mov eax, dword [ebp - 8]
call fcn.10035530
mov edi, eax
test edi, edi
jne 0x1005ff5c
add esi, 2
cmp esi, 8
jb 0x1005fee8
mov esi, dword [ebp - 4]
mov ebx, dword [ebp - 8]
push esi
mov ecx, ebx
call fcn.10036390
mov edi, eax
add esp, 4
test edi, edi
jne 0x1005ff5c
push ebx
call fcn.10030cf0
mov edi, eax
add esp, 4
test edi, edi
jne 0x1005ff5c
push esi
call fcn.10030cf0
add esp, 4
mov edi, eax
mov ebx, dword [ebp + 0xc]
mov esi, dword [ebp - 0xc]
mov eax, dword [ebp - 0x18]
mov dword [ebx + 8], eax
mov byte [ebx + 0x10], 1
test esi, esi
je 0x1005ff84
mov ecx, dword [esi + 4]
push ecx
call fcn.1002fe30
add esp, 4
xor eax, eax
mov dword [esi + 4], eax
mov dword [esi + 0x14], eax
mov esi, dword [ebp - 0x10]
test esi, esi
je 0x1005ff9b
mov eax, esi
call fcn.1003c500
push esi
call fcn.1009cc76
add esp, 4
push 0
call fcn.1003dd40
add esp, 4
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret