mirror of
https://github.com/mandiant/capa.git
synced 2025-12-21 23:00:29 -08:00
main: don't leave behind traces of the progress bar
This commit is contained in:
@@ -46,6 +46,7 @@
|
|||||||
- Add logging and print redirect to tqdm for capa main [#749](https://github.com/mandiant/capa/issues/749) [@Aayush-Goel-04](https://github.com/aayush-goel-04)
|
- Add logging and print redirect to tqdm for capa main [#749](https://github.com/mandiant/capa/issues/749) [@Aayush-Goel-04](https://github.com/aayush-goel-04)
|
||||||
- extractor: fix binja installation path detection does not work with Python 3.11
|
- extractor: fix binja installation path detection does not work with Python 3.11
|
||||||
- tests: refine the IDA test runner script #1513 @williballenthin
|
- tests: refine the IDA test runner script #1513 @williballenthin
|
||||||
|
- output: don't leave behind traces of progress bar @williballenthin
|
||||||
|
|
||||||
### capa explorer IDA Pro plugin
|
### capa explorer IDA Pro plugin
|
||||||
|
|
||||||
|
|||||||
@@ -262,7 +262,7 @@ def find_capabilities(ruleset: RuleSet, extractor: FeatureExtractor, disable_pro
|
|||||||
functions = list(extractor.get_functions())
|
functions = list(extractor.get_functions())
|
||||||
n_funcs = len(functions)
|
n_funcs = len(functions)
|
||||||
|
|
||||||
pb = pbar(functions, desc="matching", unit=" functions", postfix="skipped 0 library functions")
|
pb = pbar(functions, desc="matching", unit=" functions", postfix="skipped 0 library functions", leave=False)
|
||||||
for f in pb:
|
for f in pb:
|
||||||
if extractor.is_library_function(f.address):
|
if extractor.is_library_function(f.address):
|
||||||
function_name = extractor.get_function_name(f.address)
|
function_name = extractor.get_function_name(f.address)
|
||||||
|
|||||||
@@ -873,7 +873,7 @@ def lint(ctx: Context):
|
|||||||
ret = {}
|
ret = {}
|
||||||
|
|
||||||
source_rules = [rule for rule in ctx.rules.rules.values() if not rule.is_subscope_rule()]
|
source_rules = [rule for rule in ctx.rules.rules.values() if not rule.is_subscope_rule()]
|
||||||
with tqdm.contrib.logging.tqdm_logging_redirect(source_rules, unit="rule") as pbar:
|
with tqdm.contrib.logging.tqdm_logging_redirect(source_rules, unit="rule", leave=False) as pbar:
|
||||||
with capa.helpers.redirecting_print_to_tqdm(False):
|
with capa.helpers.redirecting_print_to_tqdm(False):
|
||||||
for rule in pbar:
|
for rule in pbar:
|
||||||
name = rule.name
|
name = rule.name
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ def main(argv=None):
|
|||||||
args.sample, args.format, args.os, capa.main.BACKEND_VIV, sig_paths, should_save_workspace=False
|
args.sample, args.format, args.os, capa.main.BACKEND_VIV, sig_paths, should_save_workspace=False
|
||||||
)
|
)
|
||||||
|
|
||||||
with tqdm.tqdm(total=args.number * args.repeat) as pbar:
|
with tqdm.tqdm(total=args.number * args.repeat, leave=False) as pbar:
|
||||||
|
|
||||||
def do_iteration():
|
def do_iteration():
|
||||||
capa.perf.reset()
|
capa.perf.reset()
|
||||||
|
|||||||
Reference in New Issue
Block a user