Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting complete disassembly of an executable binary

Tags:

Is it possible to get a complete disassembly (which can act as input to an assembler) of an executable?

When I use otool -tV a.out I get to see only the text section. Other sections like data aren't visible.

When I use gdb, the disassemble command requires a start and an end address. However I do not know how to find out the start and the end address of a binary (say a.out).

I'm trying to disassemble an executable, tinker with the assembly code and then reassemble it. Is that possible?

It'd also help if one can find out the names of all the sections in a binary.

like image 483
mynk Avatar asked Oct 23 '12 21:10

mynk


People also ask

Which command is used to disassemble code?

The objdump command is generally used to inspect the object files and binary files. It prints the different sections in object files, their virtual memory address, logical memory address, debug information, symbol table, and other pieces of information. Here we'll see how we can use this tool to disassemble the files.

How do I take apart my ELF file?

Disassembling an ELF-formatted fileUse the --disassemble option to display a disassembled version of the image to stdout . If you use this option with the --output destination option, you can reassemble the output file with armasm. You can use this option to disassemble either an ELF image or an ELF object file.

What is disassembly code?

In programming terminology, to disassemble is to convert a program in its executable (ready-to-run) form (sometimes called object code ) into a representation in some form of assembler language so that it is readable by a human.

What is disassembly file?

A disassembler is a computer program that translates machine language into assembly language—the inverse operation to that of an assembler. A disassembler differs from a decompiler, which targets a high-level language rather than an assembly language.


1 Answers

Try using this command, i remember using it sometime back:

otool -tvV a.out
like image 185
Tanuvir Avatar answered Sep 19 '22 17:09

Tanuvir