boot3/IDA/cutter.py
Elliot Nunn 7a833cffa1 Use IDA to explore new code
This commit includes both the means to graft an IDA disassembly onto
Boot3.a, and the results of that disassembly.
2018-04-07 11:27:01 +08:00

26 lines
409 B
Python
Executable File

#!/usr/bin/env python3
CI, CO = b'RESUME', b'YIELD'
from sys import argv, stdout
a, b = argv[1:]
with open(a, 'rb') as a, open(b, 'rb') as b:
which = False
ibins = [a, b]
try:
while True:
l = next(ibins[which])
stdout.buffer.write(l)
if CO in l:
which = not which
for cil in ibins[which]:
if CI in cil:
stdout.buffer.write(cil)
break
except StopIteration:
pass