Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
List the items contained in a Marmoset Viewer's .mview archive file
import struct
def readCString(f):
"""This is the most naive implementation possible, don't use in prod"""
str = ""
c =
while c != '\0':
str += c
c =
return str
def getFileSize(f):
pos = f.tell(), 2)
end = f.tell(), 0)
return end
with open("vivfox.mview", 'rb') as f:
end = getFileSize(f)
fmt = "{:<18} {:<18} {:>10} {:>10} {:>10}" # Output table format
print(fmt.format("Name", "MIME type", "Compressed", "Size", "Raw size"))
while True:
name = readCString(f)
mime = readCString(f)
compressed, size, rawSize = struct.unpack("III",*4))
print(fmt.format(name, mime, str(bool(compressed & 1)), hex(size), hex(rawSize)))
if f.tell() + size >= end:
break, 1) # move forward by "size" bytes in the file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.