
so if we say: readelf -a /bin/bashĪll the contents in the binary file bash would be shown to us, also we could provide different flags for readelf to see all the sections and headers of an elf file separately, for example if we want to see only the elf header we say: readelf -h /bin/bashįor reading all the segments of the file: readelf -l /bin/bashįor reading all the sections of the file: readelf -S /bin/shīut again as summary, for reading a normal file like "hello.c" and a binary file like bash in path /bin/bash in linux we say: xxd hello. Now I need to convert the hexadecimal value to binary and print it. įor example if we want to see all the convert all the contents of a binary file(executable, shared libraries, object files) we say: hexdump binaryfilenameīut readelf is the best utility for analyzing elf(executable and linking format) files. How to convert a hexadecimal value to a binary value in C Ask Question Asked 8 years, 9 months ago Modified 2 months ago Viewed 3k times 0 How can I fix my code I have a text file with hexadecimal values. To see all the contents and codes in a binary file, we could use commands like readelf and objdump, hexdump.

To convert a file to its binary codes(hexadecimal representation) we say: xxd filename #
