mirror of
https://github.com/mandiant/capa.git
synced 2025-12-12 15:49:46 -08:00
dynamic: fix tests
This commit is contained in:
@@ -658,7 +658,6 @@ def main(argv=None):
|
||||
parser.add_argument("output", type=str, help="Path to output file")
|
||||
args = parser.parse_args(args=argv)
|
||||
capa.main.handle_common_args(args)
|
||||
capa.main.handle_signatures_arg(args)
|
||||
|
||||
sigpaths = capa.main.get_signatures(args.signatures)
|
||||
|
||||
|
||||
@@ -80,7 +80,6 @@ from capa.features.common import (
|
||||
FORMAT_DOTNET,
|
||||
FORMAT_FREEZE,
|
||||
FORMAT_RESULT,
|
||||
DYNAMIC_FORMATS,
|
||||
)
|
||||
from capa.features.address import NO_ADDRESS, Address
|
||||
from capa.features.extractors.base_extractor import (
|
||||
@@ -1360,8 +1359,6 @@ def handle_common_args(args):
|
||||
|
||||
args.rules = rules_paths
|
||||
|
||||
|
||||
def handle_signatures_arg(args):
|
||||
if hasattr(args, "signatures"):
|
||||
if args.signatures == SIGNATURES_PATH_DEFAULT_STRING:
|
||||
logger.debug("-" * 80)
|
||||
@@ -1556,9 +1553,6 @@ def main(argv: Optional[List[str]] = None):
|
||||
# and use those for extracting.
|
||||
|
||||
try:
|
||||
if format_ not in DYNAMIC_FORMATS:
|
||||
# signatures are loaded only for static anaylsis
|
||||
handle_signatures_arg(args)
|
||||
if format_ == FORMAT_PE:
|
||||
sig_paths = get_signatures(args.signatures)
|
||||
else:
|
||||
|
||||
@@ -379,13 +379,13 @@ def render_rules(ostream, doc: rd.ResultDocument):
|
||||
ostream.write(" @ ")
|
||||
ostream.write(capa.render.verbose.format_address(location))
|
||||
|
||||
if capa.rules.Scope.BASIC_BLOCK in rule.meta.scopes:
|
||||
if doc.meta.flavor == rd.Flavor.STATIC and rule.meta.scopes.static == capa.rules.Scope.BASIC_BLOCK:
|
||||
ostream.write(
|
||||
" in function "
|
||||
+ capa.render.verbose.format_address(frz.Address.from_capa(functions_by_bb[location.to_capa()]))
|
||||
)
|
||||
|
||||
if capa.rules.Scope.THREAD in rule.meta.scopes:
|
||||
if doc.meta.flavor == rd.Flavor.DYNAMIC and rule.meta.scopes.dynamic == capa.rules.Scope.THREAD:
|
||||
ostream.write(
|
||||
" in process "
|
||||
+ capa.render.verbose.format_address(
|
||||
|
||||
Reference in New Issue
Block a user