feature extractor: null: add get_base_address()

closes #88
This commit is contained in:
William Ballenthin
2020-07-03 09:32:37 -06:00
parent 0f8267e970
commit 5317e1e11e
2 changed files with 5 additions and 0 deletions

View File

@@ -180,6 +180,7 @@ class NullFeatureExtractor(FeatureExtractor):
example::
extractor = NullFeatureExtractor({
'base address: 0x401000,
'file features': [
(0x402345, capa.features.Characteristic('embedded pe')),
],
@@ -214,6 +215,9 @@ class NullFeatureExtractor(FeatureExtractor):
super(NullFeatureExtractor, self).__init__()
self.features = features
def get_base_address(self):
return self.features["base address"]
def extract_file_features(self):
for p in self.features.get("file features", []):
va, feature = p

View File

@@ -10,6 +10,7 @@ from fixtures import *
EXTRACTOR = capa.features.extractors.NullFeatureExtractor(
{
"base address": 0x401000,
"file features": [(0x402345, capa.features.Characteristic("embedded pe")),],
"functions": {
0x401000: {