Jump to content
View in the app

A better way to browse. Learn more.

Tuts 4 You

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Disassembling ELF file format

Featured Replies

Posted

I need to design a simulator for a SPARC based customized processor. The simulator has to be able to accept a SPARC-ELF binary as its input. Does anyone have any suggestion how to extract the RAW machine code from the ELF file so that I can disassemble it programmatically & simulate the instruction?

If you are going to be designing an emulator, i would think that you would have some pre-requisites to learn before worrying about the coding part.

1. Learn the hardware you're going to emulate as well as you can.

2. Learn the machine language you're going to interpret and emulate.

3. Learn the file format for the input files.

Coding the emulation will benefit from these 3 things immensely because instead of all these unknown factors you will be able to isolate and identify anomolies rather than looking at it and saying "What is going wrong?"

Once you have learned a bit about the subject, you will want to look for an ELF format disassembler unless you intend to write everything yourself. Start at the beginning and the rest will unfold as you progress, try to take on too much and it will all be a mess.

HR,

Ghandi

  • Author

Can you point me towards any tutorial which explains the concept of linking by means of practical examples? To be more precise, I want to have an example object file, run the linker & "realize" the operation done by the linker to produce the executable.

Can you point me towards any tutorial which explains the concept of linking by means of practical examples? To be more precise, I want to have an example object file, run the linker & "realize" the operation done by the linker to produce the executable.

GNU BinUtils (http://www.gnu.org/software/binutils/) has two programs that should be of interest to you: readelf and objdump. You should try them out on the command line to get a feel for them then you can check their sources; From what I remember neither is too complicated and they both can parse ELF files.

Create an account or sign in to comment

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.