dissect.cstruct 4.0.dev2__tar.gz → 4.0.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_cstruct-4.0.dev2/dissect.cstruct.egg-info → dissect_cstruct-4.0.dev3}/PKG-INFO +1 -1
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/dissect/cstruct/types/structure.py +1 -1
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3/dissect.cstruct.egg-info}/PKG-INFO +1 -1
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/tests/test_types_structure.py +9 -1
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/COPYRIGHT +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/LICENSE +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/MANIFEST.in +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/README.md +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/dissect/cstruct/__init__.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/dissect/cstruct/bitbuffer.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/dissect/cstruct/compiler.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/dissect/cstruct/cstruct.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/dissect/cstruct/exceptions.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/dissect/cstruct/expression.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/dissect/cstruct/parser.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/dissect/cstruct/types/__init__.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/dissect/cstruct/types/base.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/dissect/cstruct/types/char.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/dissect/cstruct/types/enum.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/dissect/cstruct/types/flag.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/dissect/cstruct/types/int.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/dissect/cstruct/types/leb128.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/dissect/cstruct/types/packed.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/dissect/cstruct/types/pointer.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/dissect/cstruct/types/void.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/dissect/cstruct/types/wchar.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/dissect/cstruct/utils.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/dissect.cstruct.egg-info/SOURCES.txt +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/dissect.cstruct.egg-info/dependency_links.txt +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/dissect.cstruct.egg-info/top_level.txt +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/examples/disk.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/examples/mirai.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/examples/pe.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/examples/protobuf.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/examples/secdesc.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/pyproject.toml +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/setup.cfg +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/tests/__init__.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/tests/conftest.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/tests/data/testdef.txt +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/tests/docs/Makefile +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/tests/docs/conf.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/tests/docs/index.rst +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/tests/test_align.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/tests/test_basic.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/tests/test_bitbuffer.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/tests/test_bitfield.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/tests/test_compiler.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/tests/test_ctypes.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/tests/test_expression.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/tests/test_parser.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/tests/test_types_base.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/tests/test_types_char.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/tests/test_types_custom.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/tests/test_types_enum.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/tests/test_types_flag.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/tests/test_types_int.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/tests/test_types_leb128.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/tests/test_types_packed.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/tests/test_types_pointer.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/tests/test_types_union.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/tests/test_types_void.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/tests/test_types_wchar.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/tests/test_utils.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/tests/utils.py +0 -0
- {dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/tox.ini +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: dissect.cstruct
|
|
3
|
-
Version: 4.0.
|
|
3
|
+
Version: 4.0.dev3
|
|
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: Apache License 2.0
|
|
@@ -49,7 +49,7 @@ class StructureMetaType(MetaType):
|
|
|
49
49
|
|
|
50
50
|
def __new__(metacls, name: str, bases: tuple[type, ...], classdict: dict[str, Any]) -> MetaType:
|
|
51
51
|
if (fields := classdict.pop("fields", None)) is not None:
|
|
52
|
-
metacls._update_fields(metacls, fields, align=classdict.get("
|
|
52
|
+
metacls._update_fields(metacls, fields, align=classdict.get("__align__", False), classdict=classdict)
|
|
53
53
|
|
|
54
54
|
return super().__new__(metacls, name, bases, classdict)
|
|
55
55
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: dissect.cstruct
|
|
3
|
-
Version: 4.0.
|
|
3
|
+
Version: 4.0.dev3
|
|
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: Apache License 2.0
|
|
@@ -9,7 +9,7 @@ from dissect.cstruct.cstruct import cstruct
|
|
|
9
9
|
from dissect.cstruct.exceptions import ParserError
|
|
10
10
|
from dissect.cstruct.types.base import Array, BaseType
|
|
11
11
|
from dissect.cstruct.types.pointer import Pointer
|
|
12
|
-
from dissect.cstruct.types.structure import Field, Structure
|
|
12
|
+
from dissect.cstruct.types.structure import Field, Structure, StructureMetaType
|
|
13
13
|
|
|
14
14
|
from .utils import verify_compiled
|
|
15
15
|
|
|
@@ -529,3 +529,11 @@ def test_structure_definition_self(cs: cstruct) -> None:
|
|
|
529
529
|
|
|
530
530
|
assert issubclass(cs.test.fields["b"].type, Pointer)
|
|
531
531
|
assert cs.test.fields["b"].type.type is cs.test
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
def test_align_struct_in_struct(cs: cstruct) -> None:
|
|
535
|
+
with patch.object(StructureMetaType, "_update_fields") as update_fields:
|
|
536
|
+
cs._make_struct("test", [Field("a", cs.uint64)], align=True)
|
|
537
|
+
|
|
538
|
+
_, kwargs = update_fields.call_args
|
|
539
|
+
assert kwargs["align"]
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/dissect.cstruct.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{dissect_cstruct-4.0.dev2 → dissect_cstruct-4.0.dev3}/dissect.cstruct.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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|