Question: In this level you will be working with control flow manipulation. This involves using instructions to both indirectly and directly control the special register `

In this level you will be working with control flow manipulation. This involves using instructions
to both indirectly and directly control the special register `rip`, the instruction pointer.
You will use instructions such as: jmp, call, cmp, and their alternatives to implement the requested behavior.
Recall that for all jumps, there are three types:
Relative jumps
Absolute jumps
Indirect jumps
In this level we will ask you to do a relative jump.
You will need to fill space in your code with something to make this relative jump possible.
We suggest using the `nop` instruction. It's 1 byte long and very predictable.
In fact, the as assembler that we're using has a handy .rept directive that you can use to
repeat assembly instructions some number of times:
Useful instructions for this level:
jmp (reg1| addr | offset) ; nop
Hint: for the relative jump, lookup how to use `labels` in x86.
Using the above knowledge, perform the following:
Make the first instruction in your code a jmp
Make that jmp a relative jump to 0x51 bytes from the current position
At the code location where the relative jump will redirect control flow set rax to 0x1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!