All Projects → MahdiSafsafi → Azote

MahdiSafsafi / Azote

Licence: MPL-2.0 license
Fast and lightweight AArch64 disassembler.

Programming Languages

pascal
1382 projects
assembly
5116 projects

Projects that are alternatives of or similar to Azote

Reko
Reko is a binary decompiler.
Stars: ✭ 942 (+3825%)
Mutual labels:  arm, disassembler, aarch64
opcodesDB
x86-64 | ARM (AArch32/AArch64/THUMB) full instruction set.
Stars: ✭ 49 (+104.17%)
Mutual labels:  arm, opcodes, aarch64
asm2cfg
Python command-line tool and GDB extension to view and save x86, ARM and objdump assembly files as control-flow graph (CFG) pdf files
Stars: ✭ 42 (+75%)
Mutual labels:  arm, disassembler
Amie
A Minimalist Instruction Extender for the ARM architecture and IDA Pro
Stars: ✭ 136 (+466.67%)
Mutual labels:  arm, aarch64
Mandibule
linux elf injector for x86 x86_64 arm arm64
Stars: ✭ 171 (+612.5%)
Mutual labels:  arm, aarch64
Docker Homebridge
Homebridge Docker. HomeKit support for the impatient using Docker on x86_64, Raspberry Pi (armhf) and ARM64. Includes ffmpeg + libfdk-aac.
Stars: ✭ 1,847 (+7595.83%)
Mutual labels:  arm, aarch64
Build
Armbian Linux build framework
Stars: ✭ 1,827 (+7512.5%)
Mutual labels:  arm, aarch64
Computelibrary
The Compute Library is a set of computer vision and machine learning functions optimised for both Arm CPUs and GPUs using SIMD technologies.
Stars: ✭ 2,123 (+8745.83%)
Mutual labels:  arm, aarch64
Archiso Pbp
archiso customized for the Pinebook Pro
Stars: ✭ 52 (+116.67%)
Mutual labels:  arm, aarch64
Doesitarm
🦾 A list of reported app support for Apple Silicon and the new Apple M1 Macs
Stars: ✭ 3,200 (+13233.33%)
Mutual labels:  arm, aarch64
Simdjson
Parsing gigabytes of JSON per second
Stars: ✭ 15,115 (+62879.17%)
Mutual labels:  arm, aarch64
Talks
schedule and materials about my presentations
Stars: ✭ 245 (+920.83%)
Mutual labels:  arm, aarch64
Bin2llvm
A binary to LLVM translator
Stars: ✭ 108 (+350%)
Mutual labels:  arm, disassembler
Bap
Binary Analysis Platform
Stars: ✭ 1,385 (+5670.83%)
Mutual labels:  arm, disassembler
alpine-qbittorrent-openvpn
qBittorrent docker container with OpenVPN client running as unprivileged user on alpine linux
Stars: ✭ 230 (+858.33%)
Mutual labels:  arm, aarch64
Cluster
Arm and Equinix Metal have partnered to make powerful Neoverse based Armv8 bare metal infrastructure including latest generation Ampere and Marvell systems — available for open source software developers to build, test and optimize for Arm64 architecture.
Stars: ✭ 60 (+150%)
Mutual labels:  arm, aarch64
Cross
“Zero setup” cross compilation and “cross testing” of Rust crates
Stars: ✭ 2,461 (+10154.17%)
Mutual labels:  arm, aarch64
rsync-static
Static RSync binaries compiled for x86, ARM, and ARM64. Useful for running on Android. Built daily
Stars: ✭ 40 (+66.67%)
Mutual labels:  arm, aarch64
Redasm
The OpenSource Disassembler
Stars: ✭ 1,042 (+4241.67%)
Mutual labels:  arm, disassembler
Openwrt Node Packages
OpenWrt Project Node.js packages. v10.x LTS and v12.x LTS and v14.x LTS
Stars: ✭ 176 (+633.33%)
Mutual labels:  arm, aarch64

Azote

