dissect.cstruct 4.8.dev3__py3-none-any.whl → 4.8.dev4__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.
- {dissect_cstruct-4.8.dev3.dist-info → dissect_cstruct-4.8.dev4.dist-info}/METADATA +21 -1
- {dissect_cstruct-4.8.dev3.dist-info → dissect_cstruct-4.8.dev4.dist-info}/RECORD +7 -7
- {dissect_cstruct-4.8.dev3.dist-info → dissect_cstruct-4.8.dev4.dist-info}/WHEEL +1 -1
- {dissect_cstruct-4.8.dev3.dist-info → dissect_cstruct-4.8.dev4.dist-info}/entry_points.txt +0 -0
- {dissect_cstruct-4.8.dev3.dist-info → dissect_cstruct-4.8.dev4.dist-info}/licenses/COPYRIGHT +0 -0
- {dissect_cstruct-4.8.dev3.dist-info → dissect_cstruct-4.8.dev4.dist-info}/licenses/LICENSE +0 -0
- {dissect_cstruct-4.8.dev3.dist-info → dissect_cstruct-4.8.dev4.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dissect.cstruct
|
|
3
|
-
Version: 4.8.
|
|
3
|
+
Version: 4.8.dev4
|
|
4
4
|
Summary: A Dissect module implementing a parser for C-like structures: structure parsing in Python made easy
|
|
5
5
|
Author-email: Dissect Team <dissect@fox-it.com>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -238,6 +238,26 @@ The API to access enum and flag members and their values in the same way as the
|
|
|
238
238
|
### Custom types
|
|
239
239
|
You can implement your own types by subclassing `BaseType`, and adding them to your cstruct instance with `add_custom_type(name, type, size, alignment, ...)`
|
|
240
240
|
|
|
241
|
+
### Dynamic length fields
|
|
242
|
+
To read all remaining data in the provided buffer/stream, you can use the magic `EOF` size variable. This will automatically expand until the end of the stream has been reached and works for any field type. For example:
|
|
243
|
+
|
|
244
|
+
```python
|
|
245
|
+
from dissect.cstruct import cstruct
|
|
246
|
+
|
|
247
|
+
eof_def = """
|
|
248
|
+
struct example {
|
|
249
|
+
uint32 magic;
|
|
250
|
+
char data[EOF];
|
|
251
|
+
};
|
|
252
|
+
"""
|
|
253
|
+
|
|
254
|
+
c_eof = cstruct().load(eof_def)
|
|
255
|
+
|
|
256
|
+
example = c_eof.example(b"9\x05\x00\x00arbitrary length data")
|
|
257
|
+
assert example.magic == 1337
|
|
258
|
+
assert example.data == b"arbitrary length data"
|
|
259
|
+
```
|
|
260
|
+
|
|
241
261
|
### Custom definition parsers
|
|
242
262
|
Don't like the C-like definition syntax? Write your own syntax parser!
|
|
243
263
|
|
|
@@ -20,10 +20,10 @@ dissect/cstruct/types/pointer.py,sha256=PqeJOoNBUfMd5uO2kpF6OHeW7Q6R1N1W1V4q1Mak
|
|
|
20
20
|
dissect/cstruct/types/structure.py,sha256=FQv6x-vXm6h27FaqRBW7JKYVwtKMCg4jI4ZDIbYKEwo,33029
|
|
21
21
|
dissect/cstruct/types/void.py,sha256=Gvh0HqI6jQSj2uesdo3J8-G41brWCz8pmP16l8xTBxE,1074
|
|
22
22
|
dissect/cstruct/types/wchar.py,sha256=N9Y_XX2_hZEe2DwepJjxsB6xuRJ6zINRalcUofR59kY,2608
|
|
23
|
-
dissect_cstruct-4.8.
|
|
24
|
-
dissect_cstruct-4.8.
|
|
25
|
-
dissect_cstruct-4.8.
|
|
26
|
-
dissect_cstruct-4.8.
|
|
27
|
-
dissect_cstruct-4.8.
|
|
28
|
-
dissect_cstruct-4.8.
|
|
29
|
-
dissect_cstruct-4.8.
|
|
23
|
+
dissect_cstruct-4.8.dev4.dist-info/licenses/COPYRIGHT,sha256=H-18RXfshdH9AdHwW2eO1Xa-5s6tY5eipHh5c0whDu4,316
|
|
24
|
+
dissect_cstruct-4.8.dev4.dist-info/licenses/LICENSE,sha256=PhUqiw6jAh2KbBdVRPBq_hfAvfcTBin7nZ3CK7NQbTM,11341
|
|
25
|
+
dissect_cstruct-4.8.dev4.dist-info/METADATA,sha256=FzjujlDF19JNZjyuisVFAdif7IVKu0HJfJ3aUyNeP0I,9255
|
|
26
|
+
dissect_cstruct-4.8.dev4.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
27
|
+
dissect_cstruct-4.8.dev4.dist-info/entry_points.txt,sha256=z53zqZqwD2OLrAkRwrP4wTeiU9CQe7xrMly0T2c0_wQ,71
|
|
28
|
+
dissect_cstruct-4.8.dev4.dist-info/top_level.txt,sha256=Mn-CQzEYsAbkxrUI0TnplHuXnGVKzxpDw_po_sXpvv4,8
|
|
29
|
+
dissect_cstruct-4.8.dev4.dist-info/RECORD,,
|
|
File without changes
|
{dissect_cstruct-4.8.dev3.dist-info → dissect_cstruct-4.8.dev4.dist-info}/licenses/COPYRIGHT
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|