Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions src/thrember/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down