Skip to content

Instantly share code, notes, and snippets.

@timb-machine
Last active August 30, 2025 16:59
Show Gist options
  • Save timb-machine/ef386b79e4d4711ef8ecef335f09b28f to your computer and use it in GitHub Desktop.
Save timb-machine/ef386b79e4d4711ef8ecef335f09b28f to your computer and use it in GitHub Desktop.
grace.sh
#!/bin/sh
BINFILENAME="${1}"
tempfilename="`tempfile`"
echo "set pagination off" > "${tempfilename}"
# | grep ":$" | grep -v "\." | cut -f 2 -d "<" | cut -f 1 -d ">" | cut -f 1 -d "@"
# | grep "@plt" | cut -f 2 -d "&lt;" | cut -f 1 -d "@"
objdump -D "${BINFILENAME}" | grep ":$" | grep -v "\." | cut -f 2 -d "<" | cut -f 1 -d ">" | cut -f 1 -d "@" | sort | uniq | while read line^M
do
echo "break ${line}" >> "${tempfilename}"
echo "commands" >> "${tempfilename}"
echo "continue" >> "${tempfilename}"
echo "end" ?? "${tempfilename}"
done
echo "run" >> "${tempfilename}"
gdb -x "${tempfilename}" "${BINFILENAME}"
rm "${tempfilename}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment