Skip to content

Commit

Permalink
address review comments: rename SampleHashes's from_sample() method t…
Browse files Browse the repository at this point in the history
…o from_bytes() method
  • Loading branch information
yelhamer committed Jul 20, 2023
1 parent ab092cb commit 6ee1dfd
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion capa/features/extractors/binja/extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(self, bv: binja.BinaryView):
self.global_features.extend(capa.features.extractors.binja.file.extract_file_format(self.bv))
self.global_features.extend(capa.features.extractors.binja.global_.extract_os(self.bv))
self.global_features.extend(capa.features.extractors.binja.global_.extract_arch(self.bv))
self.sample_hashes = SampleHashes.from_sample(Path(self.bv.name).read_bytes())
self.sample_hashes = SampleHashes.from_bytes(Path(self.bv.name).read_bytes())

def get_base_address(self):
return AbsoluteVirtualAddress(self.bv.start)
Expand Down
2 changes: 1 addition & 1 deletion capa/features/extractors/dnfile/extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class DnfileFeatureExtractor(StaticFeatureExtractor):
def __init__(self, path: Path):
super().__init__()
self.pe: dnfile.dnPE = dnfile.dnPE(str(path))
self.sample_hashes = SampleHashes.from_sample(path.read_bytes())
self.sample_hashes = SampleHashes.from_bytes(path.read_bytes())

# pre-compute .NET token lookup tables; each .NET method has access to this cache for feature extraction
# most relevant at instruction scope
Expand Down
2 changes: 1 addition & 1 deletion capa/features/extractors/ida/extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(self):
self.global_features.extend(capa.features.extractors.ida.file.extract_file_format())
self.global_features.extend(capa.features.extractors.ida.global_.extract_os())
self.global_features.extend(capa.features.extractors.ida.global_.extract_arch())
self.sample_hashes = SampleHashes.from_sample(Path(idaapi.get_input_file_path()).read_bytes())
self.sample_hashes = SampleHashes.from_bytes(Path(idaapi.get_input_file_path()).read_bytes())

def get_base_address(self):
return AbsoluteVirtualAddress(idaapi.get_imagebase())
Expand Down
2 changes: 1 addition & 1 deletion capa/features/extractors/viv/extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(self, vw, path: Path, os):
self.vw = vw
self.path = path
self.buf = path.read_bytes()
self.sample_hashes = SampleHashes.from_sample(self.buf)
self.sample_hashes = SampleHashes.from_bytes(self.buf)

# pre-compute these because we'll yield them at *every* scope.
self.global_features: List[Tuple[Feature, Address]] = []
Expand Down

0 comments on commit 6ee1dfd

Please sign in to comment.