Hi Peter, Been struggling to understand the compensating bytes location myself for the past couple of days :-). If this is of any help to others, I found that the offset value after RETN (in case of RETN + offset) means the number of bytes the CPU will remove from the stack after fetching the next address (and increment ESP by ‘offset’ bytes as the result). In the above example, because there is a RETN + 4 in the first gadget, the CPU will remove 4 bytes from the stack after fetching the next gadget address i.e. 0x77C1D7F5 hence the need for 0x41414141 padding after it in order for next RETN to go to the second gadget address i.e. 0x71AA2526 (after a POP in that gadget). Hope this make sense, or I stand to be corrected if my understanding is wrong here.