dfindexeddb 20241031__py3-none-any.whl → 20241105__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -203,10 +203,11 @@ def App():
203
203
  parser_db = subparsers.add_parser(
204
204
  'db', help='Parse a directory as leveldb.')
205
205
  parser_db.add_argument(
206
- '-s', '--source',
206
+ '-s',
207
+ '--source',
207
208
  required=True,
208
209
  type=pathlib.Path,
209
- help='The source leveldb directory')
210
+ help='The source leveldb directory.')
210
211
  recover_group = parser_db.add_mutually_exclusive_group()
211
212
  recover_group.add_argument(
212
213
  '--use_manifest',
@@ -226,7 +227,7 @@ def App():
226
227
  'jsonl',
227
228
  'repr'],
228
229
  default='json',
229
- help='Output format. Default is json')
230
+ help='Output format. Default is json.')
230
231
  parser_db.add_argument(
231
232
  '--plugin',
232
233
  help='Use plugin to parse records.')
@@ -235,10 +236,11 @@ def App():
235
236
  parser_log = subparsers.add_parser(
236
237
  'log', help='Parse a leveldb log file.')
237
238
  parser_log.add_argument(
238
- '-s', '--source',
239
+ '-s',
240
+ '--source',
239
241
  required=True,
240
242
  type=pathlib.Path,
241
- help='The source leveldb file')
243
+ help='The source leveldb file.')
242
244
  parser_log.add_argument(
243
245
  '-o',
244
246
  '--output',
@@ -247,7 +249,7 @@ def App():
247
249
  'jsonl',
248
250
  'repr'],
249
251
  default='json',
250
- help='Output format. Default is json')
252
+ help='Output format. Default is json.')
251
253
  parser_log.add_argument(
252
254
  '--plugin',
253
255
  help='Use plugin to parse records.')
@@ -265,7 +267,8 @@ def App():
265
267
  parser_ldb = subparsers.add_parser(
266
268
  'ldb', help='Parse a leveldb table (.ldb) file.')
267
269
  parser_ldb.add_argument(
268
- '-s', '--source',
270
+ '-s',
271
+ '--source',
269
272
  required=True,
270
273
  type=pathlib.Path,
271
274
  help='The source leveldb file')
@@ -277,7 +280,7 @@ def App():
277
280
  'jsonl',
278
281
  'repr'],
279
282
  default='json',
280
- help='Output format. Default is json')
283
+ help='Output format. Default is json.')
281
284
  parser_ldb.add_argument(
282
285
  '--plugin',
283
286
  help='Use plugin to parse records.')
@@ -293,7 +296,8 @@ def App():
293
296
  parser_descriptor = subparsers.add_parser(
294
297
  'descriptor', help='Parse a leveldb descriptor (MANIFEST) file.')
295
298
  parser_descriptor.add_argument(
296
- '-s', '--source',
299
+ '-s',
300
+ '--source',
297
301
  required=True,
298
302
  type=pathlib.Path,
299
303
  help='The source leveldb file')
@@ -305,13 +309,16 @@ def App():
305
309
  'jsonl',
306
310
  'repr'],
307
311
  default='json',
308
- help='Output format. Default is json')
312
+ help='Output format. Default is json.')
309
313
  db_group = parser_descriptor.add_mutually_exclusive_group()
310
314
  db_group.add_argument(
311
315
  '-t',
312
316
  '--structure_type',
313
317
  choices=[
314
- 'blocks', 'physical_records', 'versionedit'],
318
+ 'blocks',
319
+ 'physical_records',
320
+ 'versionedit'
321
+ ],
315
322
  help='Parses the specified structure. Default is versionedit.')
316
323
  db_group.add_argument(
317
324
  '-v',
@@ -41,7 +41,10 @@ class InternalKey:
41
41
 
42
42
  @classmethod
43
43
  def FromDecoder(
44
- cls, decoder: utils.LevelDBDecoder, base_offset: int = 0) -> InternalKey:
44
+ cls,
45
+ decoder: utils.LevelDBDecoder,
46
+ base_offset: int = 0
47
+ ) -> InternalKey:
45
48
  """Decodes an InternalKey from the current position of a LevelDBDecoder.
46
49
 
47
50
  Args:
@@ -91,7 +94,10 @@ class NewFile(utils.FromDecoderMixin):
91
94
 
92
95
  @classmethod
93
96
  def FromDecoder(
94
- cls, decoder: utils.LevelDBDecoder, base_offset: int = 0) -> NewFile:
97
+ cls,
98
+ decoder: utils.LevelDBDecoder,
99
+ base_offset: int = 0
100
+ ) -> NewFile:
95
101
  """Decodes a NewFile from the current position of a LevelDBDecoder.
