Skip to main content
Challenges ROP introduction: setting an argument with one gadget
PWN Easy ROP introduction Solves: 5

ROP introduction: setting an argument with one gadget

Author: CyberSamSU
Points
22

ROP (Return-Oriented Programming) is a technique of sequentially "calling" and using small pieces of code already present within the program ("gadgets", usually ending with RET) by controlling the stack. Given the address of each gadget, you place the gadget addresses and operands onto the stack in the correct order, forcing the program to perform the action you want.

The "function calling convention" in this challenge is a simple model invented for educational purposes: the function takes its first argument from the R0 register, the second from R1, and if necessary the third from R2 (in the real x86-64 System V ABI this is done via rdi, rsi, rdx — the concept is the same, but the names are simplified).

Below is the table of found gadgets:

AddressInstruction (gadget)
0x00401D90POP R1; RET
0x00401330POP R0; RET
0x00401230POP R2; RET
0x00401840XOR R0, R0; RET
0x00401CE0RET
0x00401160POP R3; RET

You need to set the first argument of the target function (i.e., the R0 register) to a value of your choice. Which ONE of the gadgets in the table serves this purpose?

Send the answer in the format BAYROQ{PWN_GADGET_<manzil, 0x'siz, katta hex>}.

Theory: learn the topic
Hints 3
Opening a hint reduces the points you get for solving this challenge.
Hint 1 −2 pts Log in
Hint 2 −4 pts Log in
Hint 3 −6 pts Log in
To submit a flag, log in.

First solvers

1. anonym 27.10.2026
2. Mirjaxon Qaxxarov 27.10.2026
3. Odam 04.11.2026
4. Furqat Turayev 11.11.2026
5. Doston Allayarov 28.11.2026