Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/raehik/elf-data-injector
Inject data into ELFs and patch over references to use them, automatically
https://github.com/raehik/elf-data-injector
Last synced: 12 days ago
JSON representation
Inject data into ELFs and patch over references to use them, automatically
- Host: GitHub
- URL: https://github.com/raehik/elf-data-injector
- Owner: raehik
- Created: 2022-05-02T13:13:43.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-05-02T13:13:55.000Z (over 2 years ago)
- Last Synced: 2024-11-13T16:34:21.202Z (2 months ago)
- Language: Haskell
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# ELF data injector
Inject data into ELFs and patch over references to use them.Intended primarily for the awkward task of replacing a string literal with an
arbitrarily longer one. Replacing a string with another string of the same
shorter length is easy; longer is challenging. This tool appends a new segment
to the ELF, amends headers and offsets, and patches offsets to replace
references to the old data with references to the new data.## Rough notes
* Lay out data and create blablabla* PH: Increment file offsets. Everything shifts by `e_phentsize * 1 = 0x20`.
* PH: Insert new segment *before* the weird empty one. If it comes after,
raehik's device immediately reboots.
* `p_flags` is a bitmask. 4 is R, 5 is RW. Both work. Make it read-only,
until we need to add our own global data for some reason.
* Need to know total size, vaddr
* FH: Increment `e_phnum`.## To-dos
* I talk about paddr where ELF talks about offset. I don't mean paddr in
memory, I mean in ELF file. That's bad, should fix