#!/usr/bin/env python3 """ Analyze GeViSet configuration file format """ import struct import hashlib from pathlib import Path def hex_dump(data, offset=0, length=512): """Create a hex dump of binary data""" for i in range(0, min(length, len(data)), 16): hex_str = ' '.join(f'{b:02x}' for b in data[i:i+16]) ascii_str = ''.join(chr(b) if 32 <= b < 127 else '.' for b in data[i:i+16]) print(f'{offset+i:08x} {hex_str:<48} {ascii_str}') def analyze_structure(data): """Analyze the binary structure of the .set file""" print("=" * 80) print("GEVISET FILE STRUCTURE ANALYSIS") print("=" * 80) print() # First, let's dump the beginning print("First 512 bytes (hex dump):") print("-" * 80) hex_dump(data, 0, 512) print() # Try to identify sections print("\nSearching for section markers...") print("-" * 80) pos = 0 sections = [] while pos < len(data) - 4: # Check if this looks like a length-prefixed string try: # Try reading as 2-byte length prefix if pos + 2 <= len(data): length = struct.unpack('