Skip to content

Glossary

Gadget

A short sequence of existing instructions ending in a RET (or similar) used as a building block in Return-Oriented Programming chains.

A gadget is a short sequence of instructions — typically 1–5 instructions — ending in a control-flow instruction such as RET, JMP [reg], or CALL [reg], found within an existing binary or library. Gadgets are the atomic building blocks of Return-Oriented Programming (ROP): each gadget performs a small operation (e.g., POP RAX; RET loads a value into RAX), and chaining many gadgets together constructs arbitrary computation. Gadget quality and availability depend on the ISA and on how much code is loaded in the process — large libraries like libc or ntdll.dll are rich sources.