From 0ff22d319fb58d624367f05ddb32a4c92dfc4c91 Mon Sep 17 00:00:00 2001 From: Pratham Chauhan Date: Fri, 24 Mar 2023 01:22:29 +0530 Subject: [PATCH] fix --- capa/main.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/capa/main.py b/capa/main.py index 338a3f34..1463c6e2 100644 --- a/capa/main.py +++ b/capa/main.py @@ -1126,8 +1126,7 @@ def main(argv=None): return E_FILE_LIMITATION if format_ == FORMAT_RESULT: with open(args.sample, "rb") as f: - buf = f.read() - print(buf) + buf = f.read() elif format_ == FORMAT_FREEZE: with open(args.sample, "rb") as f: extractor = capa.features.freeze.load(f.read()) @@ -1165,11 +1164,11 @@ def main(argv=None): meta["analysis"].update(counts) meta["analysis"]["layout"] = compute_layout(rules, extractor, capabilities) - if has_file_limitation(rules, capabilities): - # bail if capa encountered file limitation e.g. a packed binary - # do show the output in verbose mode, though. - if not (args.verbose or args.vverbose or args.json): - return E_FILE_LIMITATION + if has_file_limitation(rules, capabilities): + # bail if capa encountered file limitation e.g. a packed binary + # do show the output in verbose mode, though. + if not (args.verbose or args.vverbose or args.json): + return E_FILE_LIMITATION if args.json: print(capa.render.json.render(meta, rules, capabilities))