[Solved]Goal Project Display Environnent Variables Attached Program Process Also Trace Stack Relev Q37255677
Hello how can I write this in C? thank you for your help inadvance


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 (i-0; envelj != i++) NULL; printf(“nis”, enl) 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) Additionally, create some local variables and an array of characters. a. You will need to show the registers for the stack (esp), for the base pointer (ebp) and the instruction pointer. 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 (i-0; envelj != i++) NULL; printf(“nis”, enl) 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) Additionally, create some local variables and an array of characters. a. You will need to show the registers for the stack (esp), for the base pointer (ebp) and the instruction pointer.
Expert Answer
Answer to Hello how can I write this in C? thank you for your help in advance … . . .
OR

