Skip to content

Commit

Permalink
Improve man pages formatting (#4182)
Browse files Browse the repository at this point in the history
  • Loading branch information
XVilka committed Feb 2, 2024
1 parent d5bfd45 commit 69a9b85
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 60 deletions.
67 changes: 48 additions & 19 deletions binrz/man/rz-asm.1
Original file line number Diff line number Diff line change
Expand Up @@ -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) ,
Expand Down
18 changes: 9 additions & 9 deletions binrz/man/rz-bin.1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -198,4 +198,4 @@ $ rizin -n /bin/ls
.Pp
Written by pancake <[email protected]>.
.Pp
byteninjaa0.
byteninjaa0.
92 changes: 60 additions & 32 deletions binrz/man/rz-diff.1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 <cmd>, -1 <cmd> 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 <fcn name|offset>, -1 <fcn name|offset> 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 <cmd>, -1 <cmd> 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 <fcnname|offset>, -1 <fcn name|offset> 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) ,
Expand Down

0 comments on commit 69a9b85

Please sign in to comment.