Problem 3 –Analyze lea instruction
1. Compile it and use the debugger to analyze the code by doing the following:
a. Create break point in main and run it
b. Observe the code section (where the instructions are located) and use si to step in till reaches the lea rax,[rip+displacement] instruction and observe the content of rax register. What is the value of rax register after executing lea rax instruction?
c. Use print $rip to find the address of rip. Observe the second operand of lea instruction [rip+displacement] and use the calculator to add the displacement to rip address. What is the result? What is your observation?
d. Continue using si till you step in to the first lea rdi instruction. Observe the content of rdi register. What is the value of rdi register after executing lea rdi instruction?
e. Now that you know the content of rax and rdi registers use x command to verify the content of the address within these registers. What is the content?
f. What is the purpose of lea instruction?
g. Attach screen captures that demonstrate the content of register rax and rdi after executing lea instruction and the content of the address within these registers
h. What address contains the string “/bin/sh”
i. Use disas command and identify the opcode of the lea instructions implemented in this program. Attach the screen capture that demo results
j. Use c (continue) command to terminate the program. What is the purpose or output of this program?
Students succeed in their courses by connecting and communicating with an expert until they receive help on their questions
Consult our trusted tutors.