Skip to content

Commit

Permalink
Compatibility with cstruct v4 (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
Schamper authored Jun 4, 2024
1 parent a6acca2 commit 21242af
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
11 changes: 3 additions & 8 deletions dissect/executable/elf/c_elf.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,14 +401,9 @@ def copy_cstruct(src_struct: cstruct) -> cstruct:
return dst_struct


c_common_elf = cstruct()
c_common_elf.load(elf_def)

c_elf_32 = copy_cstruct(c_common_elf)
c_elf_32.load(elf_32_def)

c_elf_64 = copy_cstruct(c_common_elf)
c_elf_64.load(elf_64_def)
c_common_elf = cstruct().load(elf_def)
c_elf_32 = copy_cstruct(c_common_elf).load(elf_32_def)
c_elf_64 = copy_cstruct(c_common_elf).load(elf_64_def)

PT: IntEnum = c_common_elf.PT
Elf_Type: IntEnum = c_common_elf.Elf_Type
Expand Down
10 changes: 8 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ classifiers = [
"Topic :: Utilities",
]
dependencies = [
"dissect.cstruct>=3.0.dev,<4.0.dev",
"dissect.util>=3.0.dev,<4.0.dev",
"dissect.cstruct>=4.dev,<5",
"dissect.util>=3,<4",
]
dynamic = ["version"]

Expand All @@ -35,6 +35,12 @@ homepage = "https://dissect.tools"
documentation = "https://docs.dissect.tools/en/latest/projects/dissect.executable"
repository = "https://github.com/fox-it/dissect.executable"

[project.optional-dependencies]
dev = [
"dissect.cstruct>=4.0.dev,<5.0.dev",
"dissect.util>=3.0.dev,<4.0.dev",
]

[tool.black]
line-length = 120

Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ minversion = 4.4.3
requires = virtualenv>=20.16.6

[testenv]
extras = dev
deps =
pytest
pytest-cov
Expand Down

0 comments on commit 21242af

Please sign in to comment.