Vector35 / Vector35/binaryninja-api
Define `tcbhead_t` struct for GNU Linux programs and set `$fs` to be a pointer to it
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 1.3k
- Forks
- 298
- Avg merge
- 5d 5h
- Merged PRs (30d)
- 19
Description
What is the feature you'd like to have?
I would like the struct tcbhead_t structure to be added to the system types for binaries that can be identifiedd as GNU Linux binaries, and for $fs to point to it.
This makes
void* fsbase
int64_t rax = *(fsbase + 0x28)
...
if (rax == *(fsbase + 0x28)) {
return 0
}
...
__stack_chk_fail()
Into a slightly more readable
struct tcbhead_t* fsbase
int64_t stack_guard = fsbase->stack_guard
...
if (stack_guard == fsbase->stack_guard) {
return 0
}
...
__stack_chk_fail()
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked glibc sysdeps/x86_64/nptl/tls.h definition of tcbhead_t, then locate how GNU Linux system types and the $fs register are represented in Binary Ninja. Confirm how GNU Linux binaries are identified and how existing architecture-specific types are added. Done means $fs has the named structure type and stack_guard access decompiles readably for the shown pattern.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, linux
- Domain
- operating-systems, reverse-engineering
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100