Merge pull request #618 from fireeye/fix/616

fix 616
This commit is contained in:
Moritz
2021-06-09 10:00:04 +02:00
committed by GitHub
3 changed files with 6 additions and 2 deletions

View File

@@ -107,6 +107,7 @@ It includes many new rules, including all new techniques introduced in MITRE ATT
- build: use Python 3.8 for PyInstaller to support consistently running across multiple operating systems including Windows 7 #505 @mr-tz
- main: correctly match BB-scope matches at file scope #605 @williballenthin
- explorer: add support for function-name feature #618 @mike-hunhoff
### Changes

View File

@@ -33,3 +33,6 @@ class FunctionName(Feature):
def __init__(self, name, description=None):
# value is function name
super(FunctionName, self).__init__(name, description=description)
# override the name property set by `capa.features.Feature`
# that would be `functionname` (note missing dash)
self.name = "function-name"

View File

@@ -593,9 +593,9 @@ class CapaExplorerDataModel(QtCore.QAbstractItemModel):
parent, display, location, '"%s"' % capa.features.escape_string(feature[feature["type"]])
)
if feature["type"] in ("import", "export"):
if feature["type"] in ("import", "export", "function-name"):
# display no preview
return CapaExplorerFeatureItem(parent, display=display)
return CapaExplorerFeatureItem(parent, location=location, display=display)
raise RuntimeError("unexpected feature type: " + str(feature["type"]))