🏳️
The CTF Recipes
  • Introduction
  • Cryptography
    • Introduction
    • General knowledge
      • Encoding
        • Character encoding
          • ASCII
          • Unicode
          • UTF-8
        • Data encoding
          • Base16
          • Base32
          • Base64
      • Maths
        • Modular arithmetic
          • Greatest Common Divisor
          • Fermat's little theorem
          • Quadratic residues
          • Tonelli-Shanks
          • Chinese Remainder Theorem
          • Modular binomial
      • Padding
        • PKCS#7
    • Misc
      • XOR
    • Mono-alphabetic substitution
      • Index of coincidence
      • frequency analysis
      • Well known algorithms
        • 🔴Scytale
        • 🔴ROT
        • 🔴Polybe
        • 🔴Vigenere
        • 🔴Pigpen cipher
        • 🔴Affine cipher
    • Symmetric Cryptography
      • AES
        • Block Encryption procedure
          • Byte Substitution
          • Shift Row
          • Mix Column
          • Add Key
          • Key Expansion / Key Schedule
        • Mode of Operation
          • ECB
            • Block shuffling
              • Challenge example
            • ECB Oracle
              • Challenge example
          • CBC
            • Bit flipping
              • Challenge example
            • Padding oracle
              • Challenge example
          • OFB
            • Key stream reconstruction
            • Encrypt to Uncrypt
  • 🛠️Pwn
    • General knowledge
      • STACK
        • Variables storage
        • Stack frame
      • PLT and GOT
      • HEAP
        • HEAP operations
        • Chunk
        • Bins
        • Chunk allocation and reallocation
      • Syscall
    • Architectures
      • aarch32
        • Registers
        • Instruction set
        • Calling convention
      • aarch64
        • Registers
        • Instruction set
        • Calling convention
      • mips32
        • Registers
        • Instruction set
        • Calling convention
      • mips64
        • Registers
        • Instruction set
        • Calling convention
      • x86 / x64
        • Registers
        • Instruction set
        • Calling convention
    • Stack exploitation
      • Stack Buffer Overflow
        • Dangerous functions
          • gets
          • memcpy
          • sprintf
          • strcat
          • strcpy
        • Basics
          • Challenge example
        • Instruction pointer Overwrite
          • Challenge example
        • De Bruijn Sequences
        • Stack reading
          • Challenge example
      • Format string
        • Dangerous functions
          • printf
          • fprintf
        • Placeholder
        • Data Leak
          • Challenge example
        • Data modification
          • Challenge example
      • Arbitrary code execution
        • Shellcode
        • ret2reg
        • Code reuse attack
          • Ret2plt
          • Ret2dlresolve
          • GOT Overwrite
          • Ret2LibC
          • Leaking LibC
          • Ret2csu
          • Return Oriented Programming - ROP
          • Sigreturn Oriented Programming - SROP
          • Blind Return Oriented Programming - BROP
            • Challenge example
          • 🔴Call Oriented Programming - COP
          • 🔴Jump Oriented Programming - JOP
          • One gadget
        • Stack pivoting
    • 🛠️Heap exploitation
      • Heap overflow
        • Challenge example
      • Use after free
        • Challenge example
      • 🛠️Double free
      • 🔴Unlink exploit
    • Protections
      • Stack Canaries
      • No eXecute
      • PIE
      • ASLR
      • RELRO
    • Integer overflow
Powered by GitBook
On this page
  • Data porcessing
  • Load/Store
  • Control flow
  • Exception-generating
  • Synchronization
  • System
  1. Pwn
  2. Architectures
  3. aarch32

Instruction set

The aarch32 instruction set is divided into several categories, each of which serves a specific purpose. The main categories of instructions in aarch32 include:

Category
Description

Data processing

Perform arithmetic and logical operations on data

Load/store

Move data between memory and registers

Control flow

Control the flow of execution in a program

Exception-generating

Trigger exceptions or interrupts

Synchronization

Manage concurrent access to shared data

System

