Skip to content
Snippets Groups Projects

Add ZIP archives support

Closed Simon Magnin requested to merge smagnin/mat2:archive into master
2 unresolved threads
+ 3
21
@@ -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):
Loading