"""Offline candidates for a caller-selected 32-bit code displacement. Results are byte matches, not proven instructions; disassemble their bounded functions before making any call or interpretation. """ import argparse import struct from pathlib import Path p = argparse.ArgumentParser(description=__doc__) p.add_argument('--binary', type=Path, required=True) p.add_argument('--value', type=lambda s: int(s, 0), required=True) a = p.parse_args() b = a.binary.read_bytes() pe = struct.unpack_from('= 128: raise SystemExit('Candidate bound reached') pos += 1 print('candidates', found)