Comments (3)
I am wondering if adding additional \0 in the strtab is valid
Yes. Values in the strtab only have meaning if something references them.
we want to override the rpath of a shared library by replacing the string with a shorter, \0 padded one
Be aware that a string and its suffixes can be referenced from multiple places, so by modifying the string for rpath it is possible to be changing another string at the same time. This may be unlikely for the complete rpath string, but it's hard to tell when the suffix will have meaning somewhere else too.
Wouldn't it be more expected that the parser jumps over blocks of \0?
If something actually references the \0, then the parser should return an empty string. If the parser jumped over it, then I think Strtab::get_at
would return None
, which would be wrong. Compilers won't generate this sort of thing in practice, but it would be best to handle it correctly if it does happen.
As an aside, the way that goblin parses string tables into a list of strings is unusual. Most parsers don't do that.
from goblin.
Hi @philipc thanks for your insights! Am I correct in the assumption that the strings for rpath are in the .dynamic
part, and in the dynstrtab
table? So if I would check the entire section for suffixes I could rule out that any other string is corrupted by the edits?
from goblin.
Yes the rpath reference is in .dynamic
. The strings in the .dynstr
section can be referenced by .dynamic
, .dynsym
, and the GNU version information sections.
from goblin.
Related Issues (20)
- ELF Notes should use 4-byte alignment HOT 11
- Implementing patchelf / install_name_tool with goblin
- Failing to parse QEMU memory dump note .shstrtab HOT 1
- PE: handle empty import address table HOT 1
- COFF stringtable created with 'strings' function truncates the first 4 characters when used with symbol offset HOT 9
- Alternative owned data version?
- Cannot parse loaded image due to rigidity around parsing Attribute Certificates
- Mach-O parser does not expose reserved section fields
- Malformed entity: Cannot map ImageDebugDirectory rva 0x3ac into offset HOT 2
- Help obtaining bytes of a function in .TEXT HOT 1
- Unable to parse ELF SectionHeader from raw bytes HOT 1
- Parsing relocations in a PE file HOT 3
- Little help with writing the modifications of an PE HOT 1
- Add Terse Executable (TE) support to goblin
- feature (PE): add rich header
- feature (PE): explicitly state presence or absence of support for various malformations
- Releasing a 0.8.1 ? HOT 1
- Version 0.8.1 includes a breaking change
- Note::type_to_str is only valid when n_name is "GNU"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from goblin.