Skip to main content
Challenges ROP chain: calling a function with 2 arguments
PWN Medium ROP Solves: 7

ROP chain: calling a function with 2 arguments

Author: CyberSamSU
Points
45

Now more than one gadget is needed: you must call the daraja_tekshir(R0, R1) function (address 0x00403F52) with exactly the values R0 = 217, R1 = 126 — the function will output the flag only with these values.

The "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 needed, the third from R2 (in the real x86-64 System V ABI this is done via rdi, rsi, rdx — the idea is the same, the names are simplified).

Found gadgets:

AddressInstruction (gadget)
0x00401EB8POP R3; RET
0x00401DC8RET
0x004013A0POP R1; RET
0x00401B80XOR R0, R0; RET
0x00401FD0POP R2; RET
0x004011E8POP R0; RET

The ROP chain is placed on the stack in the following order: [gadget_R0, qiymat_R0, gadget_R1, qiymat_R1, maqsad_manzil] — each element is 4 bytes, little-endian. Each POP Rn; RET gadget takes one value from the stack into that register, then "returns" (RET) to the next element.

Submit the answer in the format BAYROQ{PWN_ROP_<to'liq zanjir, uzluksiz hex satr>}.

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

First solvers

1. W.o.X 09.09.2026
2. testrejim 09.10.2026
3. Mirjaxon Qaxxarov 27.10.2026
4. Odam 05.11.2026
5. Mahfuza 11.11.2026
6. arcanum 11.11.2026
7. Furqat Turayev 11.11.2026