Skip to content

Commit

Permalink
Merge pull request #1011 from Johann-PLW/main
Browse files Browse the repository at this point in the history
Fix open db issue with does_table_exist function
  • Loading branch information
Johann-PLW authored Jan 9, 2025
2 parents 2d23500 + bcbb7c9 commit 89fe120
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions scripts/artifacts/FacebookMessenger.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def get_FacebookMessenger(files_found, report_folder, seeker, wrap_text, timezon
logfunc(f'No Facebook Messenger - Calls data available for {basename(file_found)}')

db = open_sqlite_db_readonly(file_found)
check = does_table_exist(db, 'contacts')
check = does_table_exist(file_found, 'contacts')
if check:
cursor = db.cursor()
cursor.execute('''
Expand Down Expand Up @@ -143,7 +143,7 @@ def get_FacebookMessenger(files_found, report_folder, seeker, wrap_text, timezon
logfunc(f'No Facebook Messenger - Contacts data available for {basename(file_found)}')

db = open_sqlite_db_readonly(file_found)
check = does_table_exist(db, 'contacts')
check = does_table_exist(file_found, 'contacts')
if check:
cursor = db.cursor()
cursor.execute('''
Expand Down Expand Up @@ -181,7 +181,7 @@ def get_FacebookMessenger(files_found, report_folder, seeker, wrap_text, timezon
logfunc(f'No Facebook Messenger - Secret Conversation data available for {basename(file_found)}')

db = open_sqlite_db_readonly(file_found)
check = does_table_exist(db, 'thread_participant_detail')
check = does_table_exist(file_found, 'thread_participant_detail')
if check:
cursor = db.cursor()
cursor.execute('''
Expand Down
2 changes: 1 addition & 1 deletion scripts/artifacts/FitnessWorkoutsLocationData.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def get_Health(files_found, report_folder, seeker, wrap_text, timezone_offset):

cursor = db.cursor()

if does_table_exist(db, 'location_series_data') == True:
if does_table_exist(healthdb_secure, 'location_series_data') == True:

# Fitness Workouts Location Data Analysis

Expand Down
2 changes: 1 addition & 1 deletion scripts/artifacts/calendarAll.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def calendarEvents(files_found, report_folder, seeker, wrap_text, timezone_offse

# Calendar Events

attachment_file_exists = does_table_exist(db, 'AttachmentFile')
attachment_file_exists = does_table_exist(file_found, 'AttachmentFile')

if attachment_file_exists:
attachments = '''
Expand Down
4 changes: 2 additions & 2 deletions scripts/artifacts/geodApplications.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ def get_geodApplications(files_found, report_folder, seeker, wrap_text, timezone
db = open_sqlite_db_readonly(file_found)
cursor = db.cursor()

if does_table_exist(db, 'mkcount'):
if does_table_exist(file_found, 'mkcount'):
query = "SELECT count_type, app_id, createtime FROM mkcount"
elif does_table_exist(db, 'dailycounts'):
elif does_table_exist(file_found, 'dailycounts'):
query = "SELECT count_type, app_id, createtime FROM dailycounts"

cursor.execute(query)
Expand Down
4 changes: 2 additions & 2 deletions scripts/artifacts/geodMapTiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,15 @@ def geodMapTiles(files_found, report_folder, seeker, wrap_text, timezone_offset)
cursor = db.cursor()
usesDataTable = True

if does_table_exist(db, 'tiles') and does_table_exist(db, 'data'):
if does_table_exist(file_found, 'tiles') and does_table_exist(file_found, 'data'):
logfunc('Parsing Geolocation from data table with tiles table.')
query = '''
SELECT datetime(access_times.timestamp, 'unixepoch') as timestamp, key_a, key_b, key_c, key_d, tileset, data, size, etag
FROM data
INNER JOIN tiles on data.ROWID = tiles.data_pk
INNER JOIN access_times on data.rowid = access_times.data_pk
'''
elif does_table_exist(db, 'data'):
elif does_table_exist(file_found, 'data'):
logfunc('Parsing Geolocation from data table.')
query = '''
SELECT datetime(access_times.timestamp, 'unixepoch') as timestamp, key_a, key_b, key_c, key_d, tileset, data, size, etag
Expand Down
2 changes: 1 addition & 1 deletion scripts/artifacts/geodPDPlaceCache.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def get_geodPDPlaceCache(files_found, report_folder, seeker, wrap_text, timezone
break

db = open_sqlite_db_readonly(file_found)
if does_table_exist(db, 'pdplacelookup'):
if does_table_exist(file_found, 'pdplacelookup'):
query = ("""
SELECT requestkey, pdplacelookup.pdplacehash, datetime('2001-01-01', "lastaccesstime" || ' seconds') as lastaccesstime, datetime('2001-01-01', "expiretime" || ' seconds') as expiretime, pdplace
FROM pdplacelookup
Expand Down
2 changes: 1 addition & 1 deletion scripts/artifacts/voicemail.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def get_voicemail(files_found, report_folder, seeker, wrap_text, timezone_offset
db = open_sqlite_db_readonly(voicemail_db)
cursor = db.cursor()

table_map_exists = does_table_exist(db, 'map')
table_map_exists = does_table_exist(voicemail_db, 'map')

if table_map_exists:
db_query = '''
Expand Down

0 comments on commit 89fe120

Please sign in to comment.