lint: show mod/imp names per rule

fix bug where the same mod/imp name pair was shown for all rules
This commit is contained in:
William Ballenthin
2021-08-25 16:36:08 -06:00
parent fd7cff6109
commit 0569f9b242

View File

@@ -353,7 +353,7 @@ class FeatureNegativeNumber(Lint):
class FeatureNtdllNtoskrnlApi(Lint):
name = "feature api may overlap with ntdll and ntoskrnl"
level = Lint.WARN
recommendation = (
recommendation_template = (
"check if {:s} is exported by both ntdll and ntoskrnl; if true, consider removing {:s} "
"module requirement to improve detection"
)
@@ -363,7 +363,7 @@ class FeatureNtdllNtoskrnlApi(Lint):
if isinstance(feature, capa.features.insn.API):
modname, _, impname = feature.value.rpartition(".")
if modname in ("ntdll", "ntoskrnl"):
self.recommendation = self.recommendation.format(impname, modname)
self.recommendation = self.recommendation_template.format(impname, modname)
return True
return False