feat: add overlap() to merge 2 FileStructure objects#2635
Open
VulnX wants to merge 2 commits intoGallopsled:devfrom
Open
feat: add overlap() to merge 2 FileStructure objects#2635VulnX wants to merge 2 commits intoGallopsled:devfrom
overlap() to merge 2 FileStructure objects#2635VulnX wants to merge 2 commits intoGallopsled:devfrom
Conversation
Member
|
Do you think this can be done with the generic overlap function from #2647? So we just keep the |
Member
|
#2647 was merged. How can this PR be moved forward? |
Author
|
Hey @peace-maker, sorry for the delay in response. I will push the changes soon. |
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.
Closes: #2634
What does this PR add?
This PR adds an
overlap()method to the existingFileStructureclass which allows the user to merge 2FileStructureobjects. This is particularly useful when we have overlapping structs linked via the->chainfield.Apart from the main
overlap()method, for convenience, this PR also introduces 2 new methods:from_bytes()- a class method which allows the user to create aFileStructureobject from a byte stringoffsets()- exports the architecture-specific offsets for all fields of the struct. This will also be very helpful in case the user wants to manually construct the fields withflat(), and use sane names likeoffsets['vtable']instead of hard-coded numbers like216Does this PR modify any existing code?
No