Access system resources or perform other privileged operations

This is just a brief overview of some of the main instruction categories in the aarch32 ISA. There are many other instruction categories and specific instructions within each category, each of which serves a specific purpose and can be used in various ways to implement a given algorithm or program.

Data porcessing

Instruction
Description

ADD

Add two registers or a register and an immediate value

SUB

Subtract two registers or a register and an immediate value

MUL

Multiply two registers

DIV

Divide two registers

AND

Perform a bitwise AND operation on two registers or a register and an immediate value

OR

Perform a bitwise OR operation on two registers or a register and an immediate value

XOR

Perform a bitwise XOR operation on two registers or a register and an immediate value

NOT

Perform a bitwise NOT operation on a register

SHL

Shift the bits in a register to the left by a specified number of positions

SHR

Shift the bits in a register to the right by a specified number of positions

Note that this is not an exhaustive list of data processing instructions in the aarch32 instruction set. There are many other instructions that can be used to perform a wide range of operations on data. The specific instructions available and their exact behavior may vary depending on the implementation of the aarch32 instruction set.

Load/Store

Instruction
Description

LDR

Load a word from memory into a register

STR

Store a word from a register into memory

LDRSB

Load a signed byte from memory into a register

LDRSH

Load a signed half-word from memory into a register

LDRB

Load an unsigned byte from memory into a register

LDRH

Load an unsigned half-word from memory into a register

STB

Store a byte from a register into memory

STH

Store a half-word from a register into memory

Note that this is not an exhaustive list of load/store instructions in the aarch32 instruction set. There are many other instructions that can be used to load and store data from memory using a variety of addressing modes and data types. The specific instructions available and their exact behavior may vary depending on the implementation of the aarch32 instruction set.

Control flow

Instruction
Description

B

Unconditionally branch to a specified address

BEQ

Branch to a specified address if two registers are equal

BNE

Branch to a specified address if two registers are not equal

BL

Branch to a specified address and save the return address in a register

BLE

Branch to a specified address if the value in a register is less than or equal to zero

BLX

Branch to a specified address and switch to Thumb mode

BX

Branch to a specified address and switch to ARM mode

Note that this is not an exhaustive list of control flow instructions in the aarch32 instruction set. There are many other instructions that can be used to control the flow of execution in a program, such as conditional branches and subroutine calls. The specific instructions available and their exact behavior may vary depending on the implementation of the aarch32 instruction set.

Exception-generating

Instruction
Description

SVC

Trigger a supervisor call (SVC) exception

BKPT

Trigger a breakpoint exception

HVC

Trigger a hypervisor call (HVC) exception

Note that this is not an exhaustive list of exception-generating instructions in the aarch32 instruction set. There are many other instructions that can be used to trigger different types of exceptions or interrupts, such as data abort and undefined instruction exceptions. The specific instructions available and their exact behavior may vary depending on the implementation of the aarch32 instruction set.

Synchronization

Instruction
Description

DMB

Ensure that all memory accesses before this instruction have completed before any memory accesses after this instruction are performed

DSB

Ensure that all memory accesses before this instruction have completed before the processor can execute any subsequent instructions

ISB

Ensure that all instructions before this instruction have completed before any subsequent instructions are executed

Note that this is not an exhaustive list of synchronization instructions in the aarch32 instruction set. There are many other instructions that can be used to manage concurrent access to shared data by multiple threads or processes. The specific instructions available and their exact behavior may vary depending on the implementation of the aarch32 instruction set.

System

Instruction
Description

MRS

Read the value of a system register into a register

MSR

Write a value to a system register from a register

CPS

Change the current processor mode or the state of interrupts

SYS

Perform a privileged operation or access a system resource

Note that this is not an exhaustive list of system instructions in the aarch32 instruction set. There are many other instructions that can be used to access system resources or perform other privileged operations. The specific instructions available and their exact behavior may vary depending on the implementation of the aarch32 instruction set.

PreviousRegistersNextCalling convention

Last updated 2 years ago

🛠️