In rop, often a gadget has an undesired pop
or push
in the middle.
For a pop
, we handle this simply by adding a dummy value to our chain: it is popped, and all is well.
What about a push
: What do we do to our chain to handle it? It seems to me that since a push
first decrements SP and only afterwards writes, it will break our chain completely: SP now points to the value pushed, and not the next gadget.
Is that correct? If so, is there a way to use gadgets with push in them?