diff --git a/dissect/shellitem/lnk/c_lnk.py b/dissect/shellitem/lnk/c_lnk.py index 93ca4eb..f9ab57d 100644 --- a/dissect/shellitem/lnk/c_lnk.py +++ b/dissect/shellitem/lnk/c_lnk.py @@ -1,12 +1,12 @@ from enum import IntEnum from typing import Optional -from dissect import cstruct +from dissect.cstruct import cstruct # structs are reconstructed as faithfull as possible from MS documentation # reference: https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-SHLLINK/%5bMS-SHLLINK%5d.pdf -c_lnk_def = """ +lnk_def = """ flag FILE_ATTRIBUTE : uint32 { READONLY = 0x00000001, HIDDEN = 0x00000002, @@ -297,7 +297,7 @@ typedef struct SPECIAL_FOLDER_PROPS { uint32 special_folder_id; // A 32-bit, unsigned integer that specifies the folder integer ID. - uint32 offset; // A 32-bit, unsigned integer that specifies the location of the ItemID of the first child segment of the IDList specified by SpecialFolderID. This value is the offset, in bytes, into the link target IDList. + uint32 offset; // A 32-bit, unsigned integer that specifies the location of the ItemID of the first child segment of the IDList specified by SpecialFolderID. This value is the offset, in bytes, into the link target IDList. }; typedef struct DARWIN_PROPS { @@ -389,5 +389,4 @@ def _has_value(cls, value: int) -> bool: JUMPLIST_HEADER_SIZE = 0x24 JUMPLIST_FOOTER = 0xBABFFBAB -c_lnk = cstruct.cstruct() -c_lnk.load(c_lnk_def) +c_lnk = cstruct().load(lnk_def) diff --git a/pyproject.toml b/pyproject.toml index 7c20d13..8a1195c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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>3,<5", + "dissect.util>2,<4", ] dynamic = ["version"] diff --git a/tox.ini b/tox.ini index 67e8e8a..badc32c 100644 --- a/tox.ini +++ b/tox.ini @@ -15,6 +15,13 @@ deps = pytest pytest-cov coverage +# Unfortunately, tox does not allow separate installation flags for the project +# dependencies and the test dependencies. When running tox, we want to install the +# project dependencies with the --pre flag, so that we get the latest version of all +# dependencies. We do the installation step ourselves for this reason. +skip_install = true +commands_pre = + pip install --pre -e . commands = pytest --basetemp="{envtmpdir}" {posargs:--color=yes --cov=dissect --cov-report=term-missing -v tests} coverage report