2

I have an ELF executable and I would like to know how can I modify its .rodata segment.

Also, more generally, how can I modify an ELF executable?

2
  • I've used emacs to edit binaries. Are you sure you want to modify the ELF vice generating a new one? Commented Apr 7, 2013 at 21:14
  • 1
    I do not have access to the source code. Commented Apr 7, 2013 at 21:17

1 Answer 1

2

You can use any hexeditor to do that, if you know precisely which part of ELF you need to modify.

If you want to parse ELFs and do more complex logic you should write some code which will open file or better, mmap it. Then you can read ELF header which gives basic information about ELF and points to other important places in ELF. I suggest reading manual for ELF and <include/elf.h>.

If you are using Linux, you can view where sections lie in memory using readelf or objdump.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.