From 8b4d5d3d22fb2a9785a8580f9e8fb80f59feac71 Mon Sep 17 00:00:00 2001 From: Willi Ballenthin Date: Tue, 22 Oct 2024 09:21:40 +0000 Subject: [PATCH] mute unknown lines --- capa/analysis/libraries.py | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/capa/analysis/libraries.py b/capa/analysis/libraries.py index cadee769..121b3668 100644 --- a/capa/analysis/libraries.py +++ b/capa/analysis/libraries.py @@ -204,27 +204,19 @@ def main(argv=None): for va, classifications in classifications_by_va.items(): name = ", ".join({c.name for c in classifications}) if "sub_" in name: - name = Text(name, style="grey37") + name = Text(name, style="grey53") - if classifications: - classification = {c.classification for c in classifications} - method = {c.method for c in classifications if c.method} - extra = {f"{c.library_name}@{c.library_version}" for c in classifications if c.library_name} + classification = {c.classification for c in classifications} + method = {c.method for c in classifications if c.method} + extra = {f"{c.library_name}@{c.library_version}" for c in classifications if c.library_name} - table.add_row( - hex(va), - ", ".join(classification), - ", ".join(method), - name, - ", ".join(extra), - ) - else: - table.add_row( - hex(va), - Text("unknown", style="grey37"), - "", - name, - ) + table.add_row( + hex(va), + ", ".join(classification) if classification != {"unknown"} else Text("unknown", style="grey53"), + ", ".join(method), + name, + ", ".join(extra), + ) rich.print(table)