Trim Elf model interface, add tests#71
Merged
EdwardLarson merged 7 commits intoOct 28, 2022
Merged
Conversation
Contributor
Author
|
@andresito00, @EdwardLarson, can you review this Draft MR. Especially review:
Once we agree on path forward, I will add tests. |
Contributor
EdwardLarson
left a comment
There was a problem hiding this comment.
Mostly lgtm. A general comment on the current ELF implementation is that a lot of the fields of these dataclasses are pointlessly saving the raw unpacked integers when practically all users want the enums they map to. We could get rid of a lot of the get_(field) methods by just unpacking the binary into the desirable types in the first place.
But in the interest of time, I imagine that is out of scope.
66fd95b to
c01f0c6
Compare
This commit removes Elf model methods with no usage or tests that seem to be unneeded. It also adds tests for untested Elf methods.
c01f0c6 to
ed2b51c
Compare
…yzer, ElfSymbolStructureIndexAnalyzer None of these analyzers appear to get called during the normal use of Elf models, and they appear to be incomplete and contain errors
5800099 to
5e3176a
Compare
- Update OFRAK Tutorials to use MemoryPermissions. - Bump ofrak function coverage enforcement to 90%. - Add docstrings to new tests for clarity
5e3176a to
0c8742b
Compare
Contributor
Author
|
@EdwardLarson I think this is ready for review. I've updated the PR description with more details. |
EdwardLarson
approved these changes
Oct 28, 2022
EdwardLarson
pushed a commit
to EdwardLarson/ofrak
that referenced
this pull request
Aug 8, 2023
…oject-tests remove empty test, use HTTPS instead of git URLs, fix project id to s…
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.
Please describe the changes in your request.
This PR refactors OFRAK's elf resource views and components, removing unnecessary methods and classes and adding function test coverage for the OFRAK Elf API.
Relevant changes:
MemoryPermissionsenum such that executable is 1 and read is 4.get_parent,get_elfmethods in Elf resource views.ElfProgramHeaderPermission, replacing its usage withMemoryPermissions.ElfProgramHeaderinterface to only include one method,get_memory_permissions.UnanalyzedElfSegment.Elf:get_sections_after_index,get_sections_before_index,get_section_header_by_name,get_string_section_headerThis PR also deletes three analyzers:
ElfSegmentStructureIndexAnalyzer,ElfSectionStructureIndexAnalyzer, andElfSymbolStructureIndexAnalyzer. This was done for several reasons:ElfSegmentStructureIndexAnalyzerdoes not actually handleElfSegmentcorrectlyElfSectionStructureIndexAnalyzerfails when run on anElfSectionwith no dataThese analyzers can be revisited when OFRAK users have use cases that require these indexes to be
updated.
Future Improvements
#87 was discovered when writing this PR.
Also, see #71 (review) for ideas for further improving OFRAK Elf APIs.
Anyone you think should look at this, specifically?
@andresito00, @EdwardLarson