RZ_ASM(1) General Commands Manual RZ_ASM(1)

rz-asmrizin assembler and disassembler tool

rz-asm [-ABCdDeIEhjLpqrvxw] [-a arch] [-b bits] [-c CPU] [-O file] [-o addr] [-@ addr] [-f file] [-F in:out] [-i len] [-k kernel] [-s syntax] [-l len]

This command is part of the Rizin project.

This tool uses RzAsm to assemble and disassemble files or hexpair strings. It supports a large list of architectures which can be listed using the -L flag.

arch
Set architecture to assemble/disassemble (see -L)
Show analysis information from given hexpairs
bits
Set CPU register size (8, 16, 32, 64) (RZ_ASM_BITS)
Binary input/output (-l is mandatory for binary input)
CPU
Select specific CPU (depends on the arch)
Output in C format
-D
Disassemble from hexpair bytes (-D show hexpairs)
Use big endian instead of little endian
Display lifted RzIL code (same input as in -d, IL is also validated)
Display ESIL expression (same input as in -d)
file
Read data from file
in:out
Specify input and/or output filters (att2intel, x86.pseudo, ...)
-hh
Show usage help message, hh for long
len
Ignore N bytes of the input buffer
Output in JSON format
kernel
Select operating system (linux, windows, darwin, ..)
len
Input/Output length
List asm plugins: (a=asm, d=disasm, A=analyze, e=ESIL)
-@ addr
Set start address for code (default 0)
file
Output file name (rz-asm -Bf a.asm -O a)
Run SPP over input for assembly
Quiet mode
Output in rizin commands
syntax
Select syntax (intel, att)
Show version information
Use hex dwords instead of hex pairs when assembling
Describe opcode

Use Intel syntax rather than AT&T
Use AT&T syntax rather than Intel
number
Set the code or data alignment
name
Set the code architecture
Set the ARM mode (as opposed to Thumb) for ARM architecture
string
Define the ASCII string
string
Define the zero-ending ASCII string
number
Define the code bitness
Set the BE (big endian) byte order
name
Set the CPU for the chosen architecture
Mark the start of the data section
1|0
Set the endianness (the byte order) - 1 is BE, 0 is LE
name value
Define the constant
repeat,size,value
Fill the data with the repeating value pattern
data
Define the data in hexadecimal format
filename
Include binary file
number
Define 16-bit integer
number
Define 32-bit integer
number
Define 64-bit integer
name
Set the kernel for syscalls
Set the LE (little endian) byte order
value
Set the value of the PC (Program Counter) register
name
Set the operating system for syscalls
number
Define 16-bit integer
string
Define the ASCII string
Mark the start of the text section
Set the Thumb mode (as opposed to ARM) for ARM architecture

Assemble opcode:

rz-asm -a x86 -b 32 'mov eax, 33'

Disassemble opcode:

rz-asm -d 90

rizin(1), rz-find(1), rz-hash(1), rz-bin(1), rz-diff(1), rz-gg(1), rz-run(1), rz-ax(1),

pancake <pancake@nopcode.org>

byteninjaa0

January 22, 2024