|
9 | 9 | "category": "Accounts",
|
10 | 10 | "notes": "",
|
11 | 11 | "paths": ('*/mobile/Library/Accounts/Accounts3.sqlite*',),
|
12 |
| - "output_types": "standard" |
| 12 | + "output_types": "standard", |
| 13 | + "artifact_icon": "user" |
13 | 14 | }
|
14 | 15 | }
|
15 | 16 |
|
16 | 17 |
|
17 |
| -from scripts.ilapfuncs import artifact_processor, open_sqlite_db_readonly, convert_ts_human_to_timezone_offset |
| 18 | +from scripts.ilapfuncs import artifact_processor, get_sqlite_db_records, convert_cocoa_core_data_ts_to_utc |
18 | 19 |
|
19 | 20 | @artifact_processor
|
20 | 21 | def accountData(files_found, report_folder, seeker, wrap_text, timezone_offset):
|
21 | 22 | data_list = []
|
22 | 23 | db_file = ''
|
| 24 | + db_records = [] |
| 25 | + |
| 26 | + query = ''' |
| 27 | + SELECT |
| 28 | + zdate, |
| 29 | + zaccounttypedescription, |
| 30 | + zusername, |
| 31 | + zaccountdescription, |
| 32 | + zaccount.zidentifier, |
| 33 | + zaccount.zowningbundleid |
| 34 | + FROM zaccount, zaccounttype |
| 35 | + WHERE zaccounttype.z_pk=zaccount.zaccounttype |
| 36 | + ''' |
23 | 37 |
|
24 | 38 | for file_found in files_found:
|
25 | 39 | if file_found.endswith('Accounts3.sqlite'):
|
26 | 40 | db_file = file_found
|
| 41 | + db_records = get_sqlite_db_records(db_file, query) |
27 | 42 | break
|
28 | 43 |
|
29 |
| - with open_sqlite_db_readonly(db_file) as db: |
30 |
| - cursor = db.cursor() |
31 |
| - cursor.execute(''' |
32 |
| - SELECT |
33 |
| - datetime(zdate+978307200,'unixepoch'), |
34 |
| - zaccounttypedescription, |
35 |
| - zusername, |
36 |
| - zaccountdescription, |
37 |
| - zaccount.zidentifier, |
38 |
| - zaccount.zowningbundleid |
39 |
| - FROM zaccount, zaccounttype |
40 |
| - WHERE zaccounttype.z_pk=zaccount.zaccounttype |
41 |
| - ''') |
42 |
| - |
43 |
| - all_rows = cursor.fetchall() |
44 |
| - |
45 |
| - for row in all_rows: |
46 |
| - timestamp = convert_ts_human_to_timezone_offset(row[0], timezone_offset) |
47 |
| - data_list.append((timestamp,row[1],row[2],row[3],row[4],row[5])) |
| 44 | + for record in db_records: |
| 45 | + timestamp = convert_cocoa_core_data_ts_to_utc(record[0]) |
| 46 | + data_list.append((timestamp, record[1], record[2], record[3], record[4], record[5])) |
48 | 47 |
|
49 | 48 | data_headers = (
|
50 | 49 | ('Timestamp', 'datetime'),
|
|
0 commit comments