RZ-ASM(1)

πŸ“¦
version 0.8.2 Β· 3 versions
, in arch rolling, nixos 26.05

🌸 NAME 🌸

okay so, bestie, this is rz-asm β€” the rizin assembler and disassembler tool, and yes, this is the manual page for RZ_ASM(1). πŸ’…


✨ SYNOPSIS ✨

the whole vibe in one line, no cap:

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 πŸ’–

okay so 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. ✨

🚩 flags, flags, flags 🚩

  • -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 πŸŽ€

these are the little dot-directives, and they are lowkey iconic:

  • .intel_syntax β€” Use Intel syntax rather than AT&T
  • .att_syntax β€” Use AT&T syntax rather than Intel
  • .align number β€” Set the code or data alignment
  • .arch name β€” Set the code architecture
  • .arm β€” Set the ARM mode (as opposed to Thumb) for ARM architecture
  • .ascii string β€” Define the ASCII string
  • .asciz string β€” Define the zero-ending ASCII string
  • .bits number β€” Define the code bitness
  • .big_endian β€” Set the BE (big endian) byte order
  • .cpu name β€” Set the CPU for the chosen architecture
  • .data β€” Mark the start of the data section
  • .endian 1|0 β€” Set the endianness (the byte order) β€” 1 is BE, 0 is LE
  • .equ name value β€” Define the constant
  • .fill repeat,size,value β€” Fill the data with the repeating value pattern
  • .hex data β€” Define the data in hexadecimal format
  • .incbin filename β€” Include binary file
  • .int16 number β€” Define 16-bit integer
  • .int32 number β€” Define 32-bit integer
  • .int64 number β€” Define 64-bit integer
  • .kernel name β€” Set the kernel for syscalls
  • .little_endian β€” Set the LE (little endian) byte order
  • .org value β€” Set the value of the PC (Program Counter) register
  • .os name β€” Set the operating system for syscalls
  • .short number β€” Define 16-bit integer
  • .string string β€” 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 πŸ¦‹

the env var squad, bestie:

  • 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 🌈

the whole squad: 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

πŸ’– that's the whole page, bestie β€” RZ_ASM(1), dated Jan 22, 2024, signing off. πŸŽ€βœ¨

πŸ“¦ where this page comes from
  • arch rolling: rizin 0.8.2-2 Β· Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND CC-PDDC AND CC0-1.0 AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-only AND GPL-3.0-or-later AND LGPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND LGPL-3.0-only AND MIT
  • nixos 26.05: rizin 0.8.2
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms