Compile it and use the debugger to analyze the code by doing the following
Ask Expert

Be Prepared For The Toughest Questions

Practice Problems

Compile it and use the debugger to analyze the code by doing the following

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?

Hint
Computeri.A program is a predetermined set of sequential activities that a computer is programmed to carry out. The program in the modern computer that John von Neumann described in 1945 contains a sequence of instructions that the machine executes one at a time. The program is typically stored in a location that the computer can access....

Know the process

Students succeed in their courses by connecting and communicating with
an expert until they receive help on their questions

1
img

Submit Question

Post project within your desired price and deadline.

2
img

Tutor Is Assigned

A quality expert with the ability to solve your project will be assigned.

3
img

Receive Help

Check order history for updates. An email as a notification will be sent.

img
Unable to find what you’re looking for?

Consult our trusted tutors.

Developed by Versioning Solutions.