Add new ROP feature: relative stack offset#2583
Add new ROP feature: relative stack offset#2583CsomePro wants to merge 4 commits intoGallopsled:devfrom
ROP feature: relative stack offset#2583Conversation
|
Nice, can you please add a test to the ROP class itself or the module at the top which verifies this works as expected? You can look at the other tests which use |
|
I added the |
I am also thinking about this question. If I want to set an address precisely to the front or back of a gadget or data during ROP writing, due to the encapsulation of some ROP layouts, how should I do this? Since the length of the data after the gadget is uncertain, it seems difficult to achieve this requirement. |
|
The document is complete and can be reviewed. |
Add new
ROPfeature: relative stack offsetSometimes, the ROP needs to be set using the relative offset position on the stack.
This is a temporary solution.
But sometimes errors occur.
Because of the existence of
AppendedArgument, arguments will be placed at the end of the stack.len(rop.chain())will not be the correct offset from base to the current slot.Therefore, I added a class
StackRelativeand added the processing logic forStackRelativein theROP.buildfunction... elif isinstance(slot, StackRelative): address = slot.resolve(slot_address) stack[i] = address stack.describe(self.describe(address), slot_address) ...At this point we can use this to solve the above example.