rz-asm1
Rizin assembler and disassembler tool
Usage
rz-asm [-ABCdDeIEhjLpqrvxw]
[-a
arch]
[-b
bits]
[-m
plugin]
[-c
CPU]
[-O
file]
[-o
addr]
[-@
addr]
[-f
file]
[-F
in:out]
[-i
len]
[-k
kernel]
[-s
syntax]
[-l
len]
Overview
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.
-
-a arch -
Set architecture to assemble/disassemble (see -L)
-
-A -
Show analysis information from given hexpairs
-
-b bits -
Set CPU register size (8, 16, 32, 64) (RZ_ASM_BITS)
-
-B -
Binary input/output (-l is mandatory for binary input)
-
-c CPU -
Select specific CPU (depends on the arch)
-
-C -
Output in C format
-
-d, -D -
Disassemble from hexpair bytes (-D show hexpairs)
-
-e -
Use big endian instead of little endian
-
-I -
Display lifted RzIL code (same input as in -d, IL is also validated)
-
-E -
Display ESIL expression (same input as in -d)
-
-f file -
Read data from file
-
-F in:out -
Specify input and/or output filters (att2intel, x86.pseudo, ...)
-
-h, -hh -
Show usage help message, hh for long
-
-i len -
Ignore N bytes of the input buffer
-
-j -
Output in JSON format
-
-k kernel -
Select operating system (linux, windows, darwin, ..)
-
-l len -
Input/Output length
-
-L -
List asm plugins: (a=asm, d=disasm, A=analyze, e=ESIL)
-
-m plugin -
List supported CPUs for the chosen plugin
-
-o, -@ addr -
Set start address for code (default 0)
-
-O file -
Output file name (rz-asm -Bf a.asm -O a)
-
-p -
Run SPP over input for assembly
-
-q -
Quiet mode
-
-r -
Output in rizin commands
-
-s syntax -
Select syntax (intel, att)
-
-v -
Show version information
-
-x -
Use hex dwords instead of hex pairs when assembling
-
-w -
Describe opcode
Directives
.intel_syntax-
Use Intel syntax rather than AT&T
.att_syntax-
Use AT&T syntax rather than Intel
.alignnumber-
Set the code or data alignment
.archname-
Set the code architecture
.arm-
Set the ARM mode (as opposed to Thumb) for ARM architecture
.asciistring-
Define the ASCII string
.ascizstring-
Define the zero-ending ASCII string
.bitsnumber-
Define the code bitness
.big_endian-
Set the BE (big endian) byte order
.cpuname-
Set the CPU for the chosen architecture
.data-
Mark the start of the data section
.endian1|0-
Set the endianness (the byte order) - 1 is BE, 0 is LE
.equname value-
Define the constant
.fillrepeat,size,value-
Fill the data with the repeating value pattern
.hexdata-
Define the data in hexadecimal format
.incbinfilename-
Include binary file
.int16number-
Define 16-bit integer
.int32number-
Define 32-bit integer
.int64number-
Define 64-bit integer
.kernelname-
Set the kernel for syscalls
.little_endian-
Set the LE (little endian) byte order
.orgvalue-
Set the value of the PC (Program Counter) register
.osname-
Set the operating system for syscalls
.shortnumber-
Define 16-bit integer
.stringstring-
Define the ASCII string
.text-
Mark the start of the text section
.thumb-
Set the Thumb mode (as opposed to ARM) for ARM architecture
Environment
RZ_ARCH: e asm.arch - architecture to assemble/disassemble (same as rz-asm -a)
RZ_ASM_ARCH: architecture to assemble/disassemble (same as rz-asm -a)
RZ_ASM_BITS: cpu register size (8, 16, 32, 64) (same as rz-asm -b)
RZ_BITS: e asm.bits - cpu register size (8, 16, 32, 64) (same as rz-asm -b)
RZ_DEBUG: if defined, show error messages and crash signal0
RZ_NOPLUGINS: do not load shared plugins (speedup loading)0
Examples
Assemble opcode:
rz-asm -a x86 -b 32 'mov eax, 33'
Disassemble opcode:
rz-asm -d 90