02.puzzles_2
2023-07-27 13:37:44 # 15.EVM Puzzles

puzzles_2

CODESIZE获取bytecode的长度,我们的bytecode长度为10。然后会减去我们的CALLVALUE,得到一个值X,然后跳转到X的位置,X的位置要求是JUMPDEST,因此只能是6。所以,10 - X = 6,因此CALLVALUE=4

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
############
# Puzzle 2 #
############

00 34 CALLVALUE
01 38 CODESIZE
02 03 SUB
03 56 JUMP
04 FD REVERT
05 FD REVERT
06 5B JUMPDEST
07 00 STOP
08 FD REVERT
09 FD REVERT

? Enter the value to send: 4

Puzzle solved!