SlideShare a Scribd company logo
ARMSIM
16BEC069 - MANAV KANOJIYA
16BEC070 - VIDHI SHAH
16BEC077 - PRITI KHANDELWAL
16BEC084 - SHREEYA MAKWANA
16BEC100 - SHIVEN PANDYA
16BEC101 - RAHUL BANSAL
Courtesy : [1]
Architecture Profile
A
(Architecture)
R
(Real-time)
M
(Microcontroller)
Architecture
A64 A32 T32
DIFFERENT ISA FOR ARM
ARM THUMB
Instructions are always of 32 bit. Instructions are of 16 bit and they can be
converted into 32 bit for arm exploit
development process.
All instructions support the conditional
execution.
Thumb state can support conditional
execution by using IT instruction.
All ARM versions support the arm state . Not all versions of ARM support the thumb
state.
While writing arm shellcode, we need to
get rid of null bytes in arm state.
Due to availability of 16 bit instructions, it
reduces the chances of having null bytes.
ARM REGISTERS
Flag Description
N
(Negative)
Enabled if result of the instruction yields a
negative number.
Z
(Zero)
Enabled if result of the instruction yields a zero
value.
C
(Carry)
Enabled if result of the instruction yields a value
that requires a 33rd bit to be fully represented.
V
(Overflow)
Enabled if result of the instruction yields a value
that cannot be represented in 32 bit two’s
complement.
E
(Endian-bit)
ARM can operate either in little endian, or big
endian. This bit is set to 0 for little endian, or 1
for big endian mode.
T
(Thumb-bit)
This bit is set if you are in Thumb state and is
disabled when you are in ARM state.
M
(Mode-bits)
These bits specify the current privilege mode
(USR, SVC, etc.).
J
(Jazelle)
Third execution state that allows some ARM
processors to execute Java bytecode in
hardware.
MNEMONICS IN ARM
Instruction Description Instruction Description
MOV Move data POP Pop on stack
ADD Addition SUB Subtraction
MUL Multiplication LSL Logical shift left
LSR Logical shift right ASR Arithmetic shift right
ROR Rotate right CMP Compare
AND Bitwise AND ORR Bitwise OR
EOR Bitwise XOR LDR Load
STR Store LDM Load multiply
STM Store multiply PUSH Push on stack
B Branch BL Branch with link
BX Branch with exchange BLX Branch with link and
exchange
SWI/SVC System call MVN Move 2’s complement
FORMAT OF ARM INSTRUCTIONS
• MNEMONIC{S} {condition} {Rd}, Operand1, Operand2
Where, MNEMONIC : Short name of the instruction
{S} : An optional suffix. If S is specified, the condition flags are updated on the result of the operation.
{Condition} : Conditions that has to be met for the execution of the instruction.
{Rd} : Destination of the register for storing the output of the instruction.
Operand1 : First register (either can be a register or an immediate value).
Operand2 : Second (Flexible) operand (can be a register or an immediate value with a level of shift).
INSTRUCTION EXAMPLES
Rx, LSR n Register x with logical shift right by n bits (1 = n = 32)
Rx, RRX Register x with rotate right by one bit, with extend
ADD R0, R1, R2 Adds contents of R1 (Operand1) and R2 (Operand2 in a form of
register) and stores the result into R0 (Rd).
MOVLE R0, #5 Moves number 5 (Operand2, because the compiler treats it as MOVE
R0, R0, #5) to R0 (Rd) ONLY if the condition LE (Less Than or Equal) is
satisfied.
LOAD AND STORE
• ARM uses Load-store model for memory access
• On ARM data is must be moved from memory into registers before being
operated on.
• This means that incrementing a 32-bit value at a particular address into
register, increment it within the register, and store it back to the memory
from register.
DATA TYPES WITH THE INSTRUCTIONS LOAD AND STORE:
• ldr = Load Word
• ldrh = Load unsigned Half Word
• ldrsh = Load signed Half Word
• ldrb = Load unsigned Byte
• ldrsb = Load signed Bytes
• str = Store Word
• strh = Store unsigned Half Word
• strsh = Store signed Half Word
• strb = Store unsigned Byte
• strsb = Store signed Byte
ADDRESS MODES
Three basic offset forms with different address modes for each offset form.
1. Offset form: Immediate value as the offset
• Offset mode uses an immediate as offset
Example: ldr r3,[r1,#3]
2. Offset form: Register as the offset
• Offset mode uses a register as offset
Example: ldr r3,[r1,r2]
3. Offset form: scaled register as the offset
• Offset mode uses a scaled register as offset
Example: ldr r3,[r1,r2,LSL#2]
BRANCHES
Branches (aka Jumps) allow us to jump to another code segment. This is useful when we
need to skip (or repeat) blocks of codes or jump to a specific function. Best examples of such
a use case are IFs and Loops. So let’s look into the IF case first.
There are three types of branching instructions:
• Branch (B)
• Simple jump to a function
• Branch link (BL)
• Saves (PC+4) in LR and jumps to function
• Branch exchange (BX) and Branch link exchange (BLX)
• Same as B/BL + exchange instruction set (ARM <-> Thumb)
• Needs a register as first operand: BX/BLX reg
CONDITIONAL EXECUTION
Condition
Code
Meaning
(for cmp
or subs)
Status of
Flags
EQ Equal Z==1
NE Not Equal Z==0
GT
Signed
Greater
Than
(Z==0) &&
(N==V)
LT
Signed
Less Than
N!=V
GE
Signed
Greater
Than or
Equal
N==V
LE
Signed
Less Than
or Equal
(Z==1) ||
(N!=V)
CS or HS
Unsigned
Higher or
Same (or
Carry Set)
C==1
CC or LO
Unsigned
Lower (or
Carry
Clear)
C==0
• Branches can also be executed conditionally
and used for branching to a function if a specific
condition is met.
ARMSIM
• ARMsim is a desktop application, it allows users to simulate the execution of
ARM assembly language programs on a system based on the ‘ARM7TDMI’
processor.
• ARMsim includes both an assembler and a linker. However editor is not there,
so file must be loaded into the application.
• The file to be opened must be a source (.s) file or an object (.o) file.
ARMSIM LIMITATION
• The ARM architecture supports both little‐endian and big‐endian access to memory. But the
ARMsim supports only the little‐endian format.
• The ARM architecture has a special mode of execution called ‘Thumb mode’ which is
intended for embedded system applications where memory is a scarce resource. (each
thumb instruction occupies only 2 bytes).
Thumb mode is not currently supported by ARMsim.

More Related Content

What's hot

8086 instruction set
8086 instruction set8086 instruction set
8086 instruction set
Alamin Hossain Miraje
 
microcomputer architecture-Instruction formats
microcomputer architecture-Instruction formatsmicrocomputer architecture-Instruction formats
microcomputer architecture-Instruction formats
lavanya marichamy
 
Arithmetic and logical instructions set
Arithmetic and logical instructions setArithmetic and logical instructions set
Arithmetic and logical instructions set
Robert Almazan
 
8086-instruction-set-ppt
 8086-instruction-set-ppt 8086-instruction-set-ppt
8086-instruction-set-pptjemimajerome
 
ARM lab programs
ARM  lab programs  ARM  lab programs
ARM lab programs
revanasidha janbgi
 
Register transfer language
Register  transfer languageRegister  transfer language
Register transfer language
hamza munir
 
Addressing modes of 8051
Addressing modes of 8051Addressing modes of 8051
Addressing modes of 8051
SARITHA REDDY
 
Arithmetic instructions
Arithmetic instructionsArithmetic instructions
Arithmetic instructions
Robert Almazan
 
microcomputer architecture - Arithmetic instruction
microcomputer architecture - Arithmetic instructionmicrocomputer architecture - Arithmetic instruction
microcomputer architecture - Arithmetic instruction
ramya marichamy
 
Intrl 8086 instruction set
Intrl 8086 instruction setIntrl 8086 instruction set
Intrl 8086 instruction set
edwardkiwalabye1
 
Ch4
Ch4Ch4
Instruction set of 8086 Microprocessor
Instruction set of 8086 Microprocessor Instruction set of 8086 Microprocessor
Instruction set of 8086 Microprocessor
Velalar College of Engineering and Technology
 
Register allocation and assignment
Register allocation and assignmentRegister allocation and assignment
Register allocation and assignment
Karthi Keyan
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
karthiga selvaraju
 
8051 addressing modes
 8051 addressing modes 8051 addressing modes
8051 addressing modesghoshshweta
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
Akhila Rahul
 
10 8086 instruction set
10 8086 instruction set10 8086 instruction set
10 8086 instruction setShivam Singhal
 
8051 addressing modes
8051 addressing modes8051 addressing modes
8051 addressing modes
sb108ec
 

What's hot (20)

8086 instruction set
8086 instruction set8086 instruction set
8086 instruction set
 
microcomputer architecture-Instruction formats
microcomputer architecture-Instruction formatsmicrocomputer architecture-Instruction formats
microcomputer architecture-Instruction formats
 
Arithmetic and logical instructions set
Arithmetic and logical instructions setArithmetic and logical instructions set
Arithmetic and logical instructions set
 
8086-instruction-set-ppt
 8086-instruction-set-ppt 8086-instruction-set-ppt
8086-instruction-set-ppt
 
ARM lab programs
ARM  lab programs  ARM  lab programs
ARM lab programs
 
Register transfer language
Register  transfer languageRegister  transfer language
Register transfer language
 
Addressing modes of 8051
Addressing modes of 8051Addressing modes of 8051
Addressing modes of 8051
 
Al2ed chapter13
Al2ed chapter13Al2ed chapter13
Al2ed chapter13
 
Arithmetic instructions
Arithmetic instructionsArithmetic instructions
Arithmetic instructions
 
microcomputer architecture - Arithmetic instruction
microcomputer architecture - Arithmetic instructionmicrocomputer architecture - Arithmetic instruction
microcomputer architecture - Arithmetic instruction
 
Intrl 8086 instruction set
Intrl 8086 instruction setIntrl 8086 instruction set
Intrl 8086 instruction set
 
Ch4
Ch4Ch4
Ch4
 
Instruction set of 8086 Microprocessor
Instruction set of 8086 Microprocessor Instruction set of 8086 Microprocessor
Instruction set of 8086 Microprocessor
 
Register allocation and assignment
Register allocation and assignmentRegister allocation and assignment
Register allocation and assignment
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
8051 addressing modes
 8051 addressing modes 8051 addressing modes
8051 addressing modes
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
10 8086 instruction set
10 8086 instruction set10 8086 instruction set
10 8086 instruction set
 
Avr instruction set
Avr instruction setAvr instruction set
Avr instruction set
 
8051 addressing modes
8051 addressing modes8051 addressing modes
8051 addressing modes
 

Similar to Armsim (simualtor)

Arm Cortex material Arm Cortex material3222886.ppt
Arm Cortex material Arm Cortex material3222886.pptArm Cortex material Arm Cortex material3222886.ppt
Arm Cortex material Arm Cortex material3222886.ppt
Manju Badiger
 
Arm teaching material
Arm teaching materialArm teaching material
Arm teaching materialJohn Williams
 
UNIT 2 ERTS.ppt
UNIT 2 ERTS.pptUNIT 2 ERTS.ppt
UNIT 2 ERTS.ppt
CHENAGANIMEGHANA
 
07-arm_overview.ppt
07-arm_overview.ppt07-arm_overview.ppt
07-arm_overview.ppt
meenakshi_l
 
ARM Introduction
ARM IntroductionARM Introduction
ARM Introduction
Ramasubbu .P
 
arm-intro.ppt
arm-intro.pptarm-intro.ppt
arm-intro.ppt
MostafaParvin1
 
07-arm_overview.ppt
07-arm_overview.ppt07-arm_overview.ppt
07-arm_overview.ppt
AswathRangaraj1
 
mod 4-2.pptx
mod 4-2.pptxmod 4-2.pptx
mod 4-2.pptx
lekha349785
 
ARM instruction set
ARM instruction  setARM instruction  set
ARM instruction set
Karthik Vivek
 
ARM Fundamentals
ARM FundamentalsARM Fundamentals
ARM Fundamentals
guest56d1b781
 
ARM Micro-controller
ARM Micro-controllerARM Micro-controller
ARM Micro-controller
Ravikumar Tiwari
 
Instruction set
Instruction setInstruction set
Instruction set
Kamini Benare
 
Memory Access Instructions
Memory Access InstructionsMemory Access Instructions
Memory Access Instructions
Sharif Ullah
 
16201104.ppt
16201104.ppt16201104.ppt
16201104.ppt
yibe5
 
Unit II arm 7 Instruction Set
Unit II arm 7 Instruction SetUnit II arm 7 Instruction Set
Unit II arm 7 Instruction Set
Dr. Pankaj Zope
 
ARM Architecture Instruction Set
ARM Architecture Instruction SetARM Architecture Instruction Set
ARM Architecture Instruction Set
Dwight Sabio
 
ARM AAE - Intrustion Sets
ARM AAE - Intrustion SetsARM AAE - Intrustion Sets
ARM AAE - Intrustion Sets
Anh Dung NGUYEN
 

Similar to Armsim (simualtor) (20)

Arm Cortex material Arm Cortex material3222886.ppt
Arm Cortex material Arm Cortex material3222886.pptArm Cortex material Arm Cortex material3222886.ppt
Arm Cortex material Arm Cortex material3222886.ppt
 
Arm teaching material
Arm teaching materialArm teaching material
Arm teaching material
 
Arm teaching material
Arm teaching materialArm teaching material
Arm teaching material
 
UNIT 2 ERTS.ppt
UNIT 2 ERTS.pptUNIT 2 ERTS.ppt
UNIT 2 ERTS.ppt
 
07-arm_overview.ppt
07-arm_overview.ppt07-arm_overview.ppt
07-arm_overview.ppt
 
ARM Introduction
ARM IntroductionARM Introduction
ARM Introduction
 
arm-intro.ppt
arm-intro.pptarm-intro.ppt
arm-intro.ppt
 
07-arm_overview.ppt
07-arm_overview.ppt07-arm_overview.ppt
07-arm_overview.ppt
 
mod 4-2.pptx
mod 4-2.pptxmod 4-2.pptx
mod 4-2.pptx
 
ARM instruction set
ARM instruction  setARM instruction  set
ARM instruction set
 
ARM Fundamentals
ARM FundamentalsARM Fundamentals
ARM Fundamentals
 
ARM Micro-controller
ARM Micro-controllerARM Micro-controller
ARM Micro-controller
 
Lecture9
Lecture9Lecture9
Lecture9
 
Instruction set
Instruction setInstruction set
Instruction set
 
Memory Access Instructions
Memory Access InstructionsMemory Access Instructions
Memory Access Instructions
 
16201104.ppt
16201104.ppt16201104.ppt
16201104.ppt
 
06. thumb instructions
06. thumb instructions06. thumb instructions
06. thumb instructions
 
Unit II arm 7 Instruction Set
Unit II arm 7 Instruction SetUnit II arm 7 Instruction Set
Unit II arm 7 Instruction Set
 
ARM Architecture Instruction Set
ARM Architecture Instruction SetARM Architecture Instruction Set
ARM Architecture Instruction Set
 
ARM AAE - Intrustion Sets
ARM AAE - Intrustion SetsARM AAE - Intrustion Sets
ARM AAE - Intrustion Sets
 

Recently uploaded

English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
BrazilAccount1
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
AhmedHussein950959
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
BrazilAccount1
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
Pipe Restoration Solutions
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
Jayaprasanna4
 

Recently uploaded (20)

English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
 

Armsim (simualtor)

  • 1. ARMSIM 16BEC069 - MANAV KANOJIYA 16BEC070 - VIDHI SHAH 16BEC077 - PRITI KHANDELWAL 16BEC084 - SHREEYA MAKWANA 16BEC100 - SHIVEN PANDYA 16BEC101 - RAHUL BANSAL
  • 2. Courtesy : [1] Architecture Profile A (Architecture) R (Real-time) M (Microcontroller)
  • 4. DIFFERENT ISA FOR ARM ARM THUMB Instructions are always of 32 bit. Instructions are of 16 bit and they can be converted into 32 bit for arm exploit development process. All instructions support the conditional execution. Thumb state can support conditional execution by using IT instruction. All ARM versions support the arm state . Not all versions of ARM support the thumb state. While writing arm shellcode, we need to get rid of null bytes in arm state. Due to availability of 16 bit instructions, it reduces the chances of having null bytes.
  • 6.
  • 7. Flag Description N (Negative) Enabled if result of the instruction yields a negative number. Z (Zero) Enabled if result of the instruction yields a zero value. C (Carry) Enabled if result of the instruction yields a value that requires a 33rd bit to be fully represented. V (Overflow) Enabled if result of the instruction yields a value that cannot be represented in 32 bit two’s complement. E (Endian-bit) ARM can operate either in little endian, or big endian. This bit is set to 0 for little endian, or 1 for big endian mode. T (Thumb-bit) This bit is set if you are in Thumb state and is disabled when you are in ARM state. M (Mode-bits) These bits specify the current privilege mode (USR, SVC, etc.). J (Jazelle) Third execution state that allows some ARM processors to execute Java bytecode in hardware.
  • 8. MNEMONICS IN ARM Instruction Description Instruction Description MOV Move data POP Pop on stack ADD Addition SUB Subtraction MUL Multiplication LSL Logical shift left LSR Logical shift right ASR Arithmetic shift right ROR Rotate right CMP Compare AND Bitwise AND ORR Bitwise OR EOR Bitwise XOR LDR Load STR Store LDM Load multiply STM Store multiply PUSH Push on stack B Branch BL Branch with link BX Branch with exchange BLX Branch with link and exchange SWI/SVC System call MVN Move 2’s complement
  • 9. FORMAT OF ARM INSTRUCTIONS • MNEMONIC{S} {condition} {Rd}, Operand1, Operand2 Where, MNEMONIC : Short name of the instruction {S} : An optional suffix. If S is specified, the condition flags are updated on the result of the operation. {Condition} : Conditions that has to be met for the execution of the instruction. {Rd} : Destination of the register for storing the output of the instruction. Operand1 : First register (either can be a register or an immediate value). Operand2 : Second (Flexible) operand (can be a register or an immediate value with a level of shift).
  • 10. INSTRUCTION EXAMPLES Rx, LSR n Register x with logical shift right by n bits (1 = n = 32) Rx, RRX Register x with rotate right by one bit, with extend ADD R0, R1, R2 Adds contents of R1 (Operand1) and R2 (Operand2 in a form of register) and stores the result into R0 (Rd). MOVLE R0, #5 Moves number 5 (Operand2, because the compiler treats it as MOVE R0, R0, #5) to R0 (Rd) ONLY if the condition LE (Less Than or Equal) is satisfied.
  • 11. LOAD AND STORE • ARM uses Load-store model for memory access • On ARM data is must be moved from memory into registers before being operated on. • This means that incrementing a 32-bit value at a particular address into register, increment it within the register, and store it back to the memory from register.
  • 12. DATA TYPES WITH THE INSTRUCTIONS LOAD AND STORE: • ldr = Load Word • ldrh = Load unsigned Half Word • ldrsh = Load signed Half Word • ldrb = Load unsigned Byte • ldrsb = Load signed Bytes • str = Store Word • strh = Store unsigned Half Word • strsh = Store signed Half Word • strb = Store unsigned Byte • strsb = Store signed Byte
  • 13. ADDRESS MODES Three basic offset forms with different address modes for each offset form. 1. Offset form: Immediate value as the offset • Offset mode uses an immediate as offset Example: ldr r3,[r1,#3] 2. Offset form: Register as the offset • Offset mode uses a register as offset Example: ldr r3,[r1,r2] 3. Offset form: scaled register as the offset • Offset mode uses a scaled register as offset Example: ldr r3,[r1,r2,LSL#2]
  • 14. BRANCHES Branches (aka Jumps) allow us to jump to another code segment. This is useful when we need to skip (or repeat) blocks of codes or jump to a specific function. Best examples of such a use case are IFs and Loops. So let’s look into the IF case first. There are three types of branching instructions: • Branch (B) • Simple jump to a function • Branch link (BL) • Saves (PC+4) in LR and jumps to function • Branch exchange (BX) and Branch link exchange (BLX) • Same as B/BL + exchange instruction set (ARM <-> Thumb) • Needs a register as first operand: BX/BLX reg
  • 15. CONDITIONAL EXECUTION Condition Code Meaning (for cmp or subs) Status of Flags EQ Equal Z==1 NE Not Equal Z==0 GT Signed Greater Than (Z==0) && (N==V) LT Signed Less Than N!=V GE Signed Greater Than or Equal N==V LE Signed Less Than or Equal (Z==1) || (N!=V) CS or HS Unsigned Higher or Same (or Carry Set) C==1 CC or LO Unsigned Lower (or Carry Clear) C==0 • Branches can also be executed conditionally and used for branching to a function if a specific condition is met.
  • 16. ARMSIM • ARMsim is a desktop application, it allows users to simulate the execution of ARM assembly language programs on a system based on the ‘ARM7TDMI’ processor. • ARMsim includes both an assembler and a linker. However editor is not there, so file must be loaded into the application. • The file to be opened must be a source (.s) file or an object (.o) file.
  • 17. ARMSIM LIMITATION • The ARM architecture supports both little‐endian and big‐endian access to memory. But the ARMsim supports only the little‐endian format. • The ARM architecture has a special mode of execution called ‘Thumb mode’ which is intended for embedded system applications where memory is a scarce resource. (each thumb instruction occupies only 2 bytes). Thumb mode is not currently supported by ARMsim.