We'll use the following steps to gather important information about the binary.
- In a Terminal session, type the following and study the output:
$ file ch04-example
- In the same Terminal session, type the following and review the output. Do you notice anything in particular in the output?
$ strings ch04-example
- When you have finished reviewing the output, type the following in the same Terminal session and review the output:
$ readelf -h ch04-example
- Next, type the following in the same Terminal session and examine the output:
$ readelf -l -W ch04-example
- In the same Terminal session, type the following and review the resulting output:
$ readelf -S -W ch04-example
- When ready, type the following in the same Terminal session and study the output:
$ readelf -s -W ch04-example
- Next, type the following in the open Terminal session and go over the output to see if you find anything interesting:
$ readelf -p .text -W ch04-example
- When you have finished studying the output, type the following, making sure to review the output for anything interesting:
$ readelf -x .text -W ch04-example
- Next, type the following into the open Terminal session. Review the output for anything interesting:
$ readelf -R .text -W ch04-example
- In the same Terminal session, type the following and study the output for any interesting information:
$ readelf -p .strtab -W ch04-example
- Type the following in an open Terminal session and review the output:
$ objdump -f ch04-example
- Next, type the following in the same Terminal session:
$ objdump -j .text -s ch04-example
- When ready, type the following in the running Terminal session and examine the output:
$ objdump -x ch04-example
- Next, type the following in the same Terminal session and review the output:
$ ldd -v ch04-example
- Finally, type the following and review the output for any interesting information:
$ hexdump -C ch04-example | less