Handle dynamically linked ET_EXECs#112
Merged
Merged
Conversation
Reviewer's GuideThis PR adds support for dynamically linked ET_EXEC binaries by introducing a new DYNEXE Type in the ELF logic and updating related detection, test fixtures, build scripts, and versioning. Entity relationship diagram for new test binary entrieserDiagram
TESTDATA {
Name string
Path string
SnagTo string
SnagAs string
Elf Elf
Dynamic bool
Exe bool
Lib bool
HasInterpreter bool
}
ELF {
Name string
Path string
Class EI_CLASS
Type Type
Interpreter string
Dependencies string
}
TESTDATA ||--|| ELF : contains
ELF }o--|| Type : has
Class diagram for updated ELF Type logicclassDiagram
class Elf {
+Name string
+Path string
+Class EI_CLASS
+Type Type
+Interpreter string
+Dependencies []string
+IsExe() bool
+IsLib() bool
+IsDyn() bool
}
class Type {
<<enumeration>>
UNDEF
EXEC
DYN
DYNEXE
}
Elf --> Type
Flow diagram for ELF type detection with DYNEXE supportflowchart TD
A["elffile.Type == ET_EXEC?"] -->|Yes| B["Has Dynamic Table?"]
B -->|Yes| C["Type = DYNEXE"]
B -->|No| D["Type = EXEC"]
A -->|No| E["elffile.Type == ET_DYN?"]
E -->|Yes| F["Has PIE flag?"]
F -->|Yes| G["Type = DYNEXE"]
F -->|No| H["Type = DYN"]
E -->|No| I["Other type handling"]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #112 +/- ##
==========================================
- Coverage 76.59% 76.37% -0.23%
==========================================
Files 13 13
Lines 752 766 +14
==========================================
+ Hits 576 585 +9
- Misses 119 123 +4
- Partials 57 58 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Hey there - I've reviewed your changes - here's some feedback:
- Consider updating the error in New() from “(PIE without interpreter)” to a more generic message (e.g. “executable missing interpreter”) since DYNEXE can also trigger it.
- In elftype(), you currently ignore the error from DynamicSymbols; handling that error explicitly would prevent false classification when symbol parsing fails.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider updating the error in New() from “(PIE without interpreter)” to a more generic message (e.g. “executable missing interpreter”) since DYNEXE can also trigger it.
- In elftype(), you currently ignore the error from DynamicSymbols; handling that error explicitly would prevent false classification when symbol parsing fails.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by Sourcery
Add handling for dynamically linked ET_EXEC binaries by introducing a unified DYNEXE type, updating detection logic and related constants, and updating tests and build scripts accordingly.
New Features:
Enhancements:
Build:
Tests:
Chores: