Skip to content
This repository was archived by the owner on Nov 20, 2025. It is now read-only.

Commit 69b296e

Browse files
authored
Compatibility with cstruct v4 (#37)
1 parent b28a604 commit 69b296e

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

dissect/esedb/c_esedb.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
from collections import namedtuple
55
from typing import Union
66

7-
from dissect import cstruct
7+
from dissect.cstruct import cstruct
88

99
# https://github.com/microsoft/Extensible-Storage-Engine
10-
c_esedb_def = """
10+
esedb_def = """
1111
#define MAX_COMPUTERNAME_LENGTH 15
1212
1313
typedef int64 DBTIME;
@@ -427,8 +427,7 @@
427427
};
428428
""" # noqa E501
429429

430-
c_esedb = cstruct.cstruct()
431-
c_esedb.load(c_esedb_def)
430+
c_esedb = cstruct().load(esedb_def)
432431

433432
ulDAEMagic = 0x89ABCDEF
434433
pgnoFDPMSO = 4

pyproject.toml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ classifiers = [
2525
"Topic :: Utilities",
2626
]
2727
dependencies = [
28-
"dissect.cstruct>=3.4.dev,<4.0.dev",
29-
"dissect.util>=3.5.dev,<4.0.dev",
28+
"dissect.cstruct>=4.dev,<5",
29+
"dissect.util>=3.5,<4",
3030
]
3131
dynamic = ["version"]
3232

@@ -35,6 +35,12 @@ homepage = "https://dissect.tools"
3535
documentation = "https://docs.dissect.tools/en/latest/projects/dissect.esedb"
3636
repository = "https://github.com/fox-it/dissect.esedb"
3737

38+
[project.optional-dependencies]
39+
dev = [
40+
"dissect.cstruct>=4.0.dev,<5.0.dev",
41+
"dissect.util>=3.5.dev,<4.0.dev",
42+
]
43+
3844
[tool.black]
3945
line-length = 120
4046

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ minversion = 4.4.3
1111
requires = virtualenv>=20.16.6
1212

1313
[testenv]
14+
extras = dev
1415
deps =
1516
pytest
1617
pytest-cov

0 commit comments

Comments
 (0)