Files
nunuhara_xsystem4/rtt.sh
T
Nunuhara Cabbage 8b77cff70a Add aincmp tool
Tool for comparing ain files. This is used by the script rtt.sh to
ensure that disassembling and then reassembling an ain file produces an
equivalent result.
2020-05-17 17:39:08 -07:00

15 lines
298 B
Bash
Executable File

#!/bin/bash
SRC_AIN="$1"
SRC_JAM=$(tempfile)
DST_AIN=$(tempfile)
echo "Dumping code from $SRC_AIN"
aindump -c -o "$SRC_JAM" "$SRC_AIN"
echo "Assembling dumped code"
ainedit -c "$SRC_JAM" -o "$DST_AIN" "$SRC_AIN"
echo "Comparing AIN files"
aincmp "$SRC_AIN" "$DST_AIN"
rm "$SRC_JAM"
rm "$DST_AIN"