Puzzle 4

XOR

Puzzle

############
# Puzzle 4 #
############

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

? Enter the value to send: (0) 

Solution

JUMP to XOR(msg.value, 12).

The objective is to jump to address 0x0A. Recall that XOR(msg.value, 12) = 0x0A implies msg.value = XOR(0x0A, 12). Do it in Python:

The correct input is 6.

Last updated