Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Extract the items contained in a Marmoset Viewer's .mview archive file
import struct
import os
# Parameter
archive = "vivfox.mview"
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
# Create the output directory
directory = os.path.splitext(archive)[0]
if not os.path.exists(directory):
with open(archive, 'rb') as f:
end = getFileSize(f)
while True:
name = readCString(f)
mime = readCString(f)
compressed, size, rawSize = struct.unpack("III",*4))
if compressed:
name += ".compressed"
name = os.path.join(directory, name)
with open(name, 'wb') as outf:
if f.tell() >= end:
You can’t perform that action at this time.