Reference

rasm2(1)

Radare2 Assembler and Disassembler Tool

NAME

rasm2 – Radare2 Assembler and Disassembler Tool

SYNOPSIS

rasm2 [-ACdDehHjLvwrNqxp] [-a arch] [-b bits] [-c cpu] [-F parser] [-k kernel] [-o ofile] [-s addr] [-@ addr] [-S syntax] [-i len] [-l len] [code|hex|-]

DESCRIPTION

Assembles and disassembles code or hexpair strings for multiple architectures and syntax formats.

-a arch

Set architecture plugin

-A

Show analysis information of given hexpair string

-b bits

Set architecture bits (8, 16, 32, 64)

-B

Binary input/output (-l is mandatory for binary input)

-c cpu

Select specific CPU (depends on -a arch)

-C

Output in C format

-d

Disassemble hexpair bytes. rasm2 -d 9090

-D

Disassemble showing hexpair and opcode

-e

Use big endian instead of little endian

-E

Output disassembled instructions in ESIL format

-f file

Read data from file instead of ARG

-F parser

Specify parse plugin to be used (pseudo)

-h

Show usage help message

-hh

Show long help message including supported assembler directives

-H [var]

Display variable

-i len

Ignore/skip N bytes from the beginning of the input buffer

-j

Output in json format

-k kernel

Select operating system (linux, windows, darwin, android, ios, ...)

-l len

Input/Output length

-L [name]

List RArch plugins: (a=asm, d=disasm, e=esil, p=parse)

-LL [name]

List RAsm parse plugins

-N

Don't load any plugin, same as R2_NOPLUGINS=1 or r2 -N

-o ofile

Output to file, for example 'rasm2 -Bf a.asm'

-p

Run SPP over input for assembly

-q

Quiet output (handy for -L, -v, ...)

-r

Show output in r2 script

-s addr

Define initial start/seek address (default 0)

-@ addr

Alias for -s

-S syntax

Select syntax output (intel, att, masm, ...)

-v

Show version information

-w

Describe opcode (what's op)

-x

Use hex dwords instead of hexpairs in the assembler output

ENVIRONMENT

R2_NOPLUGINS

Do not load shared plugins (speedup loading)

R2_PLUGINS_ORDER

Plugin load order: i=internal, e=env, h=home, s=system; default=iehs; ? prints help

R2_LOG_LEVEL

Change the log level

R2_DEBUG

If defined, show error messages and crash signal

R2_DEBUG_ASSERT

Enables runtime assertions for debugging

RASM2_ARCH

Same as rasm2 -a

RASM2_BITS

Same as rasm2 -b

DIRECTIVES

List the supported assembler and preprocessor directives with:

$ rasm2 -hh

EXAMPLES

Assemble opcode:

$ rasm2 -a x86 -b 32 'mov eax, 33'

Disassemble opcode:

$ rasm2 -d 90

Show all supported architectures:

$ rasm2 -L

Assemble with specific syntax:

$ rasm2 -a x86 -b 32 -S att 'mov eax, 33'

Output in JSON format:

$ rasm2 -j -a x86 -b 32 'mov eax, 33'

Use big endian:

$ rasm2 -e -a arm -b 32 'add r0, r0, r1'

Disassemble and show ESIL output:

$ rasm2 -d -E 90

SEE ALSO

radare2(1)

AUTHORS

pancake <[email protected]>

History

-@ since Arch Linux 2026-11-01; -A since Arch Linux 2026-11-01; -E since Arch Linux 2026-11-01; -H since Arch Linux 2026-11-01; -LL since Arch Linux 2026-11-01; -N since Arch Linux 2026-11-01; -S since Arch Linux 2026-11-01; -c since Debian 8 (Jessie); -hh since Arch Linux 2026-11-01; -i since Debian 8 (Jessie); -j since Arch Linux 2026-11-01; -k since Arch Linux 2026-11-01; -p since Arch Linux 2026-11-01; -q since Arch Linux 2026-11-01; -r since Arch Linux 2026-11-01; -v since Arch Linux 2026-11-01; -w since Debian 8 (Jessie); -x since Arch Linux 2026-11-01.