table of contents
| RZ_ASM(1) | General Commands Manual | RZ_ASM(1) |
NAME¶
rz-asm — rizin
assembler and disassembler tool
SYNOPSIS¶
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] |
DESCRIPTION¶
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.
-aarch- Set architecture to assemble/disassemble (see -L)
-A- Show analysis information from given hexpairs
-bbits- Set CPU register size (8, 16, 32, 64) (RZ_ASM_BITS)
-B- Binary input/output (-l is mandatory for binary input)
-cCPU- 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)
-ffile- Read data from file
-Fin:out- Specify input and/or output filters (att2intel, x86.pseudo, ...)
-h,-hh- Show usage help message, hh for long
-ilen- Ignore N bytes of the input buffer
-j- Output in JSON format
-kkernel- Select operating system (linux, windows, darwin, ..)
-llen- Input/Output length
-L- List asm plugins: (a=asm, d=disasm, A=analyze, e=ESIL)
-mplugin- List supported CPUs for the chosen plugin
-o,-@addr- Set start address for code (default 0)
-Ofile- 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
-ssyntax- 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
SEE ALSO¶
rizin(1), rz-find(1), rz-hash(1), rz-bin(1), rz-diff(1), rz-gg(1), rz-run(1), rz-ax(1),
AUTHORS¶
pancake <pancake@nopcode.org>
byteninjaa0
| January 22, 2024 |