I want to modify the text section of an ELF file. So far, I have tried to load the old ELF file and then have tried to use sec->set_data or sec->append_data to modify the existing code sectio. Thrn I used save function to generate newly modified ELF file. I'm pretty sure that I'm not doing it properly. Can you give me a hint how I can change the size and address of new text section and update the ELF header and other sestions and segments?
I need to know if there is any easy way to do this. ( I know that one solution is to go through all the sections and segments and read and write them as I wish.)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I want to modify the text section of an ELF file. So far, I have tried to load the old ELF file and then have tried to use sec->set_data or sec->append_data to modify the existing code sectio. Thrn I used save function to generate newly modified ELF file. I'm pretty sure that I'm not doing it properly. Can you give me a hint how I can change the size and address of new text section and update the ELF header and other sestions and segments?
I need to know if there is any easy way to do this. ( I know that one solution is to go through all the sections and segments and read and write them as I wish.)
Hi, the question is too wide. Can you narrow it a more specific use case?