I am writing a rop chain for a vulnerable program (stack overflow, with NX and ASLR turned on).
I follow the execution of my gadgets by watching the stack pointer on gdb peda. It works well except when it encounters a gadget mov[eax], edx; ret
. This gadget gets executed, but after there is a push ebx
that follows, even if I didn't put any gadget like that in my ROP chain. And in the end my exploit doesn't work.
I have tried with different registers this instruction and there is always the push ebx
that follows and I don't know why.
Would someone have an idea ?