feat: add overlap() to merge 2 FileStructure objects#2635
feat: add overlap() to merge 2 FileStructure objects#2635VulnX wants to merge 2 commits intoGallopsled:devfrom
overlap() to merge 2 FileStructure objects#2635Conversation
|
Do you think this can be done with the generic overlap function from #2647? So we just keep the |
|
#2647 was merged. How can this PR be moved forward? |
|
Hey @peace-maker, sorry for the delay in response. I will push the changes soon. |
|
I believe this is a major redundancy with |
|
This one about the file structure or the |
I am not sure how this can be merged with |
|
I agree with @peace-maker though, that there should be only 1 definition for |
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