96
102
 
97
103
  Args:
@@ -131,7 +137,9 @@ class CompactPointer(utils.FromDecoderMixin):
131
137
 
132
138
  @classmethod
133
139
  def FromDecoder(
134
- cls, decoder: utils.LevelDBDecoder, base_offset: int = 0
140
+ cls,
141
+ decoder: utils.LevelDBDecoder,
142
+ base_offset: int = 0
135
143
  ) -> CompactPointer:
136
144
  """Decodes a CompactPointer from the current position of a LevelDBDecoder.
137
145
 
@@ -162,7 +170,10 @@ class DeletedFile(utils.FromDecoderMixin):
162
170
 
163
171
  @classmethod
164
172
  def FromDecoder(
165
- cls, decoder: utils.LevelDBDecoder, base_offset: int = 0) -> DeletedFile:
173
+ cls,
174
+ decoder: utils.LevelDBDecoder,
175
+ base_offset: int = 0
176
+ ) -> DeletedFile:
166
177
  """Decodes a DeletedFile from the current position of a LevelDBDecoder.
167
178
 
168
179
  Args:
@@ -204,7 +215,10 @@ class VersionEdit(utils.FromDecoderMixin):
204
215
 
205
216
  @classmethod
206
217
  def FromDecoder(
207
- cls, decoder: utils.LevelDBDecoder, base_offset: int = 0) -> VersionEdit:
218
+ cls,
219
+ decoder: utils.LevelDBDecoder,
220
+ base_offset: int = 0
221
+ ) -> VersionEdit:
208
222
  """Decodes a VersionEdit from the current position of a LevelDBDecoder.
209
223
 
210
224
  Args:
@@ -332,6 +346,7 @@ class FileReader:
332
346
  VersionEdit
333
347
  """
334
348
  buffer = bytearray()
349
+ offset = None
335
350
  for physical_record in self.GetPhysicalRecords():
336
351
  if (physical_record.record_type ==
337
352
  definitions.LogFilePhysicalRecordType.FULL):
@@ -382,8 +397,9 @@ class FileReader:
382
397
  version_edit_offset=version_edit.offset,
383
398
  last_sequence=version_edit.last_sequence)
384
399
 
385
- def GetLatestVersion(self) -> LevelDBVersion:
400
+ def GetLatestVersion(self) -> Optional[LevelDBVersion]:
386
401
  """Returns the latest LevelDBVersion instance."""
402
+ latest = None
387
403
  for version in self.GetVersions():
388
404
  latest = version
389
405
  return latest
@@ -46,7 +46,10 @@ class KeyValueRecord:
46
46
 
47
47
  @classmethod
48
48
  def FromDecoder(
49
- cls, decoder: utils.LevelDBDecoder, block_offset: int, shared_key: bytes
49
+ cls,
50
+ decoder: utils.LevelDBDecoder,
51
+ block_offset: int,
52
+ shared_key: bytes
50
53
  ) -> Tuple[KeyValueRecord, bytes]:
51
54
  """Decodes a ldb key value record.
52
55
 
@@ -259,4 +262,4 @@ class FileReader:
259
262
  A tuple of key and value as bytes.
260
263
  """
261
264
  for record in self.GetKeyValueRecords():
262
- yield (record.key, record.value)
265
+ yield record.key, record.value
@@ -98,7 +98,9 @@ class WriteBatch(utils.FromDecoderMixin):
98
98
 
99
99
  @classmethod
100
100
  def FromDecoder(
101
- cls, decoder: utils.LevelDBDecoder, base_offset: int = 0
101
+ cls,
102
+ decoder: utils.LevelDBDecoder,
103
+ base_offset: int = 0
102
104
  ) -> WriteBatch:
103
105
  """Parses a WriteBatch from a binary stream.
104
106
 
@@ -132,10 +134,11 @@ class PhysicalRecord(utils.FromDecoderMixin):
132
134
  """A physical record from a leveldb log file.
133
135
 
134
136
  Attributes:
135
- offset: the record offset.
137
+ base_offset: the base offset.
136
138
  checksum: the record checksum.
137
139
  length: the length of the record in bytes.
138
- type: the record type.
140
+ offset: the record offset.
141
+ record_type: the record type.
139
142
  contents: the record contents.
140
143
  contents_offset: the offset of where the record contents are stored.