Azote is the faster and lightweight disassembler for AArch64.

TODO

  • Add AArch32 support.
  • Add x86 support.
  • Possibly SVE extension support ?

Features

  • Extremely fast and tinny in size.
  • Supports all instructions of ARMv8.3 including (SIMD, NEON, FP16,...).
  • No dependencies on platform specific APIs (it should run on all platforms).
  • Supports switching to aliases instructions.
  • Supports FPC and Delphi.
  • For each decoded instruction, it provides all the necessary info for a good analysis.
  • Built with unique feature "Patches" which explains why it's fast and lightweight.

Fast & lightweight

ADT

Azote decodes instructions based on highly optimized arbitrary decision tree (ADT) which was generated using the same algorithm uses by GNU Binutils. However, I improved it to fits Azote needs as follow:

  • Uses single instruction for testing (only test) rather than three instruction (mov,shift and test). As a result, the generated code remains small and faster.
  • When the last node is not sealed, the tree shots the instruction that has the highest number of set bits of its mask. As a result, the disasm guarantees that it will never confuse between two similar instruction. Also, when disassembling, it will never waste time to do semantic checks that allow to distinguish between those two instructions.
  • The same rules above applies to aliases instructions.

Patches

While current available solutions push instructions variants into their tables and decode operands based on a search of pattern match between the instruction and the variant. Azote does not do that! Azote decodes operands against the standard decoder and applies patches to fix the result (patches were already generated on the fly). As a result:

  • Azote's table remains small because it does not contain instruction variants.
  • Operands decoding is highly faster because it never wastes time to iterate through variants and tries to match variant's pattern.

Analys

Very suitable for analysis. For example, we decode 0x8B348331 opcode.

var 
  Insn: TA64Instruction;
begin
  FillChar(Insn, SizeOf(TA64Instruction), #00);
  Insn.OpCode := $8B348331;
  DecodeInstruction(Insn);
end;

After decoding it, it outputs the following info:

IID           = INSN_ADD
OpCode        = 2335474481 {$8B348331}
Condition     = cdNone
IClass        = c_addsub_ext
Syntax        = 'add x17, x25, w20, sxtb'
OperandCount  = 3
Operands[0]   = {Flags:[ofDestination]; OperandType:otRegister; Register:REG_X17}
Operands[1]   = {Flags:[]; OperandType:otRegister; Register:REG_X25}
Operands[2]   = {Flags:[ofShifter]; OperandType:otRegister; Register:REG_W20; Shifter:sfSxtb; Amount:0}
Options       = []
UserTag       = 0

Command line tool

  • Usage: Azote [Command] [Options] [...]
  • Command:
    • -h = Display help.
    • -d = Disasm.
  • Options:
    • -L = Little Endian.
    • -B = Big Endian.
  • e.g: Azote -d -B "0x0B8754C5 0x8B2D6074 0xCB3333F4 0x4D4079EF 0x4CDF6C20 0x4E608400"

Benchmarks

Decoding 7 million random instructions without printing: bm1

Decoding 7 million random instructions with printing: bm2

As you can see, it's very fast to decode instructions. However, printing instructions slow down the process and that because Azote uses Delphi string instead of PChar. I believe I can improve the process up to [40%-60%] if I switch to PChar. But for now, I will stick with string type.

Tests

While Azote currently is in beta phase, it was able to validate mostly all LLVM tests (95%). Because tests were automatically converted from LLVM to DUnitX, some of them escaped from the patterns match. Also, I got some false positive result with few of them (e.g: ins vs mov instruction where Azote always decodes the preferred form 'mov').

Supported compilers and platforms.

  • Azote was designed to be a cross-platform library. For now, I tested it only on windows.
  • It compiles under Delphi and FPC: Tested on FPC(3.0.2) and Delphi(10.2).

Please give feedback on this area.

Docs

Please refer to the Wiki page. And take a look to the included demos.

Credits

  • ARM (for opening their specification).
  • LLVM (for tests).
  • Binutils (for ADT).
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].