From 69a9b851f9b5266a3955a6d0d42fd74c99e81116 Mon Sep 17 00:00:00 2001 From: Anton Kochkov Date: Fri, 2 Feb 2024 23:22:50 +0800 Subject: [PATCH] Improve man pages formatting (#4182) --- binrz/man/rz-asm.1 | 67 +++++++++++++++++++++++---------- binrz/man/rz-bin.1 | 18 ++++----- binrz/man/rz-diff.1 | 92 +++++++++++++++++++++++++++++---------------- 3 files changed, 117 insertions(+), 60 deletions(-) diff --git a/binrz/man/rz-asm.1 b/binrz/man/rz-asm.1 index 2780907bbe9..bd4dc3dbb55 100644 --- a/binrz/man/rz-asm.1 +++ b/binrz/man/rz-asm.1 @@ -86,37 +86,66 @@ Describe opcode Use Intel syntax rather than AT&T .It Ic .att_syntax Use AT&T syntax rather than Intel -.It Ic string -.It Ic .align -.It Ic .arch +.It Ic .align Ar number +Set the code or data alignment +.It Ic .arch Ar name +Set the code architecture .It Ic .arm -.It Ic .ascii -.It Ic .bits +Set the ARM mode (as opposed to Thumb) for ARM architecture +.It Ic .ascii Ar string +Define the ASCII string +.It Ic .asciz Ar string +Define the zero-ending ASCII string +.It Ic .bits Ar number +Define the code bitness +.It Ic .big_endian +Set the BE (big endian) byte order +.It Ic .cpu Ar name +Set the CPU for the chosen architecture .It Ic .data -.It Ic .equ -.It Ic .fill -.It Ic .glob -.It Ic .hex -.It Ic .int16 -.It Ic .int32 -.It Ic .int64 -.It Ic .kernel -.It Ic .offset -.It Ic .org -.It Ic .os -.It Ic .short +Mark the start of the data section +.It Ic .endian Ar 1|0 +Set the endianness (the byte order) - 1 is BE, 0 is LE +.It Ic .equ Ar name Ar value +Define the constant +.It Ic .fill Ar repeat,size,value +Fill the data with the repeating value pattern +.It Ic .hex Ar data +Define the data in hexadecimal format +.It Ic .incbin Ar filename +Include binary file +.It Ic .int16 Ar number +Define 16-bit integer +.It Ic .int32 Ar number +Define 32-bit integer +.It Ic .int64 Ar number +Define 64-bit integer +.It Ic .kernel Ar name +Set the kernel for syscalls +.It Ic .little_endian +Set the LE (little endian) byte order +.It Ic .org Ar value +Set the value of the PC (Program Counter) register +.It Ic .os Ar name +Set the operating system for syscalls +.It Ic .short Ar number +Define 16-bit integer +.It Ic .string Ar string +Define the ASCII string .It Ic .text +Mark the start of the text section .It Ic .thumb +Set the Thumb mode (as opposed to ARM) for ARM architecture .El .Sh EXAMPLES .Pp Assemble opcode: .Pp - $ rz-asm \-a x86 \-b 32 'mov eax, 33' +.Nm rz-asm Fl a Cm x86 Fl b Cm 32 Ar 'mov eax, 33' .Pp Disassemble opcode: .Pp - $ rz-asm \-d 90 +.Nm rz-asm Fl d Cm 90 .Sh SEE ALSO .Pp .Xr rizin(1) , diff --git a/binrz/man/rz-bin.1 b/binrz/man/rz-bin.1 index 352f99865ab..eca45938300 100644 --- a/binrz/man/rz-bin.1 +++ b/binrz/man/rz-bin.1 @@ -166,21 +166,21 @@ RZ_CONFIG: sdb config file .Sh EXAMPLES .Pp -List symbols of a program +List symbols of a program: .Pp -$ rz-bin -s a.out +.Nm rz-bin Fl s Ar a.out .Pp -Get offset of symbol +Get offset of symbol: .Pp -$ rz-bin -n _main a.out +.Nm rz-bin Fl n Cm _main Ar a.out .Pp -Get entrypoint +Get entrypoint: .Pp -$ rz-bin -e a.out +.Nm rz-bin Fl e Ar a.out .Pp -Load symbols and imports from rizin +Load symbols and imports from rizin: .Pp -$ rizin -n /bin/ls +.Nm rizin Fl n Ar /bin/ls .Pp [0x00000000]> .!rz-bin -prsi $FILE .Sh SEE ALSO @@ -198,4 +198,4 @@ $ rizin -n /bin/ls .Pp Written by pancake . .Pp -byteninjaa0. \ No newline at end of file +byteninjaa0. diff --git a/binrz/man/rz-diff.1 b/binrz/man/rz-diff.1 index 2ea489d5d27..d449787c17d 100644 --- a/binrz/man/rz-diff.1 +++ b/binrz/man/rz-diff.1 @@ -25,9 +25,14 @@ Run 'aaa' when loading the binary Disable the use of colors in the output .It Fl d Ar [algo] Compute the edit distance between files using the chosen algorithm: - myers | Eugene W. Myers' O(ND) algorithm (no substitution) - leven | Levenshtein O(N^2) algorithm (with substitution) - ssdeep | Context triggered piecewise hashing comparison +.Bl -tag -width +.It Ic myers +Eugene W. Myers' O(ND) algorithm (no substitution) +.It Ic leven +Levenshtein O(N^2) algorithm (with substitution) +.It Ic ssdeep +Context triggered piecewise hashing comparison +.El .It Fl e Ar [k=v] Set an evaluable config variable .It Fl H @@ -48,43 +53,66 @@ Input for file1 when option -t 'commands' is given Set the width and height of the terminal for visual mode .It Fl t Ar [type] Compute the difference between two files based on the specified type: - bytes | Compare raw bytes in the files (only for small files) - lines | Compare text files - functions | Compare functions found in the files - classes | Compare classes found in the files - command | Compare command output returned when executed in both files - | Require -0 , -1 is optional - entries | Compare entries found in the files - fields | Compare fields found in the files - graphs | Compare 2 functions and outputs in graphviz/dot format - | Require -0 , -1 is optional - imports | Compare imports found in the files - libraries | Compare libraries found in the files - sections | Compare sections found in the files - strings | Compare strings found in the files - symbols | Compare symbols found in the files +.Bl -tag -width +.It Ic bytes +Compare raw bytes in the files (only for small files) +.It Ic lines +Compare text files +.It Ic functions +Compare functions found in the files +.It Ic classes +Compare classes found in the files +.It Ic command +Compare command output returned when executed in both files. +Requires -0 , -1 is optional. +.It Ic entries +Compare entries found in the files +.It Ic fields +Compare fields found in the files +.It Ic graphs +Compare 2 functions and outputs in graphviz/dot format. +Requires -0 , -1 is optional. +.It Ic imports +Compare imports found in the files +.It Ic libraries +Compare libraries found in the files +.It Ic sections +Compare sections found in the files +.It Ic strings +Compare strings found in the files +.It Ic symbols +Compare symbols found in the files +.El .It Fl T Show timestamp information in the output .It Fl V Show version information for rz-diff .It Fl v be more verbose (stderr output) +.El .Pp -Palette colors can be changed by adding the following lines - inside the $HOME/.rizinrc file - ec diff.unknown blue | offset color - ec diff.match green | match color - ec diff.unmatch red | mismatch color -.Sh EXAMPLE - Compare two binary files using the default settings: - rz-diff file1.bin file2.bin - - Compare two text files and display the output in JSON format: - rz-diff -j -t lines file1.txt file2.txt - - Compare two functions from an architecture plugin: - rz-diff -t graphs -0 function1 -1 function2 binary1 binary2 +Palette colors can be changed by adding the following lines inside the $HOME/.rizinrc file +.Bl -tag +.It Ic ec diff.unknown blue +offset color +.It Ic ec diff.match green +match color +.It Ic ec diff.unmatch red +mismatch color .El +.Sh EXAMPLE +.Pp +Compare two binary files using the default settings: +.Pp +.Nm rz-diff Ar file1.bin Ar file2.bin +.Pp +Compare two text files and display the output in JSON format: +.Pp +.Nm rz-diff Fl j Fl t Cm lines Ar file1.txt Ar file2.txt +.Pp +Compare two functions from an architecture plugin: +.Pp +.Nm rz-diff Fl t Cm graphs Fl 0 Cm function1 Fl 1 Cm function2 Ar binary1 Ar binary2 .Sh SEE ALSO .Pp .Xr rizin(1) ,