Commit 04b69a5
committed
feat(processing): add multi-file directory handler
There are certain formats where the content is split between
multiple files. Currently unblob operates under the assumption
that all content resides in a single file.
A few examples where this might be relevant:
- multi-volume archives, such as 7zip, rar etc.
- VM snapshots
- content + index type formats
This change introduces a DirectoryHandler which can operate
on multiple files residing in one directory or at least under
one subtree. Most formats there is a "main" file which can
be identified by a directory file name pattern. Using this
first file the handler can identify the other files and
return a MultiFile object, similar to ValidChunks.
We do not support cases where a single file is part of
multiple MultiFile, also a file processed & extracted in
the context of a MultiFile is not processed by traditional
handlers. Also there is no carving step rather the files
are extracted directly into an extraction directory. The
original files are kept and never deleted, as these are normal
files, unlike carved out temporary chunks.
Files extracted from a MultiFile have a MultiFile as their
parent. This required extending the current File -> Chunk
reporting concept by introducing an abstract Blob
type which is the parent of Chunk and MultiFile as well.
MultiFileReports are reported under the directory Task,
but contains all included file paths as well.1 parent 11a88ab commit 04b69a5
File tree
17 files changed
+915
-139
lines changed- tests
- unblob
- extractors
- handlers
17 files changed
+915
-139
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | | - | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
28 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
29 | 43 | | |
30 | 44 | | |
31 | 45 | | |
32 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
33 | 50 | | |
34 | 51 | | |
35 | 52 | | |
36 | 53 | | |
37 | 54 | | |
38 | 55 | | |
| 56 | + | |
39 | 57 | | |
40 | 58 | | |
41 | 59 | | |
42 | 60 | | |
43 | 61 | | |
44 | | - | |
| 62 | + | |
45 | 63 | | |
46 | 64 | | |
47 | 65 | | |
48 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
49 | 70 | | |
50 | 71 | | |
51 | 72 | | |
52 | 73 | | |
53 | 74 | | |
54 | | - | |
| 75 | + | |
| 76 | + | |
55 | 77 | | |
56 | 78 | | |
57 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
116 | 115 | | |
117 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
118 | 122 | | |
119 | 123 | | |
120 | 124 | | |
121 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
122 | 129 | | |
123 | 130 | | |
124 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
125 | 136 | | |
126 | 137 | | |
127 | | - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
128 | 142 | | |
129 | 143 | | |
130 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
131 | 149 | | |
132 | 150 | | |
133 | | - | |
| 151 | + | |
134 | 152 | | |
135 | 153 | | |
136 | | - | |
137 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
138 | 162 | | |
139 | 163 | | |
140 | | - | |
| 164 | + | |
141 | 165 | | |
142 | 166 | | |
143 | | - | |
144 | | - | |
145 | 167 | | |
146 | | - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
147 | 176 | | |
148 | 177 | | |
149 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
150 | 186 | | |
151 | 187 | | |
152 | 188 | | |
153 | 189 | | |
154 | 190 | | |
155 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
156 | 195 | | |
157 | 196 | | |
158 | 197 | | |
159 | 198 | | |
160 | | - | |
| 199 | + | |
161 | 200 | | |
162 | 201 | | |
163 | 202 | | |
164 | 203 | | |
165 | | - | |
| 204 | + | |
166 | 205 | | |
167 | 206 | | |
168 | 207 | | |
169 | 208 | | |
170 | 209 | | |
171 | | - | |
172 | | - | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
173 | 214 | | |
174 | 215 | | |
175 | 216 | | |
| |||
192 | 233 | | |
193 | 234 | | |
194 | 235 | | |
195 | | - | |
196 | | - | |
197 | | - | |
| 236 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
26 | 46 | | |
27 | 47 | | |
28 | 48 | | |
| |||
35 | 55 | | |
36 | 56 | | |
37 | 57 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
42 | 79 | | |
43 | 80 | | |
44 | 81 | | |
| |||
56 | 93 | | |
57 | 94 | | |
58 | 95 | | |
59 | | - | |
| 96 | + | |
60 | 97 | | |
61 | 98 | | |
62 | 99 | | |
63 | 100 | | |
64 | | - | |
| 101 | + | |
65 | 102 | | |
66 | 103 | | |
67 | 104 | | |
| |||
90 | 127 | | |
91 | 128 | | |
92 | 129 | | |
93 | | - | |
| 130 | + | |
94 | 131 | | |
95 | 132 | | |
96 | 133 | | |
| |||
103 | 140 | | |
104 | 141 | | |
105 | 142 | | |
106 | | - | |
| 143 | + | |
107 | 144 | | |
108 | 145 | | |
109 | 146 | | |
| |||
143 | 180 | | |
144 | 181 | | |
145 | 182 | | |
146 | | - | |
| 183 | + | |
147 | 184 | | |
148 | 185 | | |
149 | 186 | | |
| |||
152 | 189 | | |
153 | 190 | | |
154 | 191 | | |
155 | | - | |
| 192 | + | |
156 | 193 | | |
| 194 | + | |
157 | 195 | | |
158 | 196 | | |
159 | 197 | | |
160 | 198 | | |
161 | 199 | | |
162 | | - | |
| 200 | + | |
163 | 201 | | |
| 202 | + | |
164 | 203 | | |
165 | 204 | | |
166 | 205 | | |
| |||
0 commit comments