Created How to modify section data (markdown)

Serge Lamikhov-Center 2020-11-02 22:17:03 +02:00
parent 6d740ae669
commit 376fd21bcd

@ -0,0 +1,8 @@
The primarily design of the library is to use 'elfio' object as a read-only reader or as a writer for newly created ELF object or executable files. In both such scenarios, modification of existing section data is not required.
Saying this, there are couple of ways to alternate the section data.
One of the ways is demonstrated in 'anonymizer' example. An external file is modified on base of the parsed information.
The second way is just alternating raw memory pointed by section->get_data(). An example of this can be found in generic_set_entry_rel() function in elfio_relocation.hpp file.
Please be warned: read/modify/write scenario may or may not work - there are too many cross references inside the format and it is easy to damage them. This will lead to incorrect object/executable file