Last active
February 3, 2016 19:19
-
-
Save scottt/067bc8859b6aac13c8e1 to your computer and use it in GitHub Desktop.
This file contains 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
file s | |
set disable-randomization on | |
set disassemble-next-line on | |
# break on call 'swap@plt' in main | |
break *0x0804857c | |
break 'swap@plt' | |
run | |
si | |
disassemble 'swap@plt' | |
printf "\n\ninfo symbol 0x804a014: " | |
info symbol 0x804a014 | |
# swap's entry in s's got.plt | |
# should point to <swap@plt+6>, i.e. the push instruction in swap@plt | |
x/a 0x804a014 | |
si | |
si | |
si | |
printf "\n\ns's plt[0]\n" | |
x/4i 0x8048430 | |
printf "\n\ns's [email protected]\nshould point to <swap@plt+6>, i.e. the push instruction in swap@plt\n" | |
x/a 0x804a014 | |
printf "\n\ns's got.plt[2]\ninfo symbol 0x804a008: " | |
info symbol 0x804a008 | |
x/a 0x804a008 | |
info symbol 0xf7ff08c0 | |
printf "\n\nLet the dynamic linker resolve swap()\n" | |
finish | |
printf "\n\ns's [email protected]\nshould point to swap() in swap.so\n" | |
x/a 0x804a014 | |
info addr swap | |
quit | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment