Skip to content

Commit 965fa39

Browse files
Updates related to report model refactor.
1 parent e637ab6 commit 965fa39

File tree

3 files changed

+10
-19
lines changed

3 files changed

+10
-19
lines changed

docs/guide.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,9 @@ $ cat alpine-report.json
103103
{
104104
"path": "/home/walkman/Projects/unblob/demo/alpine-minirootfs-3.16.1-x86_64.tar.gz_extract",
105105
"depth": 1,
106-
"chunk_id": "13590:1",
107-
"__typename__": "Task"
106+
"chunk_id": "13590:1"
108107
}
109-
],
110-
"__typename__": "TaskResult"
108+
]
111109
},
112110
...
113111
]
@@ -143,7 +141,7 @@ $ unblob -vvv unknown-file | grep -C 15 "Entropy distribution"
143141
2024-10-30 10:52.03 [debug ] Shannon entropy calculated block_size=0x20000 highest=99.99 lowest=99.98 mean=99.98 path=unknown-file_extract/0-10485760.unknown pid=1963719 size=0xa00000
144142
2024-10-30 10:52.03 [debug ] Chi square probability calculated block_size=0x20000 highest=97.88 lowest=3.17 mean=52.76 path=unknown-file_extract/0-10485760.unknown pid=1963719 size=0xa00000
145143
2024-10-30 10:52.03 [debug ] Entropy chart chart=
146-
Randomness distribution
144+
Randomness distribution
147145
┌───────────────────────────────────────────────────────────────────────────┐
148146
100┤ •• Shannon entropy (%) •••••••••♰••••••••••••••••••••••••••••••••••│
149147
90┤ ♰♰ Chi square probability (%) ♰ ♰ ♰♰♰♰ ♰ ♰ ♰ │
@@ -157,16 +155,16 @@ $ unblob -vvv unknown-file | grep -C 15 "Entropy distribution"
157155
10┤ ♰ ♰ ♰ ♰ ♰ ♰♰ ♰ ♰ ♰♰ │
158156
0┤ ♰ ♰ │
159157
└─┬──┬─┬──┬────┬───┬──┬──┬──┬───┬───┬──┬────┬───┬────┬──┬──┬────┬──┬───┬──┬─┘
160-
0 2 5 7 11 16 20 23 27 30 34 38 42 47 51 56 60 63 68 71 76 79
161-
131072 bytes
158+
0 2 5 7 11 16 20 23 27 30 34 38 42 47 51 56 60 63 68 71 76 79
159+
131072 bytes
162160
path=unknown-file_extract/0-10485760.unknown pid=1963719
163161
2024-10-30 10:52.03 [info ] Extracting unknown chunk chunk=0xc96196-0x1696196 path=unknown-file_extract/13197718-23683478.unknown pid=1963719
164162
2024-10-30 10:52.03 [debug ] Carving chunk path=unknown-file_extract/13197718-23683478.unknown pid=1963719
165163
2024-10-30 10:52.03 [debug ] Calculating randomness for file path=unknown-file_extract/13197718-23683478.unknown pid=1963719 size=0xa00000
166164
2024-10-30 10:52.03 [debug ] Shannon entropy calculated block_size=0x20000 highest=99.99 lowest=99.98 mean=99.98 path=unknown-file_extract/13197718-23683478.unknown pid=1963719 size=0xa00000
167165
2024-10-30 10:52.03 [debug ] Chi square probability calculated block_size=0x20000 highest=99.03 lowest=0.23 mean=42.62 path=unknown-file_extract/13197718-23683478.unknown pid=1963719 size=0xa00000
168166
2024-10-30 10:52.03 [debug ] Entropy chart chart=
169-
Randomness distribution
167+
Randomness distribution
170168
┌───────────────────────────────────────────────────────────────────────────┐
171169
100┤ •• Shannon entropy (%) •••••••••••••••••••••♰••••••••••••••••••••••│
172170
90┤ ♰♰ Chi square probability (%) ♰ ♰♰ ♰ │
@@ -180,8 +178,8 @@ $ unblob -vvv unknown-file | grep -C 15 "Entropy distribution"
180178
10┤ ♰ ♰ ♰ ♰ ♰ ♰ ♰ ♰♰ ♰ ♰♰ ♰♰ ♰♰ ♰ ♰ ♰ │
181179
0┤ ♰ ♰ ♰♰ ♰ ♰♰ │
182180
└─┬──┬─┬──┬────┬───┬──┬──┬──┬───┬───┬──┬────┬───┬────┬──┬──┬────┬──┬───┬──┬─┘
183-
0 2 5 7 11 16 20 23 27 30 34 38 42 47 51 56 60 63 68 71 76 79
184-
131072 bytes
181+
0 2 5 7 11 16 20 23 27 30 34 38 42 47 51 56 60 63 68 71 76 79
182+
131072 bytes
185183
```
186184

187185
### Skip extraction with file magic

package.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ python3.pkgs.buildPythonApplication {
8686
python3.pkgs.lz4 # shadowed by pkgs.lz4
8787
plotext
8888
pluggy
89+
pydantic
8990
pyfatfs
9091
pymdown-extensions
9192
pyperscan

python/unblob/file_utils.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -491,15 +491,7 @@ def __init__(self, root: Path):
491491
self.root = root.resolve()
492492
self.problems = []
493493

494-
def record_problem(
495-
self,
496-
problem: Union[
497-
ExtractionProblem,
498-
LinkExtractionProblem,
499-
PathTraversalProblem,
500-
SpecialFileExtractionProblem,
501-
],
502-
):
494+
def record_problem(self, problem: ExtractionProblem):
503495
self.problems.append(problem)
504496
problem.log_with(logger)
505497

0 commit comments

Comments
 (0)