serge1 / elfio-rs

ELFIO is a Rust library intended for reading and generating files in the ELF binary format. The library supports processing of ELF files for 32- and 64-bit architectures regardless of their endianess
https://crates.io/crates/elfio
Apache License 2.0
9 stars 2 forks source link

How to save the modified ELF? #1

Closed jocutajar closed 1 year ago

jocutajar commented 1 year ago

Hi,

I did not understand how can I save the modified ELF binary back into a file. Kindly advise.

Thank you

serge1 commented 1 year ago

Please give a try to "add_section" example located in 'examples' directory. Alternative method of ELF file modification is demonstrated in "anonymizer" example.

serge1 commented 1 year ago

Oh, I am sorry. My reply belongs to the original C++ ELFIO project and not to its Rust little brother. To the moment, the Rust version of the library implements ELF file reader only. The library does not permit creation or modification of ELF files yet. Therefore, there is no 'save' function available.

jocutajar commented 1 year ago

I have found the object crate... It's freaking complex... hands off :D