def __call__(self, binary):
libraries = [l.lower() for l in binary.libraries]
# we'll create a string like "kernel32.dll:CreateFileMappingA" for each entry
imports = [lib.name.lower() + ':' +
e.name for lib in binary.imports for e in lib.entries]
# two separate elements: libraries (alone) and fully-qualified names of imported functions
return np.concatenate([
FeatureHasher(256, input_type="string", dtype=self.dtype).transform(
[libraries]).toarray(),
FeatureHasher(1024, input_type="string", dtype=self.dtype).transform(
[imports]).toarray()
], axis=-1).flatten().astype(self.dtype)
评论列表
文章目录