Full exploit payload
Now we will implement the concept from challenge 1: instead of just finding the offset, we will construct the full byte sequence (exploit payload) to be sent to the program.
For simplicity, in ALL examples in this section, addresses/registers are assumed to be 4-byte (32-bit), little-endian — in real 64-bit systems they are usually 8-byte, but the concept itself (offset, ROP, canary, GOT...) remains the same.
| Offset | Contents | Size (bytes) |
|---|---|---|
0 | buffer | 34 |
34 | saqlangan registr | 4 |
38 | qaytish manzili (return address) | 4 |
The vulnerable program has a function named maxfiy_funksiya() and it is located at address 0x0040F2FF — it is normally never called, but if the program calls it, it will output the flag for you.
How the payload is constructed: first offset 'A' (hex: 0x41) bytes (to fill the buffer + saved register), then the target address written in exactly 4 bytes, in little-endian order.
Submit the answer in the format BAYROQ{PWN_PAYLOAD_<to'liq payload, uzluksiz hex satr>} (case-insensitive).