[Solved]Goal Project Display Environnent Variables Attached Program Process Also Trace Stack Relev Q37164648

You goal in this project is to display the environnent variables attached to the program (process) and also trace the stack with all the relevant registers. In particular, you will see how a new stack frame is created every time a function is called, and how the previous stack frame is restored when the function returns. You will also show how the instruction pointer is restored as well. Create two simple functions called urnamel and urname2 1. Main will display the environment variables (here is a sample code; you could stop after 2 or3 variables; the code below will list all of them, which could be a lot!) int main(int ares char “arevI], char en[]) int i for (w = 0; envel il != NULL; w++) printi(“n%s” , envelw] ) ; return 0; It will then call urnamel with at least two argument (add few more statements after the call to show how we will restore the instructions pointer for main) Additionally, create some local variables and an array of integers. a. b. 2. urnamel will call urname2 with at least one arguments (add few more statements after the call to show how we will restore the instructions pointer for fool) a. Additionally, create some local variables and an array of characters You will need to show the registers for the stack (esp), for the base pointer (ebp) and the instruction pointer Your submission will be in the form of a power-point presentation with screen shots from the Linux environment as you are stepping through the gdk and printing the pertinent values ° Make sure to list main, fool, and foo2 content as well. Show assembly code of every function in gdb using the disass ° You should comment on the results and how they make sense (or not!) Show transcribed image text You goal in this project is to display the environnent variables attached to the program (process) and also trace the stack with all the relevant registers. In particular, you will see how a new stack frame is created every time a function is called, and how the previous stack frame is restored when the function returns. You will also show how the instruction pointer is restored as well. Create two simple functions called urnamel and urname2 1. Main will display the environment variables (here is a sample code; you could stop after 2 or3 variables; the code below will list all of them, which could be a lot!) int main(int ares char “arevI], char en[]) int i for (w = 0; envel il != NULL; w++) printi(“n%s” , envelw] ) ; return 0; It will then call urnamel with at least two argument (add few more statements after the call to show how we will restore the instructions pointer for main) Additionally, create some local variables and an array of integers. a. b. 2. urnamel will call urname2 with at least one arguments (add few more statements after the call to show how we will restore the instructions pointer for fool) a. Additionally, create some local variables and an array of characters You will need to show the registers for the stack (esp), for the base pointer (ebp) and the instruction pointer Your submission will be in the form of a power-point presentation with screen shots from the Linux environment as you are stepping through the gdk and printing the pertinent values ° Make sure to list main, fool, and foo2 content as well. Show assembly code of every function in gdb using the disass ° You should comment on the results and how they make sense (or not!)
Expert Answer
Answer to You goal in this project is to display the environnent variables attached to the program (process) and also trace the st… . . .
OR