141
144
  """
@@ -151,7 +154,9 @@ class PhysicalRecord(utils.FromDecoderMixin):
151
154
 
152
155
  @classmethod
153
156
  def FromDecoder(
154
- cls, decoder: utils.LevelDBDecoder, base_offset: int = 0
157
+ cls,
158
+ decoder: utils.LevelDBDecoder,
159
+ base_offset: int = 0
155
160
  ) -> Optional[PhysicalRecord]:
156
161
  """Decodes a PhysicalRecord from the current position of a LevelDBDecoder.
157
162
 
@@ -237,7 +242,7 @@ class FileReader:
237
242
  A Log FileReader provides read-only sequential iteration of serialized
238
243
  structures in a leveldb logfile. These structures include:
239
244
  * blocks (Block)
240
- * phyiscal records (PhysicalRecord)
245
+ * physical records (PhysicalRecord)
241
246
  * batches (WriteBatch) and
242
247
  * key/value records (ParsedInternalKey).
243
248
 
@@ -288,6 +293,7 @@ class FileReader:
288
293
  WriteBatch
289
294
  """
290
295
  buffer = bytearray()
296
+ offset = None
291
297
  for physical_record in self.GetPhysicalRecords():
292
298
  if (physical_record.record_type ==
293
299
  definitions.LogFilePhysicalRecordType.FULL):
@@ -49,8 +49,8 @@ class LeveldbPluginManager:
49
49
  """
50
50
  try:
51
51
  return cls._class_registry[plugin_name]
52
- except KeyError:
53
- raise KeyError(f'Plugin not found: {plugin_name}')
52
+ except KeyError as exc:
53
+ raise KeyError(f'Plugin not found: {plugin_name}') from exc
54
54
 
55
55
  @classmethod
56
56
  def RegisterPlugin(cls, plugin_class: Type[interface.LeveldbPlugin]):
dfindexeddb/utils.py CHANGED
@@ -268,7 +268,7 @@ def asdict(obj, *, dict_factory=dict): # pylint: disable=invalid-name
268
268
  class name under the __type__ attribute name.
