Files
vt1200/lat/notes/dump.py
T

15 lines
488 B
Python

#!/usr/bin/env python3
"""Dump dis34 lines in [start,end) byte offsets from the gz disassembly."""
import gzip, re, sys
path = "reference/dis34-a-v22.txt.gz"
start = int(sys.argv[1], 0); end = int(sys.argv[2], 0)
cur = None
with gzip.open(path, "rt", errors="replace") as f:
for line in f:
m = re.match(r"^([0-9a-fA-F]{8}):", line)
if m:
a = int(m.group(1), 16)
if a < start or a >= end:
continue
sys.stdout.write(line)