What is Return-oriented programming (ROP)?

Return-oriented programming (ROP) is like giving a robot a list of tiny instructions to follow so it can do something clever, even if someone tried to stop it.

Imagine you're playing with building blocks, and each block has a special instruction written on it. Normally, the robot follows one big instruction at a time, like "build a tower." But what if someone took that instruction away? That's when ROP comes in handy!

ROP uses small pieces of existing code, called gadgets, to create new instructions. These gadgets are like individual building blocks, each does something simple, but together they can do something amazing.

How It Works

Think of the robot as a toy that follows commands one after another. When it finishes a command, it goes back to where it started, that's why it’s called return-oriented! ROP makes the robot use these return points to chain together gadgets, like linking blocks in a line.

Instead of giving the robot a new big instruction, you give it many small ones from different places. The robot follows them all in order, and, poof, it does something clever without anyone realizing it!

Take the quiz →

Examples

  1. A hacker uses small pieces of existing code to trick a program into doing what they want.
  2. Imagine using parts of a puzzle to create a new picture without making any new pieces.
  3. Like following instructions from different books to build something new.

Ask a question

See also

Loading…

Discussion

Recent activity

Categories: Science · hacking· exploits· security