diff --git a/mat2 b/mat2 index 0bf8dfc09b3d21dc31537651f0aeb558d54a7be4..b54779bad948bb3cfd1c62a93b89e125b0b392fc 100755 --- a/mat2 +++ b/mat2 @@ -67,29 +67,11 @@ def show_meta(filename: str): return print("[+] Metadata for %s:" % filename) - metadata = p.get_meta().items() - if not metadata: - print(" No metadata found") - return - - for k, v in metadata: - zipmeta = v - zipmeta_name = v + for k, v in p.get_meta().items(): try: # FIXME this is ugly. - if not isinstance(zipmeta, dict): - print(" %s: %s" % (k, v)) + print(" %s: %s" % (k, v)) except UnicodeEncodeError: - print(" %s: harmful content" % zipmeta_name) - if mtype == "application/zip": - print("[+] Metadata for files inside the archive :") - if isinstance(zipmeta, dict): - for name, metas in zipmeta.items(): - try: # FIXME this is ugly. - print(" %s" % name) - for meta_name, meta in metas.items(): - print(" %s: %s" % (meta_name, meta)) - except UnicodeEncodeError: - print(" %s: harmful content" % zipmeta_name) + print(" %s: harmful content" % k) def clean_meta(filename: str, is_lightweight: bool, policy: UnknownMemberPolicy) -> bool: if not __check_file(filename, os.R_OK|os.W_OK):