Skip to content

Instantly share code, notes, and snippets.

@sidgwick
Created July 8, 2025 13:59
Show Gist options
  • Select an option

  • Save sidgwick/84062ac2d65a46ade20bb76a26dad3ed to your computer and use it in GitHub Desktop.

Select an option

Save sidgwick/84062ac2d65a46ade20bb76a26dad3ed to your computer and use it in GitHub Desktop.
objdump 反汇编某个函数
#!/usr/bin/env bash
#author: song
routine=$1
func=$2
if [ -z "$routine" ]; then
exit
fi
address=$(nm -n $routine | grep -A1 "\w\s$func" | cut -d' ' -f1)
start=$(echo $address | cut -d' ' -f1)
end=$(echo $address | cut -d' ' -f2)
if [ -z "$func" ]; then
objdump -d $routine
else
echo "address: 0x${start} ~ 0x${end}"
objdump -d $routine --start-address="0x${start}" --stop-address="0x${end}"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment