Challenge:
Our third challenge is located in /puzzles/puzzle_3.json. Challenge 3 contains the following:
{
"code": "3656FDFD5B00",
"askForValue": false,
"askForData": true
}
Hint 1:
The corresponding EVM opcodes are:
CALLDATASIZE
JUMP
REVERT
REVERT
JUMPDEST
STOP
Hint 2:
CALLDATASIZE takes size of the calldata
and places it on top of the stack.
How can we JUMP over the 2 REVERT
opcodes and land on the JUMPDEST?
Hint 3:
CALLDATASIZE //Offset 0
JUMP //Offset 1
REVERT //Offset 2
REVERT //Offset 3
JUMPDEST //Offset 4
STOP //Offset 5
Solution:
To solve this level, we just need to pass in a 4 bytes of call data.
(i.e. 0xaaaaaaaa) This way CALLDATASIZE places 4 on the top of the stack.
JUMP then performs a valid jump over the REVERT calls to JUMPDEST.