#!/usr/bin/env python3 """Run this on your machine: python3 diagnose_pm4n.py Dummy.pm4n""" import struct, sys path = sys.argv[1] if len(sys.argv) > 1 else 'Dummy.pm4n' data = open(path, 'rb').read() fsize = len(data) print(f"File: {path} ({fsize} bytes)") print() # Parse ANYCUBIC header magic = data[0:8] version = struct.unpack_from(' fsize: break off = struct.unpack_from('= 0 else None LAYE_HDR_SIZE2 = 0x20 ENTRY_STRIDE2 = 0x20 laye2 = find_tag2(data, b'LAYE') if laye2 is not None: n_entries2 = struct.unpack_from(' fsize: break exp = struct.unpack_from('