table of contents
- unstable 6.0.4+dfsg-1
- experimental 6.0.2+dfsg-1
| RASM2(1) | General Commands Manual | RASM2(1) |
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.
-aarch- Set architecture plugin
-A- Show analysis information of given hexpair string
-bbits- Set architecture bits (8, 16, 32, 64)
-B- Binary input/output (-l is mandatory for binary input)
-ccpu- 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
-ffile- Read data from file instead of ARG
-Fparser- 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
-ilen- Ignore/skip N bytes from the beginning of the input buffer
-j- Output in json format
-kkernel- Select operating system (linux, windows, darwin, android, ios, ...)
-llen- Input/Output length
-L[name]- List RArch plugins: (a=asm, d=disasm, e=esil)
-LL[name]- List RAsm parse plugins
-N- Don't load any plugin, same as R2_NOPLUGINS=1 or r2 -N
-oofile- 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
-saddr- Define initial start/seek address (default 0)
-@addr- Alias for -s
-Ssyntax- 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_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¶
AUTHORS¶
pancake <pancake@nopcode.org>
| July 10, 2025 |