269
269
  """
270
270
  if not dataclasses.is_dataclass(obj):
271
- raise TypeError("asdict() should be called on dataclass instances")
271
+ raise TypeError('asdict() should be called on dataclass instances')
272
272
  return _asdict_inner(obj, dict_factory)
273
273
 
274
274
 
dfindexeddb/version.py CHANGED
@@ -15,7 +15,7 @@
15
15
  """Version information for dfIndexeddb."""
16
16
 
17
17
 
18
- __version__ = "20241031"
18
+ __version__ = "20241105"
19
19
 
20
20
 
21
21
  def GetVersion():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dfindexeddb
3
- Version: 20241031
3
+ Version: 20241105
4
4
  Summary: dfindexeddb is an experimental Python tool for performing digital forensic analysis of IndexedDB and leveldb files.
5
5
  Author-email: Syd Pleno <sydp@google.com>
6
6
  Maintainer-email: dfIndexeddb Developers <dfindexeddb-dev@googlegroups.com>
@@ -1,41 +1,41 @@
1
1
  dfindexeddb/__init__.py,sha256=KPYL9__l8od6_OyDfGRTgaJ6iy_fqIgZ-dS2S-e3Rac,599
2
2
  dfindexeddb/errors.py,sha256=PNpwyf_lrPc4TE77oAakX3mu5D_YcP3f80wq8Y1LkvY,749
3
- dfindexeddb/utils.py,sha256=g-uqQzT_iKM7PPEIuSCNkQG2ltwpnLpRA_dPtrgVzzc,9997
4
- dfindexeddb/version.py,sha256=UAMCa51yvzp9xG8y5eagDkYAfzVLED94Kp7hTfVBSSI,751
3
+ dfindexeddb/utils.py,sha256=_Pee0qy3w6d-SWx59wVTq4PBUBZ1F-DlBkSquLNr3r4,9997
4
+ dfindexeddb/version.py,sha256=NO-YKjHh-Fvil-z8ILAhBuyQ0UHcdHiPVKJwuRbDvvE,751
5
5
  dfindexeddb/indexeddb/__init__.py,sha256=kExXSVBCTKCD5BZJkdMfUMqGksH-DMJxP2_lI0gq-BE,575
6
- dfindexeddb/indexeddb/cli.py,sha256=O07_DpVeGtYx2V-jUJF5Oc3OftM2FPLSwNdS45MLCdo,7435
7
- dfindexeddb/indexeddb/types.py,sha256=cIXmShUbbXJMSbXkmthxGGrpIF9fWr3Ypfl6ckGoSBU,1892
6
+ dfindexeddb/indexeddb/cli.py,sha256=bjSQ0L-sQlYOk7v7_L8_XkrSBLXnPIcEhVfQWrxj6Ws,7533
7
+ dfindexeddb/indexeddb/types.py,sha256=Gx9b9TxDCPoz3Xc8J_NPfDxCLoyX5z_lLcSlO4W433k,1892
8
8
  dfindexeddb/indexeddb/utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  dfindexeddb/indexeddb/chromium/__init__.py,sha256=kExXSVBCTKCD5BZJkdMfUMqGksH-DMJxP2_lI0gq-BE,575
10
10
  dfindexeddb/indexeddb/chromium/blink.py,sha256=kwhPfzcWOOxYyXUWfV6f4grQwXzS2ABFaNVMIVhol3c,32268
11
- dfindexeddb/indexeddb/chromium/definitions.py,sha256=1a-AmHVZ95uDB6se_fdarwJR8q0tFMQNh2xrZ2-VxN8,8739
12
- dfindexeddb/indexeddb/chromium/record.py,sha256=LIuTwwQeQbn6CBXdo0AZZHounOWcnXRg6W082yxmNBo,47578
13
- dfindexeddb/indexeddb/chromium/v8.py,sha256=tzkKhx0S53HLCNMCls4GCFXrRCjjrgkFSwL3mbNQsjg,22656
11
+ dfindexeddb/indexeddb/chromium/definitions.py,sha256=KruZLv3U_93Sc_qedhd6hd9vuRCy6nkovnUtqW6Kz4o,8842
12
+ dfindexeddb/indexeddb/chromium/record.py,sha256=5HAtTTyIgw1gTJBq419Zq0w1aImd3nUkwAZByVCMuaM,48362
13
+ dfindexeddb/indexeddb/chromium/v8.py,sha256=rxvrqhHVww-tLsaqk4P0FJtnLR9FI9lAkgXmigBJW2Y,21557
14
14
  dfindexeddb/indexeddb/firefox/__init__.py,sha256=kExXSVBCTKCD5BZJkdMfUMqGksH-DMJxP2_lI0gq-BE,575
15
15
  dfindexeddb/indexeddb/firefox/definitions.py,sha256=xkvlYaaFR2IDQBGJGnrhVIOUce6VuMq-kWXe2CLX3Aw,4306
16
- dfindexeddb/indexeddb/firefox/gecko.py,sha256=m6-tGHOFnND-XG4C-9o1Atxo4BkHTMhFWCGqW2vFVPk,19423
16
+ dfindexeddb/indexeddb/firefox/gecko.py,sha256=sPPBYSq3Mnjv_somkrZJx1IRxTMwmgRbBVj7jwuBtXQ,19598
17
17
  dfindexeddb/indexeddb/firefox/record.py,sha256=yB7dYiwzCx1c67Sf6ViMSX51SCrcgU8OBUaVYczqTik,5766
18
18
  dfindexeddb/indexeddb/safari/__init__.py,sha256=kExXSVBCTKCD5BZJkdMfUMqGksH-DMJxP2_lI0gq-BE,575
19
- dfindexeddb/indexeddb/safari/definitions.py,sha256=nW8MmYx9Ob86W4pxm4QD4Xvr5QjoV34-U7wDhm2GIr0,2779
19
+ dfindexeddb/indexeddb/safari/definitions.py,sha256=zCXF06ugcAmYTDPumL_VqNB-TgnrPfmAyUYz3wsBwmQ,2795
20
20
  dfindexeddb/indexeddb/safari/record.py,sha256=bzoMSgpXs2SsEOKHjVh9tkJDZtzGkQByq3G5dK_Yd7Q,8010
21
- dfindexeddb/indexeddb/safari/webkit.py,sha256=LHaSLOGr74dzGblrqC_RVYD6GCftzGP-p0oWujZ3l1c,22592
21
+ dfindexeddb/indexeddb/safari/webkit.py,sha256=oTZNPVIIIVG7iGyR-aJhvwaenwb1bsFrDZRmFaZRYxs,20481
22
22
  dfindexeddb/leveldb/__init__.py,sha256=KPYL9__l8od6_OyDfGRTgaJ6iy_fqIgZ-dS2S-e3Rac,599
23
- dfindexeddb/leveldb/cli.py,sha256=e2C94FSP28dh83FWQXD5N44ymUDwkfFeX0Tfk9YLCTo,9913
23
+ dfindexeddb/leveldb/cli.py,sha256=cuMMJAC1bLR_dL1WT2rrKt7ayqArj_D1Q_7ockYi9wk,9970
24
24
  dfindexeddb/leveldb/definitions.py,sha256=lPW_kjc47vyoGOoEWfgWvKcpGbN-0h7XXwCeMoFmYKk,1486
25
- dfindexeddb/leveldb/descriptor.py,sha256=BgWO-sEqT2zhPu9oEplTa8O_szpgU2N4QfDZeroTcx0,12237
26
- dfindexeddb/leveldb/ldb.py,sha256=mN-M7PLtE_VLZCbCbzRgjkSezbMUhgDjgWgPgIxJ1jM,8087
27
- dfindexeddb/leveldb/log.py,sha256=ofw0r2f_3Ll5oHzssvp61nmjhIPdt3tmb9UeNiGLHXk,9401
25
+ dfindexeddb/leveldb/descriptor.py,sha256=5P-dCLp0qDNHrRbCF9yvuUj1u0B_KhQEVAWfuRwe0Wo,12355
26
+ dfindexeddb/leveldb/ldb.py,sha256=R6wQN5r0h_BpdFvZ2mIsz6rRNWU_2JozeQdl4uRuOBk,8103
27
+ dfindexeddb/leveldb/log.py,sha256=YtXqwy_qrA2_PDG-119oHQkDykXNn6TG4Vr285dTWgo,9480
28
28
  dfindexeddb/leveldb/record.py,sha256=j7ZnU6VDVcYVpJRGFRb5Sr2edhC3aGp3U0kPNcoZgng,11912
29
29
  dfindexeddb/leveldb/utils.py,sha256=RgEEZ7Z35m3CcOUypAiViQSzKjBgSXZ3aeJhQjY3H9w,3748
30
30
  dfindexeddb/leveldb/plugins/__init__.py,sha256=RoC6tRkq8FhqIaFs6jwu1fao_qaSvlSfIFxQVjWregI,690
31
31
  dfindexeddb/leveldb/plugins/chrome_notifications.py,sha256=-dyb_AJbUPE2wPJg_Y1Ns5CMtg4udi9Fqo5WKh6f3Z4,5354
32
32
  dfindexeddb/leveldb/plugins/interface.py,sha256=QlNEvVvU8K9ChE2kblM97cOvXwvmCh9NuSf2b6WwezQ,1257
33
- dfindexeddb/leveldb/plugins/manager.py,sha256=jisYyks3OQQQUVACoGcWN81UCGQEa537YvYL7v3CiFs,2139
33
+ dfindexeddb/leveldb/plugins/manager.py,sha256=Slcj3l3E4ObDdaZeylUv7NldgWgYv6AMgsNl8vanDTc,2155
34
34
  dfindexeddb/leveldb/plugins/notification_database_data_pb2.py,sha256=DCPZHbyq2szLgrBprOKrJKycKJma8Z_SnAQM6Jx9bZg,4389
35
- dfindexeddb-20241031.dist-info/AUTHORS,sha256=QbvjbAom57fpEkekkCVFUj0B9KUMGraR510aUMBC-PE,286
36
- dfindexeddb-20241031.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
37
- dfindexeddb-20241031.dist-info/METADATA,sha256=0Wi-Bd_2GyLC3ssYcDQuPKiFK6s98gOgir-1QuYfTPo,18972
38
- dfindexeddb-20241031.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
39
- dfindexeddb-20241031.dist-info/entry_points.txt,sha256=WG9YNLZ9lBx4Q9QF6wS4dZdZfADT3Zs4_-MV5TcA0ls,102
40
- dfindexeddb-20241031.dist-info/top_level.txt,sha256=X9OTaub1c8S_JJ7g-f8JdkhhdiZ4x1j4eni1hdUCwE4,12
41
- dfindexeddb-20241031.dist-info/RECORD,,
35
+ dfindexeddb-20241105.dist-info/AUTHORS,sha256=QbvjbAom57fpEkekkCVFUj0B9KUMGraR510aUMBC-PE,286
36
+ dfindexeddb-20241105.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
37
+ dfindexeddb-20241105.dist-info/METADATA,sha256=rMt3-NhkLi4FW2KOEBn6O5nfrKxVNmNV1nNIBPR5c2U,18972
38
+ dfindexeddb-20241105.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
39
+ dfindexeddb-20241105.dist-info/entry_points.txt,sha256=WG9YNLZ9lBx4Q9QF6wS4dZdZfADT3Zs4_-MV5TcA0ls,102
40
+ dfindexeddb-20241105.dist-info/top_level.txt,sha256=X9OTaub1c8S_JJ7g-f8JdkhhdiZ4x1j4eni1hdUCwE4,12
41
+ dfindexeddb-20241105.dist-info/RECORD,,