Created
July 8, 2025 13:59
-
-
Save sidgwick/84062ac2d65a46ade20bb76a26dad3ed to your computer and use it in GitHub Desktop.
objdump 反汇编某个函数
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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