Reverse Engineeringdisassemblymulti-architecturecstoolhexmalware-analysis

Capstone

Capstone is a lightweight multi-platform, multi-architecture disassembly framework. It provides a command-line tool cstool to disassemble hexadecimal strings.

Description

Capstone is designed for disassembling code across numerous hardware architectures including ARM, ARM64, BPF, Ethereum VM, M68K, M680X, Mips, MOS65XX, PPC, RISC-V, SH, Sparc, SystemZ, TMS320C64X, TriCore, Webassembly, XCore, and X86 (16/32/64-bit). The framework offers a clean, intuitive API and provides detailed instruction information such as implicit registers read and written, making it suitable for advanced analysis tasks.

The cstool command-line tool enables users to disassemble hexadecimal strings directly from the terminal, supporting various architectures and modes like big-endian ARM or AT&T syntax for X86. This is particularly useful for quick disassembly tasks in reverse engineering workflows.

Capstone's high performance and thread-safe design make it ideal for malware analysis, capable of handling complex X86 malware techniques. It supports embedding into firmware or OS kernels and is distributed under the BSD license with bindings for numerous programming languages.

How It Works

Capstone operates as a disassembly engine that takes hexadecimal input strings representing machine code and outputs disassembled instructions with detailed semantics. It supports multiple architectures through its architecture-neutral API implemented in pure C. The cstool tool processes input via specified architecture-mode combinations (e.g., x64, armbe), applying options like SKIPDATA mode or unsigned immediates. Instructions are decomposed with details on registers accessed and syntax variants like AT&T for X86.

Installation

bash
sudo apt install capstone-tool

Flags

-dshow detailed information of the instructions
-sdecode in SKIPDATA mode
-ushow immediates as unsigned
-vshow version & Capstone core build info

Examples

Display help and syntax information for cstool including supported architecture modes
cstool -h
Disassemble hexadecimal string in 64-bit X86 mode
cstool x64 <assembly-hexstring>
Disassemble hexadecimal string in 32-bit X86 mode using AT&T syntax
cstool x32att <assembly-hexstring>
Disassemble hexadecimal string in ARM architecture
cstool arm <assembly-hexstring>
Disassemble hexadecimal string in ARM big-endian mode
cstool armbe <assembly-hexstring>
Disassemble hexadecimal string in 64-bit X86 mode with detailed instruction information
cstool -d x64 <assembly-hexstring>
Disassemble 16-bit X86 hexadecimal string starting at address 0x1000
cstool x16 <assembly-hexstring> 0x1000
Updated 2026-04-16kali.org ↗