diff --git a/pyproject.toml b/pyproject.toml index a2044a6..d5dd00e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ dependencies = [ "polars>=1.8.2", "scikit-learn>=1.5.1", "tqdm>=4.66.5", - "signify>=0.7.1", + "signify>=0.9.1", "huggingface_hub>=0.32.4", "matplotlib>=3.10.3", "lightgbm>=4.6.0", diff --git a/src/thrember/features.py b/src/thrember/features.py index fbfc8c6..8cea30b 100644 --- a/src/thrember/features.py +++ b/src/thrember/features.py @@ -25,7 +25,7 @@ import pefile from sklearn.feature_extraction import FeatureHasher import signify -from signify.authenticode import SignedPEFile +from signify.authenticode.signed_file import SignedPEFile from datetime import datetime @@ -114,7 +114,7 @@ def __init__(self): def raw_features(self, bytez, pe): counts = np.bincount(np.frombuffer(bytez, dtype=np.uint8), minlength=256) return counts.tolist() - + def process_raw_features(self, raw_obj): counts = np.array(raw_obj, dtype=np.float32) sum = counts.sum() @@ -932,7 +932,7 @@ def raw_features(self, bytez, pe): } try: signed_pe = SignedPEFile(io.BytesIO(bytez)) - for signed_data in signed_pe.iter_signed_datas(): + for signed_data in signed_pe.iter_embedded_signatures(): raw_obj["num_certs"] += 1 if signed_data.signer_info.program_name is None: raw_obj["empty_program_name"] = 1 @@ -997,7 +997,7 @@ def __init__(self, warnings_file: Path): self.warning_prefixes = set() self.warning_suffixes = set() self.warning_ids = {} - + if isinstance(warnings_file, Path) and warnings_file.exists(): with open(warnings_file, "r") as f: i = 0