How to do it...

We'll use the following steps to gather important information about the binary.

  1. In a Terminal session, type the following and study the output:
$ file ch04-example
  1. In the same Terminal session, type the following and review the output. Do you notice anything in particular in the output?
$ strings ch04-example
  1. When you have finished reviewing the output, type the following in the same Terminal session and review the output:
$ readelf -h ch04-example
  1. Next, type the following in the same Terminal session and examine the output:
$ readelf -l -W ch04-example
  1. In the same Terminal session, type the following and review the resulting output:
$ readelf -S -W ch04-example
  1. When ready, type the following in the same Terminal session and study the output:
$ readelf -s -W ch04-example
  1. 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
  1. 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
  1. Next, type the following into the open Terminal session. Review the output for anything interesting:
$ readelf -R .text -W ch04-example
  1. In the same Terminal session, type the following and study the output for any interesting information:
$ readelf -p .strtab -W ch04-example
  1. Type the following in an open Terminal session and review the output:
$ objdump -f ch04-example
  1. Next, type the following in the same Terminal session:
$ objdump -j .text -s ch04-example
  1. When ready, type the following in the running Terminal session and examine the output:
$ objdump -x ch04-example
  1. Next, type the following in the same Terminal session and review the output:
$ ldd -v ch04-example
  1. Finally, type the following and review the output for any interesting information:
$ hexdump -C ch04-example | less
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.171.20