Computer Architecture Exploitation and Security The ARM Software and Stack Objectives This lab focuses on the following objectives: · Identify data type · Use Memory instructions ldr and str · Analyze...

1 answer below »
Requests:1. The problems are in the word document2. Please screenshot at every step and put in word document

3. If putting files in the Zip folder if possible, please have the extensions as a note pad or a picture (it would be appreciated if you could copy and paste the code into a note pad document or just screenshot it instead of keeping it as a .c file or an assembly file)4. You may need a raspberry pi as it requires ARM code (see if yours can work)





Computer Architecture Exploitation and Security The ARM Software and Stack Objectives This lab focuses on the following objectives: · Identify data type · Use Memory instructions ldr and str · Analyze stack instructions and functions · Differentiate memory addressing modes · Identify instructions opcode and decode . Background Reading · DDI0406C ARM Architecture Reference Manual ARMv7-A and ARMv7-R Edition · DDI0344K Cortex-A8 Technical Reference Manual · DEN0013D ARM Cortex-A Series Programmer's Guide · https://developer.arm.com/documentation/dui0204/j/writing-arm-assembly-language? · ARM Instructions summary: https://developer.arm.com/documentation/dui0489/c/arm-and-thumb-instructions/instruction-summary?lang=en Problem 1 Analyze and Modify ARM code ___/15 1. Write the following ARM code: 2. Us as and ld to generate the executable 3. Run, analyze the code and the output. Answer the following questions: a. What is the output of this program? b. What is the purpose of register 7 (R7)? c. What registers are used to pass the parameters to the system calls? d. In the data section asciz directive is used. What is the difference between asciz and ascii directives? e. Explain how bic instruction is used in this program? f. Why is the purpose of .align 4 directive? g. Explain the instruction ldr r1,=character 4. Modify the code in a way that converts 5 characters in a loop. (Perform the read, convert and write in a loop 5 times). Simple loop max 3-5 lines of code. . 5. Provide the following screen captures a. Created code b. Provide the answers under respective question (color) c. Provide modified code and the results Problem 2 Analyze immediate values ___15 1. Write ARM assembly code that perform the following a. Move 255 value to R1 b. Move 260 value to R2 c. Add the values R0=R1 +R2 d. Add 500 to R0 and place the result in R3 R3 =R0+500 e. Use gdb to run the code and use the respective commands to verify the registers f. Use disas and analyze the results. Are the instructions and results correct? g. Modify the code and move 511 to R1 h. Use gdb and disas to analyze the results. What is different? explain i. Modify the code and add to R0 450 instead of 500. What error did you get? How can you solve this problem? 2. Provide the following screen captures a. Created code b. Modified code and disas results with R1=511 c. Solution to last problem (corrected code) Problem 3 Opcode ___10 1. Use objdump to disas the first code you created in problem 2 2. Identify the opcode for the following instructions: a. mov r1, #255 b. add r0,r1,r2 3. Convert the opcode into binary and identify the respective bits for each instruction and respective operands. Use as reference the last slide of Module 7 “ ARM Opcode e.g. For ARMv7” 4. Provide the screen capture of objdump results 5. Provide the conversion and the identified bits for each instruction and the respective operands after the objdump capture Problem 4 Stack Analysis ___15 Memory Addressing Modes 1. Create and analyze the following program: 2. Identify and differentiate memory addressing modes 3. Comment the identified lines 4. Which one is the base address register? 5. Use debugger create a break at _start. Use si , info registers and x commands. a. Identify the addresses of var1 and var2 b. Record r0, r1 and r2 values before r2 is stored in memory c. Use disas to identify the address of and d. Use x to verify the content of these addresses and compare it with the values in r0 and r1 e. Use si and info registers command to analyze the registers results after each str and ldr instruction. Observe the base address register behavior and record its value after each str and ldr instruction. Explain the results 6. Attach the following screen captures: a. Commented program b. Underline or highlight the base address register c. Debugger analysis that demo the changes of base address register Stack Analysis 1. Create the following C code or if you already had the code copy it into raspberry pi 2. Compile it and use the debugger to analyze the stack 3. Use the respective debugger commands to run the program and provide the screen captures that demo the following a. Prologue and epilogue of the function called func b. Info locals c. Function func parameters d. Function func frame. Value of sp and fp (frame pointer) (r11) e. Return address. 4. What is the addressing mode use by str and ldr instructions 5. Which one is the base address register? © 2017, Southern Alberta Institute of Technology. All rights reserved. This publication and materials herein are protected by applicable intellectual property laws. Unauthorized reproduction and distribution of this publication in whole or part is prohibited. For more information, contact: Director, Centre for Instructional Technology and Development Southern Alberta Institute of Technology 1301 16 Ave. N.W., Calgary, AB T2M 0L4
Answered 2 days AfterApr 18, 2022

Answer To: Computer Architecture Exploitation and Security The ARM Software and Stack Objectives This lab...

Chirag answered on Apr 21 2022
94 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here