-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
converted elf_analysis plugin to new base class #1266
base: master
Are you sure you want to change the base?
Conversation
c14b112
to
b307c7e
Compare
b307c7e
to
afec839
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1266 +/- ##
==========================================
- Coverage 92.21% 91.91% -0.31%
==========================================
Files 377 376 -1
Lines 23068 20966 -2102
==========================================
- Hits 21273 19270 -2003
+ Misses 1795 1696 -99 ☔ View full report in Codecov by Sentry. |
for section in elf.sections: | ||
if section.name == '.modinfo': | ||
modinfo = section.content.tobytes() | ||
modinfo = [entry.decode() for entry in modinfo.split(b'\x00') if entry] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we handle decoding errors here?
def normalize_lief_items(functions): | ||
def normalize_lief_items(functions) -> list[str]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't we remove this function completely?
Why is this in helperFunctions.hash
anyways?
header: ElfHeader | ||
sections: List[ElfSection] | ||
segments: List[ElfSegment] | ||
dynamic_entries: List[DynamicEntry] | ||
exported_functions: List[ElfSymbol] | ||
imported_functions: List[str] | ||
mod_info: Optional[List[str]] | ||
note_sections: List[InfoSectionData] | ||
behavior_classes: List[str] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we document these?
Imo, we should at least document the non-standart ones like mod_info
and behavior_classes
.
sections=[ElfSection.model_validate(s) for s in json_dict['sections']], | ||
segments=[ElfSegment.model_validate(s) for s in json_dict['segments']], | ||
dynamic_entries=[DynamicEntry.model_validate(e) for e in json_dict['dynamic_entries']], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imo the code gets more readable if we do not serialize the lief elf representation to json.
E.g. like the exported_functions
above.
No description provided.