"""Print raw body hex + byte-distribution stats for one event.""" from collections import Counter import sys sys.path.insert(0, ".") from analysis.load_bundle import load_bundle def main(): for name in ("event-a", "event-b", "event-c", "event-d"): b = load_bundle(name) body = b.body print(f"\n=== {name} ({len(body)} body bytes) ===") print(f" STRT: {b.strt.hex()}") print(f" body[0:64]: {body[:64].hex()}") print(f" body[64:128]: {body[64:128].hex()}") print(f" body[-32:]: {body[-32:].hex()}") cnt = Counter(body) print(f" top 16 bytes: {[(f'0x{k:02x}', f'{v/len(body):.2%}') for k,v in cnt.most_common(16)]}") if __name__ == "__main__": main()