mirror of
https://github.com/mandiant/capa.git
synced 2025-12-23 07:28:34 -08:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user