dissect.squashfs 1.9.dev1__tar.gz → 1.10.dev1__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.10.dev1/.git-blame-ignore-revs +6 -0
- dissect_squashfs-1.10.dev1/.gitattributes +1 -0
- {dissect_squashfs-1.9.dev1/dissect.squashfs.egg-info → dissect_squashfs-1.10.dev1}/PKG-INFO +3 -2
- {dissect_squashfs-1.9.dev1 → dissect_squashfs-1.10.dev1}/dissect/squashfs/c_squashfs.py +2 -1
- {dissect_squashfs-1.9.dev1 → dissect_squashfs-1.10.dev1}/dissect/squashfs/squashfs.py +3 -0
- {dissect_squashfs-1.9.dev1 → dissect_squashfs-1.10.dev1/dissect.squashfs.egg-info}/PKG-INFO +3 -2
- {dissect_squashfs-1.9.dev1 → dissect_squashfs-1.10.dev1}/dissect.squashfs.egg-info/SOURCES.txt +12 -10
- {dissect_squashfs-1.9.dev1 → dissect_squashfs-1.10.dev1}/pyproject.toml +1 -1
- {dissect_squashfs-1.9.dev1/tests/docs → dissect_squashfs-1.10.dev1/tests/_docs}/conf.py +2 -0
- {dissect_squashfs-1.9.dev1 → dissect_squashfs-1.10.dev1}/tests/conftest.py +7 -7
- {dissect_squashfs-1.9.dev1 → dissect_squashfs-1.10.dev1}/tests/test_squashfs.py +19 -0
- {dissect_squashfs-1.9.dev1 → dissect_squashfs-1.10.dev1}/tox.ini +4 -4
- {dissect_squashfs-1.9.dev1 → dissect_squashfs-1.10.dev1}/COPYRIGHT +0 -0
- {dissect_squashfs-1.9.dev1 → dissect_squashfs-1.10.dev1}/LICENSE +0 -0
- {dissect_squashfs-1.9.dev1 → dissect_squashfs-1.10.dev1}/MANIFEST.in +0 -0
- {dissect_squashfs-1.9.dev1 → dissect_squashfs-1.10.dev1}/README.md +0 -0
- {dissect_squashfs-1.9.dev1 → dissect_squashfs-1.10.dev1}/dissect/squashfs/__init__.py +0 -0
- {dissect_squashfs-1.9.dev1 → dissect_squashfs-1.10.dev1}/dissect/squashfs/compression.py +0 -0
- {dissect_squashfs-1.9.dev1 → dissect_squashfs-1.10.dev1}/dissect/squashfs/exceptions.py +0 -0
- {dissect_squashfs-1.9.dev1 → dissect_squashfs-1.10.dev1}/dissect.squashfs.egg-info/dependency_links.txt +0 -0
- {dissect_squashfs-1.9.dev1 → dissect_squashfs-1.10.dev1}/dissect.squashfs.egg-info/requires.txt +0 -0
- {dissect_squashfs-1.9.dev1 → dissect_squashfs-1.10.dev1}/dissect.squashfs.egg-info/top_level.txt +0 -0
- {dissect_squashfs-1.9.dev1 → dissect_squashfs-1.10.dev1}/setup.cfg +0 -0
- {dissect_squashfs-1.9.dev1 → dissect_squashfs-1.10.dev1}/tests/__init__.py +0 -0
- {dissect_squashfs-1.9.dev1/tests/data → dissect_squashfs-1.10.dev1/tests/_data}/gzip-opts.sqfs +0 -0
- {dissect_squashfs-1.9.dev1/tests/data → dissect_squashfs-1.10.dev1/tests/_data}/gzip.sqfs +0 -0
- {dissect_squashfs-1.9.dev1/tests/data → dissect_squashfs-1.10.dev1/tests/_data}/lz4.sqfs +0 -0
- {dissect_squashfs-1.9.dev1/tests/data → dissect_squashfs-1.10.dev1/tests/_data}/lzma.sqfs +0 -0
- {dissect_squashfs-1.9.dev1/tests/data → dissect_squashfs-1.10.dev1/tests/_data}/lzo.sqfs +0 -0
- {dissect_squashfs-1.9.dev1/tests/data → dissect_squashfs-1.10.dev1/tests/_data}/xz.sqfs +0 -0
- {dissect_squashfs-1.9.dev1/tests/data → dissect_squashfs-1.10.dev1/tests/_data}/zstd.sqfs +0 -0
- {dissect_squashfs-1.9.dev1/tests/docs → dissect_squashfs-1.10.dev1/tests/_docs}/Makefile +0 -0
- {dissect_squashfs-1.9.dev1/tests/docs → dissect_squashfs-1.10.dev1/tests/_docs}/index.rst +0 -0
- {dissect_squashfs-1.9.dev1 → dissect_squashfs-1.10.dev1}/tests/test_exceptions.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
tests/_data/** filter=lfs diff=lfs merge=lfs -text
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: dissect.squashfs
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.10.dev1
|
|
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
|
|
@@ -34,6 +34,7 @@ Provides-Extra: dev
|
|
|
34
34
|
Requires-Dist: dissect.squashfs[full]; extra == "dev"
|
|
35
35
|
Requires-Dist: dissect.cstruct<5.0.dev,>=4.0.dev; extra == "dev"
|
|
36
36
|
Requires-Dist: dissect.util<4.0.dev,>=3.0.dev; extra == "dev"
|
|
37
|
+
Dynamic: license-file
|
|
37
38
|
|
|
38
39
|
# dissect.squashfs
|
|
39
40
|
|
|
@@ -5,7 +5,8 @@ import stat
|
|
|
5
5
|
from dissect.cstruct import cstruct
|
|
6
6
|
|
|
7
7
|
squashfs_def = """
|
|
8
|
-
#define SQUASHFS_MAGIC
|
|
8
|
+
#define SQUASHFS_MAGIC 0x73717368
|
|
9
|
+
#define SQUASHFS_MAGIC_SWAP 0x68737173
|
|
9
10
|
|
|
10
11
|
/* size of metadata (inode and directory) blocks */
|
|
11
12
|
#define SQUASHFS_METADATA_SIZE 8192
|
|
@@ -33,6 +33,9 @@ class SquashFS:
|
|
|
33
33
|
|
|
34
34
|
sb = c_squashfs.squashfs_super_block(fh)
|
|
35
35
|
if sb.s_magic != c_squashfs.SQUASHFS_MAGIC:
|
|
36
|
+
if sb.s_magic == c_squashfs.SQUASHFS_MAGIC_SWAP:
|
|
37
|
+
raise NotImplementedError("Unsupported squashfs pre-4.0 big-endian filesystem")
|
|
38
|
+
|
|
36
39
|
raise ValueError("Invalid squashfs superblock")
|
|
37
40
|
|
|
38
41
|
# Only support squashfs 4.x for now
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: dissect.squashfs
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.10.dev1
|
|
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
|
|
@@ -34,6 +34,7 @@ Provides-Extra: dev
|
|
|
34
34
|
Requires-Dist: dissect.squashfs[full]; extra == "dev"
|
|
35
35
|
Requires-Dist: dissect.cstruct<5.0.dev,>=4.0.dev; extra == "dev"
|
|
36
36
|
Requires-Dist: dissect.util<4.0.dev,>=3.0.dev; extra == "dev"
|
|
37
|
+
Dynamic: license-file
|
|
37
38
|
|
|
38
39
|
# dissect.squashfs
|
|
39
40
|
|
{dissect_squashfs-1.9.dev1 → dissect_squashfs-1.10.dev1}/dissect.squashfs.egg-info/SOURCES.txt
RENAMED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
.git-blame-ignore-revs
|
|
2
|
+
.gitattributes
|
|
1
3
|
COPYRIGHT
|
|
2
4
|
LICENSE
|
|
3
5
|
MANIFEST.in
|
|
@@ -18,13 +20,13 @@ tests/__init__.py
|
|
|
18
20
|
tests/conftest.py
|
|
19
21
|
tests/test_exceptions.py
|
|
20
22
|
tests/test_squashfs.py
|
|
21
|
-
tests/
|
|
22
|
-
tests/
|
|
23
|
-
tests/
|
|
24
|
-
tests/
|
|
25
|
-
tests/
|
|
26
|
-
tests/
|
|
27
|
-
tests/
|
|
28
|
-
tests/
|
|
29
|
-
tests/
|
|
30
|
-
tests/
|
|
23
|
+
tests/_data/gzip-opts.sqfs
|
|
24
|
+
tests/_data/gzip.sqfs
|
|
25
|
+
tests/_data/lz4.sqfs
|
|
26
|
+
tests/_data/lzma.sqfs
|
|
27
|
+
tests/_data/lzo.sqfs
|
|
28
|
+
tests/_data/xz.sqfs
|
|
29
|
+
tests/_data/zstd.sqfs
|
|
30
|
+
tests/_docs/Makefile
|
|
31
|
+
tests/_docs/conf.py
|
|
32
|
+
tests/_docs/index.rst
|
|
@@ -98,7 +98,7 @@ select = [
|
|
|
98
98
|
ignore = ["E203", "B904", "UP024", "ANN002", "ANN003", "ANN204", "ANN401", "SIM105", "TRY003"]
|
|
99
99
|
|
|
100
100
|
[tool.ruff.lint.per-file-ignores]
|
|
101
|
-
"tests/
|
|
101
|
+
"tests/_docs/**" = ["INP001"]
|
|
102
102
|
|
|
103
103
|
[tool.ruff.lint.isort]
|
|
104
104
|
known-first-party = ["dissect.squashfs"]
|
|
@@ -26,34 +26,34 @@ def open_file_gz(name: str, mode: str = "rb") -> Iterator[BinaryIO]:
|
|
|
26
26
|
|
|
27
27
|
@pytest.fixture
|
|
28
28
|
def gzip_sqfs() -> Iterator[BinaryIO]:
|
|
29
|
-
yield from open_file("
|
|
29
|
+
yield from open_file("_data/gzip.sqfs")
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
@pytest.fixture
|
|
33
33
|
def gzip_opts_sqfs() -> Iterator[BinaryIO]:
|
|
34
|
-
yield from open_file("
|
|
34
|
+
yield from open_file("_data/gzip-opts.sqfs")
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
@pytest.fixture
|
|
38
38
|
def lz4_sqfs() -> Iterator[BinaryIO]:
|
|
39
|
-
yield from open_file("
|
|
39
|
+
yield from open_file("_data/lz4.sqfs")
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
@pytest.fixture
|
|
43
43
|
def lzma_sqfs() -> Iterator[BinaryIO]:
|
|
44
|
-
yield from open_file("
|
|
44
|
+
yield from open_file("_data/lzma.sqfs")
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
@pytest.fixture
|
|
48
48
|
def lzo_sqfs() -> Iterator[BinaryIO]:
|
|
49
|
-
yield from open_file("
|
|
49
|
+
yield from open_file("_data/lzo.sqfs")
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
@pytest.fixture
|
|
53
53
|
def xz_sqfs() -> Iterator[BinaryIO]:
|
|
54
|
-
yield from open_file("
|
|
54
|
+
yield from open_file("_data/xz.sqfs")
|
|
55
55
|
|
|
56
56
|
|
|
57
57
|
@pytest.fixture
|
|
58
58
|
def zstd_sqfs() -> Iterator[BinaryIO]:
|
|
59
|
-
yield from open_file("
|
|
59
|
+
yield from open_file("_data/zstd.sqfs")
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
from io import BytesIO
|
|
4
|
+
|
|
3
5
|
import pytest
|
|
4
6
|
|
|
5
7
|
from dissect.squashfs.c_squashfs import c_squashfs
|
|
@@ -75,3 +77,20 @@ def test_squashfs(sqfs: str, compression_id: int, request: pytest.FixtureRequest
|
|
|
75
77
|
sqfs = SquashFS(request.getfixturevalue(sqfs))
|
|
76
78
|
assert sqfs.sb.compression == compression_id
|
|
77
79
|
_verify_filesystem(sqfs)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def test_squashfs_unsupported_bigendian_3_0() -> None:
|
|
83
|
+
"""Test if we correctly detect a SquashFS 3.0 big-endian filesystem."""
|
|
84
|
+
|
|
85
|
+
# Random SquashFS version 3.0 big-endian header found on binwalk GitHub issue tracker.
|
|
86
|
+
buf = bytes.fromhex(
|
|
87
|
+
"73717368000000b60000002042010d364200bc844200339440016800000300006b0400104003004ae64f330000000000"
|
|
88
|
+
"001623000100000000001177ff8e0800000000000e303100000000000e3025000000000000000000000000000e234c00"
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
sb = c_squashfs.squashfs_super_block(buf)
|
|
92
|
+
assert sb.s_magic == c_squashfs.SQUASHFS_MAGIC_SWAP
|
|
93
|
+
assert sb.s_major == 0x300
|
|
94
|
+
|
|
95
|
+
with pytest.raises(NotImplementedError, match="Unsupported squashfs pre-4.0 big-endian filesystem"):
|
|
96
|
+
SquashFS(BytesIO(buf))
|
|
@@ -55,12 +55,12 @@ deps =
|
|
|
55
55
|
sphinx-design
|
|
56
56
|
furo
|
|
57
57
|
commands =
|
|
58
|
-
make -C tests/
|
|
59
|
-
make -C tests/
|
|
58
|
+
make -C tests/_docs clean
|
|
59
|
+
make -C tests/_docs html
|
|
60
60
|
|
|
61
61
|
[testenv:docs-linkcheck]
|
|
62
62
|
allowlist_externals = make
|
|
63
63
|
deps = {[testenv:docs-build]deps}
|
|
64
64
|
commands =
|
|
65
|
-
make -C tests/
|
|
66
|
-
make -C tests/
|
|
65
|
+
make -C tests/_docs clean
|
|
66
|
+
make -C tests/_docs linkcheck
|
|
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.9.dev1 → dissect_squashfs-1.10.dev1}/dissect.squashfs.egg-info/requires.txt
RENAMED
|
File without changes
|
{dissect_squashfs-1.9.dev1 → dissect_squashfs-1.10.dev1}/dissect.squashfs.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dissect_squashfs-1.9.dev1/tests/data → dissect_squashfs-1.10.dev1/tests/_data}/gzip-opts.sqfs
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
|