dissect.squashfs 1.3.dev1__tar.gz → 1.3.dev3__tar.gz
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.
- {dissect.squashfs-1.3.dev1/dissect.squashfs.egg-info → dissect.squashfs-1.3.dev3}/PKG-INFO +1 -1
- {dissect.squashfs-1.3.dev1 → dissect.squashfs-1.3.dev3}/dissect/squashfs/squashfs.py +26 -8
- {dissect.squashfs-1.3.dev1 → dissect.squashfs-1.3.dev3/dissect.squashfs.egg-info}/PKG-INFO +1 -1
- {dissect.squashfs-1.3.dev1 → dissect.squashfs-1.3.dev3}/COPYRIGHT +0 -0
- {dissect.squashfs-1.3.dev1 → dissect.squashfs-1.3.dev3}/LICENSE +0 -0
- {dissect.squashfs-1.3.dev1 → dissect.squashfs-1.3.dev3}/MANIFEST.in +0 -0
- {dissect.squashfs-1.3.dev1 → dissect.squashfs-1.3.dev3}/README.md +0 -0
- {dissect.squashfs-1.3.dev1 → dissect.squashfs-1.3.dev3}/dissect/squashfs/__init__.py +0 -0
- {dissect.squashfs-1.3.dev1 → dissect.squashfs-1.3.dev3}/dissect/squashfs/c_squashfs.py +0 -0
- {dissect.squashfs-1.3.dev1 → dissect.squashfs-1.3.dev3}/dissect/squashfs/compression.py +0 -0
- {dissect.squashfs-1.3.dev1 → dissect.squashfs-1.3.dev3}/dissect/squashfs/exceptions.py +0 -0
- {dissect.squashfs-1.3.dev1 → dissect.squashfs-1.3.dev3}/dissect.squashfs.egg-info/SOURCES.txt +0 -0
- {dissect.squashfs-1.3.dev1 → dissect.squashfs-1.3.dev3}/dissect.squashfs.egg-info/dependency_links.txt +0 -0
- {dissect.squashfs-1.3.dev1 → dissect.squashfs-1.3.dev3}/dissect.squashfs.egg-info/requires.txt +0 -0
- {dissect.squashfs-1.3.dev1 → dissect.squashfs-1.3.dev3}/dissect.squashfs.egg-info/top_level.txt +0 -0
- {dissect.squashfs-1.3.dev1 → dissect.squashfs-1.3.dev3}/pyproject.toml +0 -0
- {dissect.squashfs-1.3.dev1 → dissect.squashfs-1.3.dev3}/setup.cfg +0 -0
- {dissect.squashfs-1.3.dev1 → dissect.squashfs-1.3.dev3}/tests/__init__.py +0 -0
- {dissect.squashfs-1.3.dev1 → dissect.squashfs-1.3.dev3}/tests/conftest.py +0 -0
- {dissect.squashfs-1.3.dev1 → dissect.squashfs-1.3.dev3}/tests/data/gzip-opts.sqfs +0 -0
- {dissect.squashfs-1.3.dev1 → dissect.squashfs-1.3.dev3}/tests/data/gzip.sqfs +0 -0
- {dissect.squashfs-1.3.dev1 → dissect.squashfs-1.3.dev3}/tests/data/lz4.sqfs +0 -0
- {dissect.squashfs-1.3.dev1 → dissect.squashfs-1.3.dev3}/tests/data/lzma.sqfs +0 -0
- {dissect.squashfs-1.3.dev1 → dissect.squashfs-1.3.dev3}/tests/data/lzo.sqfs +0 -0
- {dissect.squashfs-1.3.dev1 → dissect.squashfs-1.3.dev3}/tests/data/xz.sqfs +0 -0
- {dissect.squashfs-1.3.dev1 → dissect.squashfs-1.3.dev3}/tests/data/zstd.sqfs +0 -0
- {dissect.squashfs-1.3.dev1 → dissect.squashfs-1.3.dev3}/tests/docs/Makefile +0 -0
- {dissect.squashfs-1.3.dev1 → dissect.squashfs-1.3.dev3}/tests/docs/conf.py +0 -0
- {dissect.squashfs-1.3.dev1 → dissect.squashfs-1.3.dev3}/tests/docs/index.rst +0 -0
- {dissect.squashfs-1.3.dev1 → dissect.squashfs-1.3.dev3}/tests/test_squashfs.py +0 -0
- {dissect.squashfs-1.3.dev1 → dissect.squashfs-1.3.dev3}/tox.ini +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: dissect.squashfs
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.dev3
|
|
4
4
|
Summary: A Dissect module implementing a parser for the SquashFS file system, commonly used in appliance or device firmware
|
|
5
5
|
Author-email: Dissect Team <dissect@fox-it.com>
|
|
6
6
|
License: Affero General Public License v3
|
|
@@ -212,24 +212,42 @@ class INode:
|
|
|
212
212
|
def __repr__(self) -> str:
|
|
213
213
|
return f"<inode {self.inode_number} ({self.block}, {self.offset})>"
|
|
214
214
|
|
|
215
|
-
|
|
216
|
-
def header(self) -> Instance:
|
|
215
|
+
def _metadata(self) -> tuple[Instance, int, int]:
|
|
217
216
|
base_struct = c_squashfs.squashfs_base_inode_header
|
|
218
217
|
|
|
219
218
|
block = self.fs.sb.inode_table_start + self.block
|
|
220
|
-
|
|
219
|
+
data_block, data_offset, data = self.fs._read_metadata(block, self.offset, len(base_struct))
|
|
221
220
|
|
|
222
221
|
header = base_struct(data)
|
|
223
222
|
actual_struct = INODE_STRUCT_MAP.get(header.inode_type)
|
|
224
223
|
|
|
225
224
|
if len(actual_struct) != len(base_struct):
|
|
226
|
-
|
|
225
|
+
data_block, data_offset, data = self.fs._read_metadata(block, self.offset, len(actual_struct))
|
|
227
226
|
|
|
228
227
|
if actual_struct != base_struct:
|
|
229
228
|
header = actual_struct(data)
|
|
230
229
|
|
|
230
|
+
self.header = header
|
|
231
|
+
self.data_block = data_block
|
|
232
|
+
self.data_offset = data_offset
|
|
233
|
+
|
|
234
|
+
return header, data_block, data_offset
|
|
235
|
+
|
|
236
|
+
@cached_property
|
|
237
|
+
def header(self) -> Instance:
|
|
238
|
+
header, _, _ = self._metadata()
|
|
231
239
|
return header
|
|
232
240
|
|
|
241
|
+
@cached_property
|
|
242
|
+
def data_block(self) -> int:
|
|
243
|
+
_, data_block, _ = self._metadata()
|
|
244
|
+
return data_block
|
|
245
|
+
|
|
246
|
+
@cached_property
|
|
247
|
+
def data_offset(self) -> int:
|
|
248
|
+
_, _, data_offset = self._metadata()
|
|
249
|
+
return data_offset
|
|
250
|
+
|
|
233
251
|
@property
|
|
234
252
|
def inode_number(self) -> int:
|
|
235
253
|
return self._inode_number or self.header.inode_number
|
|
@@ -298,8 +316,8 @@ class INode:
|
|
|
298
316
|
raise NotASymlinkError(f"{self!r} is not a symlink")
|
|
299
317
|
|
|
300
318
|
_, _, data = self.fs._read_metadata(
|
|
301
|
-
self.
|
|
302
|
-
self.
|
|
319
|
+
self.data_block,
|
|
320
|
+
self.data_offset,
|
|
303
321
|
self.header.symlink_size,
|
|
304
322
|
)
|
|
305
323
|
return data.decode(errors="surrogateescape")
|
|
@@ -362,8 +380,8 @@ class INode:
|
|
|
362
380
|
|
|
363
381
|
if blocks:
|
|
364
382
|
_, _, data = self.fs._read_metadata(
|
|
365
|
-
self.
|
|
366
|
-
self.
|
|
383
|
+
self.data_block,
|
|
384
|
+
self.data_offset,
|
|
367
385
|
blocks * 4,
|
|
368
386
|
)
|
|
369
387
|
block_list = [(block, 1) for block in c_squashfs.uint32[blocks](data)]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: dissect.squashfs
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.dev3
|
|
4
4
|
Summary: A Dissect module implementing a parser for the SquashFS file system, commonly used in appliance or device firmware
|
|
5
5
|
Author-email: Dissect Team <dissect@fox-it.com>
|
|
6
6
|
License: Affero General Public License v3
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dissect.squashfs-1.3.dev1 → dissect.squashfs-1.3.dev3}/dissect.squashfs.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{dissect.squashfs-1.3.dev1 → dissect.squashfs-1.3.dev3}/dissect.squashfs.egg-info/requires.txt
RENAMED
|
File without changes
|
{dissect.squashfs-1.3.dev1 → dissect.squashfs-1.3.dev3}/dissect.squashfs.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|