سؤال

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?

هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top