From 22239a1bfcb3cdf2fff5d8aba59ccafa9a69b971 Mon Sep 17 00:00:00 2001 From: Riccardo Schirone Date: Fri, 30 Oct 2020 16:06:38 +0100 Subject: [PATCH] Delete some unneded documentation (#59) * Adjust doxygen documentation on rz_cmd --- BUILDING.md | 28 ++ doc/android.md | 33 -- doc/avr.md | 2 +- doc/bash_autocompletion.sh | 192 ------------ doc/brainfuck.md | 4 +- doc/calling-conventions.md | 4 +- doc/capstone.md | 50 ++- doc/crosscompile | 38 --- doc/crosscompile.md | 12 + doc/debug-internals.md | 22 +- doc/debug.md | 6 +- doc/dospart | 267 ---------------- doc/emscripten.md | 35 --- doc/esil.md | 6 +- doc/flirt.md | 12 +- doc/fortunes.fun | 18 +- doc/fortunes.nsfw | 2 +- doc/fortunes.tips | 2 +- doc/freebsd.md | 42 --- doc/gdb.md | 10 +- doc/gprobe.md | 2 +- doc/haiku.md | 22 -- doc/indent-example.c | 50 --- doc/intro.md | 610 ------------------------------------- doc/ios.md | 24 +- doc/kvast.md | 97 ------ doc/oo.md | 45 --- doc/openbsd.md | 41 --- doc/plugins.md | 27 -- doc/qnx.md | 11 - doc/rapatch.md | 6 +- doc/releases.md | 55 ---- doc/rgraph.md | 23 -- doc/sdb_ordinal.md | 6 - doc/snap.md | 112 ------- doc/solaris.md | 16 - doc/static-plugins | 11 - doc/statis.md | 26 -- doc/strings.md | 37 --- doc/termux.md | 58 ---- doc/uncrustify.cfg | 572 ---------------------------------- doc/windbg.md | 8 +- doc/windows.md | 34 --- doc/zsh/_rz | 89 ------ doc/zsh/_rz_asm | 64 ---- doc/zsh/_rz_ax | 43 --- doc/zsh/_rz_bin | 90 ------ doc/zsh/_rz_diff | 61 ---- doc/zsh/_rz_find | 39 --- doc/zsh/_rz_gg | 64 ---- doc/zsh/_rz_hash | 56 ---- librz/include/rz_cmd.h | 101 +++--- meson.build | 14 - sys/emscripten.sh | 29 -- 54 files changed, 190 insertions(+), 3138 deletions(-) delete mode 100644 doc/android.md delete mode 100644 doc/bash_autocompletion.sh delete mode 100644 doc/crosscompile create mode 100644 doc/crosscompile.md delete mode 100644 doc/dospart delete mode 100644 doc/emscripten.md delete mode 100644 doc/freebsd.md delete mode 100644 doc/haiku.md delete mode 100644 doc/indent-example.c delete mode 100644 doc/intro.md delete mode 100644 doc/kvast.md delete mode 100644 doc/oo.md delete mode 100644 doc/openbsd.md delete mode 100644 doc/plugins.md delete mode 100644 doc/qnx.md delete mode 100644 doc/releases.md delete mode 100644 doc/rgraph.md delete mode 100644 doc/sdb_ordinal.md delete mode 100644 doc/snap.md delete mode 100644 doc/solaris.md delete mode 100644 doc/static-plugins delete mode 100644 doc/statis.md delete mode 100644 doc/strings.md delete mode 100644 doc/termux.md delete mode 100644 doc/uncrustify.cfg delete mode 100644 doc/windows.md delete mode 100644 doc/zsh/_rz delete mode 100644 doc/zsh/_rz_asm delete mode 100644 doc/zsh/_rz_ax delete mode 100644 doc/zsh/_rz_bin delete mode 100644 doc/zsh/_rz_diff delete mode 100644 doc/zsh/_rz_find delete mode 100644 doc/zsh/_rz_gg delete mode 100644 doc/zsh/_rz_hash delete mode 100755 sys/emscripten.sh diff --git a/BUILDING.md b/BUILDING.md index aa48af2667..e76ee6afb7 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -114,6 +114,34 @@ on other systems if necessary. $ CFLAGS="-static" meson --default-library=static build ``` +## Cross-compilation for Android + +You can cross-compile rizin from your main machine to target your Android +device. First download and install the Android NDK from +[https://developer.android.com/ndk](https://developer.android.com/ndk). + +Then you can use meson to cross-compile, however you have to provide a +configuration file that specifies all the necessary information meson needs to +know to correctly cross-compile. + +You can find an +[example](https://github.com/rizinorg/rizin/blob/dev/.github/meson-android-aarch64.ini) +of such a file in our codebase, but you should adjust it to match your system. + +To make the deployment and usage of the rizin tools easier from within your +Android device, we suggest to compile statically and by using the *blob* +feature, which will produce just one executable and link all the other tools to +that only tool, similar to how busybox works. + +``` +$ CFLAGS="-static" LDFLAGS="-static" meson --buildtype release --default-library static --prefix=/tmp/android-dir -Dblob=true build --cross-file ./cross-compile-conf.ini +$ ninja -C build +$ ninja -C build install +``` + +At this point you can find everything under `/tmp/android-dir` and you can copy +files to your Android device. + # Build with acr/Makefile (deprecated) Rizin also support compilation with configure+make, however this is not diff --git a/doc/android.md b/doc/android.md deleted file mode 100644 index 2eff6b506c..0000000000 --- a/doc/android.md +++ /dev/null @@ -1,33 +0,0 @@ -r2 on android -============= - -Install NDK in archlinux x86-64 - - Enable multilib repo in pacman.conf - - pacman -S lib32-glibc lib32-zlib - -To build r2 for android you need to install the NDK: - - http://developer.android.com/tools/sdk/ndk/index.html - -Edit `~/.r2androidrc` to setup the paths to your ndk - - sys/android-shell.sh - ./configure --with-compiler=android --with-ostype=android --prefix=/data/rizin --without-pic --with-nonpic - make -j 4 - -To compile for android-x86 - - export NDK_ARCH=x86 - -To package: - - mkdir - make install DESTDIR=/usr - -Build farm, see `sys/android-shell.sh` and `sys/android-build.sh` - - sys/android-shell.sh sys/android-build.sh arm-static - -Environment: - - NDK_ARCH=arm|arm64|x86 diff --git a/doc/avr.md b/doc/avr.md index c23b7e0c2f..2773f20a4a 100644 --- a/doc/avr.md +++ b/doc/avr.md @@ -24,7 +24,7 @@ Using GDB: In another terminal now run: - r2 -a avr -d gdb://localhost:4242 + rizin -a avr -d gdb://localhost:4242 NOTE: Right now the avr debugger is pretty broken, the memory and register reads result in in correct data. diff --git a/doc/bash_autocompletion.sh b/doc/bash_autocompletion.sh deleted file mode 100644 index 11468a2bb3..0000000000 --- a/doc/bash_autocompletion.sh +++ /dev/null @@ -1,192 +0,0 @@ -#!/bin/bash - -if [ -z "$BASH" ]; then - autoload bashcompinit - bashcompinit -fi - -_rz () { - local cur - COMPREPLY=() - cur=${COMP_WORDS[COMP_CWORD]} - prv=${COMP_WORDS[COMP_CWORD-1]} - case "$prv" in - -a) - COMPREPLY=( $(compgen -W "$(rz_asm -qL)" -- $cur)) - return 0 - ;; - -b) - COMPREPLY=( $(compgen -W "8 16 32 64" -- $cur )) - return 0 - ;; - -k) - COMPREPLY=( $(compgen -W "$(r2 -qc 'e asm.os=?' --)" -- $cur )) - return 0 - ;; - -e) - COMPREPLY=( $(compgen -W "$(r2 -qceq --)" -- $cur )) - return 0 - ;; - -F) - COMPREPLY=( $(compgen -W "$(rz_bin -qL)" -- $cur )) - return 0 - ;; - -H) - COMPREPLY=( $(compgen -W "$(r2 -H |cut -d = -f 1)" -- $cur)) - return 0 - ;; - -p) - COMPREPLY=( $(compgen -W "$(r2 -p?)" -- $cur )) - return 0 - ;; - -D) - COMPREPLY=( $(compgen -W "$(r2 -D?)" -- $cur )) - return 0 - ;; - esac - - case "$cur" in - -*) - COMPREPLY=( $( compgen -W '-0 -a -A -b -B -c -C -d -D -e -f -F -h -hh -H -i -I -k -l -L -m -M -n -nn -N -o -q -p -P -R -s -S -t -u -v -V -w -z -zz' -- $cur)) - ;; - *) - COMPREPLY=( $(compgen -f -- $cur)) - ;; - esac - - return 0 -} - -complete -F _rz -o filenames r2 -complete -F _rz -o filenames rizin - -_rz_asm () { - local cur - COMPREPLY=() - cur=${COMP_WORDS[COMP_CWORD]} - prv=${COMP_WORDS[COMP_CWORD-1]} - case "$prv" in - -a) - COMPREPLY=( $(compgen -W "$(rz_asm -qL)" -- $cur)) - return 0 - ;; - -b) - COMPREPLY=( $(compgen -W "8 16 32 64" -- $cur )) - return 0 - ;; - -c) - # TODO. grab -a and get asm.cpu=? output - return 0 - ;; - -k) - COMPREPLY=( $(compgen -W "$(r2 -qc 'e asm.os=?' --)" -- $cur )) - return 0 - ;; - -s) - COMPREPLY=( $(compgen -W "$(rz_asm -s?)" -- $cur )) - return 0 - ;; - esac - - case "$cur" in - -*) - COMPREPLY=( $( compgen -W '-a -A -b -c -C -d -D -e -E -f -F -h -i -k-l -L -o -O -s -B -v -w -q' -- $cur)) - ;; - *) - COMPREPLY=( $(compgen -f -- $cur)) - ;; - esac - - return 0 -} - -complete -F _rz_asm -o filenames rz_asm - -_rz_bin () { - local cur - COMPREPLY=() - cur=${COMP_WORDS[COMP_CWORD]} - prv=${COMP_WORDS[COMP_CWORD-1]} - case "$prv" in - -a) - COMPREPLY=( $(compgen -W "$(rz_asm -qL)" -- $cur)) - return 0 - ;; - -b) - COMPREPLY=( $(compgen -W "8 16 32 64" -- $cur )) - return 0 - ;; - -c) - # TODO. grab -a and get asm.cpu=? output - return 0 - ;; - -k) - COMPREPLY=( $(compgen -W "$(r2 -qc 'e asm.os=?' --)" -- $cur )) - return 0 - ;; - -s) - COMPREPLY=( $(compgen -W "$(r2 -qc 'e asm.syntax=?' --)" -- $cur )) - return 0 - ;; - esac - - case "$cur" in - -*) - COMPREPLY=( $( compgen -W '-a -A -b -c -C -d -D -e -E -f -F -h -i -k-l -L -o -O -s -B -v -w -q' -- $cur)) - ;; - *) - COMPREPLY=( $(compgen -f -- $cur)) - ;; - esac - - return 0 -} - -complete -F _rz_bin -o filenames rz_bin - -_rz_find () { - local cur - COMPREPLY=() - cur=${COMP_WORDS[COMP_CWORD]} - case "$cur" in - -*) - COMPREPLY=( $( compgen -W '-a -b -e -f -h -m -M -n -r -s -S -t -v -x -X -z -Z' -- $cur)) - ;; - *) - COMPREPLY=( $(compgen -f -- $cur)) - ;; - esac - - return 0 -} - -complete -F _rz_find -o filenames rz_find - -_rz_diff() { - local cur - COMPREPLY=() - cur=${COMP_WORDS[COMP_CWORD]} - prv=${COMP_WORDS[COMP_CWORD-1]} - case "$prv" in - -a) - COMPREPLY=( $(compgen -W "$(rz_asm -qL)" -- $cur)) - return 0 - ;; - -b) - COMPREPLY=( $(compgen -W "8 16 32 64" -- $cur )) - return 0 - ;; - esac - case "$cur" in - -*) - COMPREPLY=( $( compgen -W '-a -A -AA -AAA -b -c -C -d -D -g -j -n -O -p -r -s -ss -S -t -x -v -V' -- $cur)) - ;; - *) - COMPREPLY=( $(compgen -f -- $cur)) - ;; - esac - - return 0 -} - -complete -F _rz_diff -o filenames rz_diff diff --git a/doc/brainfuck.md b/doc/brainfuck.md index 50f155dcbc..71c08a919a 100644 --- a/doc/brainfuck.md +++ b/doc/brainfuck.md @@ -1,4 +1,4 @@ -Brainfuck support for r2 +Brainfuck support for rizin ======================== Plugins for brainfuck: @@ -9,7 +9,7 @@ Plugins for brainfuck: To debug a brainfuck program: - r2 -D bf bfdbg:///tmp/bf + rizin -D bf bfdbg:///tmp/bf > dc # continue > x@scr # show screen buffer contents diff --git a/doc/calling-conventions.md b/doc/calling-conventions.md index efff65382d..5456d26b13 100644 --- a/doc/calling-conventions.md +++ b/doc/calling-conventions.md @@ -1,7 +1,7 @@ Calling Conventions profiles ============================ -Radare2 uses calling conventions to help in identifying function formal arguments and return types. It is used also as guide for basic function prototype (WIP at the time of writing this wiki). +Rizin uses calling conventions to help in identifying function formal arguments and return types. It is used also as guide for basic function prototype (WIP at the time of writing this wiki). Profile grammar =============== @@ -30,7 +30,7 @@ Note that you will substitute `x` for the calling convention name you will use. File Path ========= -In order to integrate the calling convention profile you created with the r2 source, few set of conventions should be followed: +In order to integrate the calling convention profile you created with the rizin source, few set of conventions should be followed: - Store the unparsed sdb file in `path-to-rizin-source/librz/anal/d`. - If you want the sdb to be loaded for specific architecture the file name should follow this convention `cc-arch-bits`, for example to create profile that loads automatically for x86 arch with 16 bits call the file `cc-x86-16` diff --git a/doc/capstone.md b/doc/capstone.md index 878749c77c..57ba58b06c 100644 --- a/doc/capstone.md +++ b/doc/capstone.md @@ -1,32 +1,54 @@ Capstone ======== -Capstone Engine is the disassembler engine used by rizin by default for +Capstone Engine is the disassembler engine used by Rizin by default for some architectures. -R2 supports capstone 3, 4 and 5. +Rizin supports capstone 3, 4 and 5. * capstone3: legacy support (only for Debian probably) * capstone4: stable release at the moment of writing this * capstone5: next branch, still under development -By default r2 will build statically against capstone4 (unless you specify --with-capstone5) +By default Rizin will build statically against a bundled version of capstone4 +(with some custom patches applied). Please be aware that by default Rizin will +download Capstone in the source directory `shlr/capstone`. Using system capstone --------------------- -You can link capstone dynamically (by using --with-syscapstone), this will skip all the -download and build steps of capstone inside `shlr/capstone`.and just link against the version -of capstone found in the system. That's what distros usually want. +You can build Rizin against the system version of capstone, by specifying the +`use_sys_capstone` meson option and then compile as usual. -NOTE: that building against capstone-master is cursedd, because cs-master reports v5, but code -is from v4, so it fails to compile because of missing enums and archs. +``` +$ meson -Duse_sys_capstone=true build +``` -v5 --- +Using another version of capstone +--------------------- -To build r2 against capstone5 use the following oneliner: +Although by default Rizin uses capstone4, it is possible to compile it with +version 3 or the next version, by using `use_capstone_version` meson option. - git clean -xdf - rm -rf shlr/capstone - sys/install.sh --with-capstone5 +``` +$ meson -Duse_capstone_version=v3 build-capstonev3 +``` +or +``` +$ meson -Duse_capstone_version=v5 build-capstonev5 +``` + +Test different capstone versions +---------------------- + +As mentioned before, by default Rizin downloads capstone code in the source +directory `shlr/capstone`, so if you want to test the same set of changes on +multiple Capstone versions, you have to specify the `capstone_in_builddir` +option. + +``` +$ meson -Dcapstone_in_builddir=true -Duse_capstone_version=v3 build-capstonev3 +``` + +The above command, for example, will download the Capstone code in the *build* +directory `build-capstonev3/shlr/capstone` instead of the *source* one. diff --git a/doc/crosscompile b/doc/crosscompile deleted file mode 100644 index fe3e815470..0000000000 --- a/doc/crosscompile +++ /dev/null @@ -1,38 +0,0 @@ -So you want to cross-compile radare to some exotic architecture? Use docker and you'll save some headache: - -https://github.com/dockcross/dockcross - -Here's and example on how changes required for i.e ARMv5 (no hard float) borrowed from `mk/armel.mk`: - -``` -ARCH=arm -CROSS_ROOT=/usr/bin -CROSS_TRIPLET=${ARCH}-linux-gnueabi - -CC=${CROSS_ROOT}/${CROSS_TRIPLET}-gcc -USERCC=${CROSS_ROOT}/${CROSS_TRIPLET}-gcc - -RANLIB=${CROSS_TRIPLET}-ranlib -CC_AR=${CROSS_ROOT}/${CROSS_TRIPLET}-ar -r ${LIBAR} -(...) -``` - -After defining your new `mk/arch.mk` file it should be pretty straightforward to install the `dockcross` -tool from one of its own containers: - -``` -$ docker run thewtex/cross-compiler-linux-armv5 > ~/bin/dockcross -$ chmod +x ~/bin/dockcross -``` - -And then, compile normally from inside the container: - -``` -$ dockcross --image thewtex/cross-compiler-linux-armv5 ./configure --with-compiler=armel --host=armel -$ dockcross make -``` - -Here is some more context and references: - -https://github.com/rizinorg/rizin/pull/5060 -http://blogs.nopcode.org/brainstorm/2016/07/26/cross-compiling-with-docker diff --git a/doc/crosscompile.md b/doc/crosscompile.md new file mode 100644 index 0000000000..6bbd7d1b94 --- /dev/null +++ b/doc/crosscompile.md @@ -0,0 +1,12 @@ +# Cross-compilation + +As long as you have the compilation tools for your target architecture/system, +you should be able to cross-compile by using meson. + +Please reference the [Cross +compilation](https://mesonbuild.com/Cross-compilation.html) page on the Meson +site. + +You can also have a look at +[BUILDING.md](https://github.com/rizinorg/rizin/blob/dev/BUILDING.md) for an +example about cross-compilation for Android. diff --git a/doc/debug-internals.md b/doc/debug-internals.md index 9b0e444778..51e999fdf2 100644 --- a/doc/debug-internals.md +++ b/doc/debug-internals.md @@ -1,9 +1,9 @@ -# Radare Debugger Internals +# Rizin Debugger Internals The debugger is designed using a multi-tiered plug-in architecture that allows overriding functionality for architecture or platform-specific reasons. -The bulk of the debugger functionality within radare core is split between the +The bulk of the debugger functionality within Rizin core is split between the "io", "reg", "bp", and "debug". More information on the specific files within the tree follows. @@ -17,7 +17,7 @@ defined in here. ## librz/io/p/io_debug.c -In order to interface with radare IO, a plug-in is provided. This handles, for +In order to interface with Rizin IO, a plug-in is provided. This handles, for example, spawning processes under a debugger. @@ -33,7 +33,7 @@ The functionality lives in the following files: librz/reg/cond.c // condition registers librz/reg/double.c // support for double-precision floating point numbers librz/reg/profile.c // ?? used by anal and debugger - librz/reg/reg.c // top-level register specific code (all of r2) + librz/reg/reg.c // top-level register specific code (all of rizin) librz/reg/value.c // dealing with register values librz/reg/t/p.c // test code for printing general-purpose registers librz/reg/t/regdiff.c // ?? test code for? @@ -42,11 +42,11 @@ The functionality lives in the following files: ## librz/bp -The "bp" subsystem of radare implements all the necessary details for dealing +The "bp" subsystem of Rizin implements all the necessary details for dealing with breakpoints on any given architecture. It handles managing the list of breakpoints and more. -Radare supports a multitude of different types of breakpoints. +Rizin supports a multitude of different types of breakpoints. (`??` is there a list? sw, hw, and trace? anything else??) librz/bp/bp.c // main breakpoint management code @@ -59,7 +59,7 @@ Radare supports a multitude of different types of breakpoints. For architecture specific-handling, "bp" delegates various functionality to plugins. The interface for these plugins is much simpler than other plugins -used in the radare debugger -- they only define which byte sequences represent +used in the Rizin debugger -- they only define which byte sequences represent valid breakpoints for a given architecture. librz/bp/p/bp_arm.c // ARM64, ARM, Thumb, Thumb-2 (big/little endians) @@ -73,7 +73,7 @@ valid breakpoints for a given architecture. ## librz/debug/debug.c The main top-level debugger functionality lives here. It aims to abstract away -the common code flow and integration into radare while delegating more nuanced +the common code flow and integration into Rizin while delegating more nuanced system interactions to plug-ins. librz/debug/arg.c // used by the anal engine (??) @@ -92,7 +92,7 @@ system interactions to plug-ins. Most of the time a debugger is used by a human to try to understand subtle problems with software and/or hardware. That task would be very difficult -without a user interface of some kind. The CLI commands exposed to radare are +without a user interface of some kind. The CLI commands exposed to Rizin are implemented in here. To get more information about this interface, consult the user manual or try "d?" to get a crash course. @@ -119,12 +119,12 @@ A debugger plug-in that utilizes bochs emulator to control execution. ### librz/debug/p/debug_esil.c -This debugger plug-in enables debugging and tracing radare own intermediate +This debugger plug-in enables debugging and tracing Rizin own intermediate language, Evaluable Strings Intermediate Language (ESIL). ### librz/debug/p/debug_gdb.c -A radare debugger plug-in that uses a remote GDB server/stub as its backend. +A Rizin debugger plug-in that uses a remote GDB server/stub as its backend. The protocol parsing itself is located at shlr/gdb. And corresponding IO plugin is located in librz/io/p/io_gdb.c diff --git a/doc/debug.md b/doc/debug.md index 9318066506..5bb6c49233 100644 --- a/doc/debug.md +++ b/doc/debug.md @@ -1,13 +1,11 @@ - Conditional breakpoints -========================= +# Conditional breakpoints conditional breakpoints are implemented in the following way: - when a breakpoint is hit, the condition is run as a normal command - if the command returns a value different from zero, execution continue, - otherwise, execution is stopped at the breakpoint - Examples of conditional breakpoints -====================================== +# Examples of conditional breakpoints 1. ignore breakpoint at address `0x4000ce` for five times: diff --git a/doc/dospart b/doc/dospart deleted file mode 100644 index 13e63a1f60..0000000000 --- a/doc/dospart +++ /dev/null @@ -1,267 +0,0 @@ -00 EmptyTo be precise: this is not used to designate unused area -01 DOS 12-bit FATDOS is a family of single-user operating systems for PCs. -02 XENIX root -03 XENIX /usrXenix is an old port of Unix V7. -04 DOS 3.0+ 16-bit FAT (up to 32M)Matthias Paul writes: Some old DOS versions have had a bug which requires this -05 DOS 3.3+ Extended PartitionSupports at most 8.4 GB disks: with type 05 DOS/Windows will not use -06 DOS 3.31+ 16-bit FAT (over 32M)Partitions, or at least the FAT16 filesystems created on them, -07 OS/2 IFS (e.g., HPFS)IFS = Installable File System. The best known example is HPFS. -07 Windows NT NTFSFilesystem introduced in Windows NT 3.1. -07 exFATExtended FAT, a.k.a. FAT64. -07 Advanced Unix -07 QNX2.x pre-1988 (see below under IDs 4d-4f) -08 OS/2 (v1.0-1.3 only) -08 AIX boot partition -08 SplitDrive -08 Commodore DOSMatthias Paul writes: "This indicates a Commodore MS-DOS 3.x -08 DELL partition spanning multiple drives -08 QNX 1.x and 2.x ("qny")(according to -09 AIX data partitionSome reports interchange AIX boot & data. -09 Coherent filesystemCoherent was a UNIX-type OS for the 286-386-486, marketed by -09 QNX 1.x and 2.x ("qnz")(according to -0a OS/2 Boot ManagerOS/2 is the operating system designed by Microsoft and IBM to be -0a Coherent swap partition -0a OPUSOpen Parallel Unisys Server. -0b WIN95 OSR2 FAT32Partitions up to 2047GB. See -0c WIN95 OSR2 FAT32, LBA-mappedExtended-INT13 equivalent of 0b. -0e WIN95: DOS 16-bit FAT, LBA-mapped -0f WIN95: Extended partition, LBA-mappedWindows 95 uses 0e and 0f as the extended-INT13 equivalents -10 OPUS (?)Maybe decimal, for type 0a. -11 Hidden DOS 12-bit FATWhen it boots a DOS partition, OS/2 Boot Manager will hide -11 Leading Edge DOS 3.x -12 Configuration/diagnostics partitionID 12 (decimal 18) is used by Compaq for their configuration utility -14 Hidden DOS 16-bit FAT <32M(Ralf Brown's interrupt list adds: `ID 14 resulted from using Novell -14 AST DOS with -16 Hidden DOS 16-bit FAT >=32M -17 Hidden IFS (e.g., HPFS) -18 AST SmartSleep PartitionAscentia laptops have a `Zero Volt Suspend Partition' -19 UnusedClaimed for Willowtech Photon coS (completely optimized system) -1b Hidden WIN95 OSR2 FAT32 -1c Hidden WIN95 OSR2 FAT32, LBA-mappedSometimes a hidden IBM rescue partition. -1e Hidden WIN95 16-bit FAT, LBA-mapped -20 UnusedRumoured to be used by Willowsoft Overture File System (OFS1), -21 Reserved(according to -21 UnusedClaimed for FSo2 (Oxygen File System) by Dave Poirier -22 UnusedClaimed for Oxygen Extended Partition Table by ekstazya@sprint.ca. -23 Reserved -24 NEC DOS 3.xThis is NEC MS-DOS 3.30 -26 Reserved -27 PQserviceAcer laptop hidden rescue partition. Must be FAT32. -27 Windows RE hidden partitionOn MBR disks, type 0x27. On GPT disks, GUID: -27 MirOS partition -27 RouterBOOT kernel partitionSee -2a AtheOS File System (AFS)AtheOS is an open source operating system written by Kurt Skauen. -2b SyllableSecure (SylStor)A variation on AthFS is -31 Reserved -32 NOSSimon Butcher (simonb@alien.net.au) writes: -33 Reserved -34 Reserved -35 JFS on OS/2 or eCS David van Enckevort (david@mensys.nl) writes: -36 Reserved -38 THEOS ver 3.2 2gb partition -39 Plan 9 partition -39 THEOS ver 4 spanned partition -3a THEOS ver 4 4gb partition -3b THEOS ver 4 extended partitionTHEOS is a multiuser multitasking OS for PCs founded by Timothy Williams -3c PartitionMagic recovery partitionCody Batt (codyb@powerquest.com) writes: -3d Hidden NetWareAccording to -40 Venix 80286A very old Unix-like operating system for PCs. -40 PICKRoss Stell writes: -41 Linux/MINIX (sharing disk with DRDOS)Very old FAQs recommended to use 41 etc instead of 81 etc -41 Personal RISC Boot -41 PPC PReP (Power PC Reference Platform) Boot -42 Linux swap (sharing disk with DRDOS) -42 SFS (Secure Filesystem)SFS is an encrypted filesystem driver for DOS on 386+ PCs, written -42 Windows 2000 dynamic extended partition markerIf a partition table entry of type 0x42 is present in the legacy -43 Linux native (sharing disk with DRDOS) -44 GoBack partition -45 Boot-US boot managerUlrich Straub (ustraub@boot-us.de) writes: -45 PriamAccording to -45 EUMEL/Elan -46 EUMEL/Elan -47 EUMEL/Elan -48 EUMEL/Elan Eumel, and later Ergos L3, are multiuser multitasking systems -4a Mark Aitchison's ALFS/THIN lightweight filesystem for DOSAccording to -4a AdaOS Aquila (Withdrawn)Nick Roberts at some point in time announced that he would use 4a -4c Oberon partitionSee -4d QNX4.x -4e QNX4.x 2nd part -4f QNX4.x 3rd partQNX is a POSIX-certified, microkernel, distributed, fault-tolerant -4f Oberon partitionSee -50 OnTrack Disk Manager (older versions) RODisk Manager is a program of OnTrack, to enable people to use -50 Lynx RTOS"Beginning with version 3.0, LynxOS gives users the ability to -50 Native Oberon (alt) -51 OnTrack Disk Manager RW (DM6 Aux1) -51 Novell -52 CP/M -52 Microport SysV/AT -53 Disk Manager 6.0 Aux3 -54 Disk Manager 6.0 Dynamic Drive Overlay (DDO) -55 EZ-DriveEZ-Drive is another disk manager (by MicroHouse, 1992). -56 Golden Bow VFeature Partitioned Volume.This is a Non-Standard DOS Volume. -56 DM converted to EZ-BIOS -56 AT&T MS-DOS 3.x -57 DriveProDoug Anderson (DougA@ImageCast.com), with his brother Steve cofounder -57 VNDI Partition(According to disk.c in the Netware source. -5c Priam EDiskPriam EDisk Partitioned Volume. -61 SpeedStorStorage Dimensions SpeedStor Volume. -63 Unix System V (SCO, ISC Unix, UnixWare, ...), Mach, GNU HurdA Unixware 7.1 partition must start below the 4GB limit. -64 PC-ARMOUR protected partitionUsed by PC-ARMOUR, a disk protection by Dr. A.Solomon, -64 Novell Netware 286, 2.xx -65 Novell Netware 386, 3.xx or 4.xx(Novell Netware used to be the main Network Operating System available. -66 Novell Netware SMS PartitionAccording to disk.c in the Netware source. -67 NovellRoman Gruber reports: this code has frozen my version of norton disk-editor -68 Novell -69 Novell Netware 5+, Novell Netware NSS PartitionAccording to disk.c in the Netware source. -6e ?? -70 DiskSecure Multi-Boot -71 Reserved -72 V7/x86Robert Nordier writes: V7/x86, a port of UNIX Version 7 to the PC, -73 Reserved -74 Reserved -74 Scramdisk partition -75 IBM PC/IX -76 Reserved -77 M2FS/M2CS partitionJeff Merkey writes: 77 is one we are using internally for M2FS/M2CS partitions. -77 VNDI Partition(According to disk.c in the Netware source. Not in actual use.) -78 XOSL FSXOSL Bootloader filesystem, see -7e UnusedClaimed for F.I.X. by gruberr@kapsch.net. See dejanews. -7f UnusedProposed for the -80 MINIX until 1.4a -81 MINIX since 1.4b, early LinuxMinix is a Unix-like operating system written by Andy Tanenbaum -81 Mitac disk manager -82 Prime -82 Solaris x86Solaris creates a single partition with id 0x82, then uses Sun disk labels -82 Linux swap -83 Linux native partitionLinux is a Unix-like operating system written by Linus Torvalds -84 OS/2 hidden C: driveOS/2-renumbered type 04 partition. -84 Hibernation partition(following Appendix E of the Microsoft APM 1.1f specification). -85 Linux extended partition -86 Old Linux RAID partition superblockSee fd. -86 FAT16 volume setLegacy Fault Tolerant FAT16 volume. -87 NTFS volume setLegacy Fault Tolerant NTFS volume. -88 Linux plaintext partition table -8a Linux Kernel Partition (used by AiR-BOOT)Martin Kiewitz (KiWi@vision.fido.de) writes: -8b Legacy Fault Tolerant FAT32 volume -8c Legacy Fault Tolerant FAT32 volume using BIOS extd INT 13h -8d Free FDISK 0.96+ hidden Primary DOS FAT12 partitition -8e Linux Logical Volume Manager partitionSee -90 Free FDISK 0.96+ hidden Primary DOS FAT16 partitition -91 Free FDISK 0.96+ hidden DOS extended partitition -92 Free FDISK 0.96+ hidden Primary DOS large FAT16 partitition -93 Hidden Linux native partition -93 Amoeba -94 Amoeba bad block tableAmoeba is a distributed operating system written by Andy Tanenbaum, -95 MIT EXOPC native partitions -96 CHRP ISO-9660 filesystem -97 Free FDISK 0.96+ hidden Primary DOS FAT32 partitition -98 Free FDISK 0.96+ hidden Primary DOS FAT32 partitition (LBA) -98 Datalight ROM-DOS Super-Boot PartitionSee -99 DCE376 logical driveNo, it's not a hibernation partition; it's closest to a DOS extended -9a Free FDISK 0.96+ hidden Primary DOS FAT16 partitition (LBA) -9b Free FDISK 0.96+ hidden DOS extended partitition (LBA) -9e ForthOS partition -9f BSD/OSCurrent sysid for BSDI. The types b7 and b8 given below -a0 Laptop hibernation partitionReported for various laptops like IBM Thinkpad, Phoenix NoteBIOS, Toshiba -a1 Laptop hibernation partitionReportedly used as "Save-to-Disk" partition on a NEC 6000H notebook. -a1 HP Volume Expansion (SpeedStor variant)IDs 21, a1, a3, a4, a6, b1, b3, b4, b6 are for HP Volume Expansion -a3 HP Volume Expansion (SpeedStor variant) -a4 HP Volume Expansion (SpeedStor variant) -a5 BSD/386, 386BSD, NetBSD, FreeBSD386BSD is a Unix-like operating system, a port of 4.3BSD Net/2 -a6 OpenBSDOpenBSD, led by Theo de Raadt, split off from NetBSD. -a6 HP Volume Expansion (SpeedStor variant) -a7 NeXTStepBased on Mach 2.6 and features of Mach 3.0, is a true -a8 Mac OS-XApple's OS-X ( -a9 NetBSDNetBSD is one of the children of *BSD (see above). -aa Olivetti Fat 12 1.44MB Service PartitionContains a bare DOS 6.22 and a utility to exchange types -ab Mac OS-X Boot partitionApple's OS-X (Darwin Intel) uses this type for its boot partition. -ab GO! partitionUnused. Claimed by Stanislav Karchebny for his -ae ShagOS filesystem -af ShagOS swap partitionUnused. Claimed by Frank Barrus for his -af MacOS X HFSUsed by Apple for the MacOS X filesystem HFS or HFS+ on Intel. -b0 BootStar DummyThe boot manager BootStar manages its own partition table, -b1 HP Volume Expansion (SpeedStor variant) -b1 QNX Neutrino Power-Safe filesystem -b2 QNX Neutrino Power-Safe filesystem -b3 HP Volume Expansion (SpeedStor variant) -b3 QNX Neutrino Power-Safe filesystemSteve Reid (stever@qnx.com) writes: -b4 HP Volume Expansion (SpeedStor variant) -b6 HP Volume Expansion (SpeedStor variant) -b6 Corrupted Windows NT mirror set (master), FAT16 file system -b7 Corrupted Windows NT mirror set (master), NTFS file system -b7 BSDI BSD/386 filesystem -b8 BSDI BSD/386 swap partitionBSDI (Berkeley Software Design, Inc.) was founded by former CSRG -bb Boot Wizard hidden(PTS) BootWizard 4.0 and its new version Acronis OS Selector 5.0 -bc Acronis backup partitionRecognized as Acronis Secure Zone, when labelled "ACRONIS SZ". -be Solaris 8 boot partition -bf New Solaris x86 partitionThe old 0x82 id conflicted with Linux swap. New Solaris installations -c0 CTOS -c0 REAL/32 secure small partitionSee d0 below. -c0 NTFT PartitionAccording to disk.c in the Netware source. -c0 DR-DOS/Novell DOS secured partitionDR-DOS 7.02+ / OpenDOS 7.01 / Novell DOS 7 secured partition. -c1 DRDOS/secured (FAT-12) -c2 UnusedAccording to -c2 Hidden Linux -c3 Hidden Linux swapBenedict Chong (bchong@blueskyinnovations.com) writes: -c4 DRDOS/secured (FAT-16, < 32M) -c5 DRDOS/secured (extended)This ID may also be used in obscure trickery: -c6 DRDOS/secured (FAT-16, >= 32M)DR-DOS 6.0 and higher (NetWare PalmDOS 1.0, Novell DOS 7, OpenDOS 7.01, -c6 Windows NT corrupted FAT16 volume/stripe setNTFS will add 0xc0 to the partition type for disabled parts -c7 Windows NT corrupted NTFS volume/stripe set -c7 Syrinx bootPrimary partition only. -c8 Reserved for DR-DOS 8.0+ -c9 Reserved for DR-DOS 8.0+ -ca Reserved for DR-DOS 8.0+ -cb DR-DOS 7.04+ secured FAT32 (CHS)/ -cc DR-DOS 7.04+ secured FAT32 (LBA)/ -cd CTOS Memdump? -ce DR-DOS 7.04+ FAT16X (LBA)/ -cf DR-DOS 7.04+ secured EXT DOS (LBA)/ -d0 REAL/32 secure big partitionREAL/32 is a continuation of DR Multiuser DOS. -d0 Multiuser DOS secured partitionThis applies to the whole MDOS family range, Digital Research -d1 Old Multiuser DOS secured FAT12 -d4 Old Multiuser DOS secured FAT16 <32M -d5 Old Multiuser DOS secured extended partition -d6 Old Multiuser DOS secured FAT16 >=32M -d8 CP/M-86 -da Non-FS DataAdded on request of John Hardin (johnh@aproposretail.com). -da Powercopy BackupPowercopy Backup (shielded disk), -db Digital Research CP/M, Concurrent CP/M, Concurrent DOS -db CTOS (Convergent Technologies OS -Unisys) -db KDG Telemetry SCPU bootMark Morgan Lloyd (markMLl.in@telemetry.co.uk) writes: -dd Hidden CTOS Memdump? -de Dell PowerEdge Server utilities (FAT fs) -df DG/UX virtual disk manager partitionGlenn Steen (glenn.steen@ap1.se) writes: -df BootIt EMBRMThe boot manager BootIt manages its own partition table, -e0 Reserved by -e1 DOS access or SpeedStor 12-bit FAT extended partitionKevin Cummings reports in alt.os.linux: -e3 DOS R/O or SpeedStor -e4 SpeedStor 16-bit FAT extended partition < 1024 cyl. -e5 Tandy MS-DOS with -e6 Storage Dimensions SpeedStor -e8 LUKS -eb BeOS BFSBeOS is an operating system that runs on Power PCs and on Intel PCs. -ec SkyOS SkyFS -ed UnusedMatthias Paul plans to use this for an OS called Sprytix. -ee Indication that this legacy MBR is followed by an EFI header -ef Partition that contains an EFI file systemBob Griswold (rogris@Exchange.Microsoft.com) writes: -f0 Linux/PA-RISC boot loaderPaul Bame (bame@debian.org) writes: the F0 partition will be -f1 Storage Dimensions SpeedStor -f2 DOS 3.3+ secondary partitionMatthias Paul writes: -f3 Reserved -f4 SpeedStor large partition -f4 Prologue single-volume partition -f5 Prologue multi-volume partitionThe type F4 partition contains one volume, and is not used anymore. -f6 Storage Dimensions SpeedStor -f7 DDRdrive Solid State File SystemChristopher George writes: -f9 pCacheEd Sawicki writes: "We propose using the F9 partition type as -fa BochsRob Judd writes: MandrakeSoft's -fb VMware File System partition -fc VMware Swap partitionAlso used as VMkernel dump partition. -fd Linux raid partition with autodetect using persistent superblockSee the -fe SpeedStor > 1024 cyl. -fe LANstep -fe IBM PS/2 IML (Initial Microcode Load) partition, -fe Windows NT Disk Administrator hidden partitionMark Morgan Lloyd (markMLl.in@telemetry.co.uk) writes: -fe Linux Logical Volume Manager partition (old)This has been in use since the early LVM days back in 1997, -ff Xenix Bad Block Table diff --git a/doc/emscripten.md b/doc/emscripten.md deleted file mode 100644 index e69fae53ec..0000000000 --- a/doc/emscripten.md +++ /dev/null @@ -1,35 +0,0 @@ -Building for the browser -======================== - -# Install emscripten: - - git clone git://github.com/kripken/emscripten.git - export PATH=/path/to/emscripten:$PATH - make clean - - -# Build radare - - sys/emscripten.sh - - - diff --git a/doc/esil.md b/doc/esil.md index d5bbaf6e51..01f2f0d4d6 100644 --- a/doc/esil.md +++ b/doc/esil.md @@ -234,7 +234,7 @@ Disassembly example: │ │││ 0x100001147 48394a38 rdx,56,+,[8],rcx,==,cz,?= ``` -Radare anal ESIL code example +Rizin anal ESIL code example ============================== As an example implementation of ESIL analysis for the AVR family of @@ -256,7 +256,7 @@ are used later on by ESIL string formatting function like for instance: Which in this case corresponds to the LDI (LoaD with immediate) instruction in AVR. As an example, the above ESIL string template will translate into the -following when reversing in radare: +following when reversing in Rizin: 0x00000080 30e0 0x0,r19,= ; LDI Rd,K. load immediate @@ -266,7 +266,7 @@ Or in non-ESIL format: Looking at other architectures which already have mature ESIL support such as -x86 can help in understanding the syntax and conventions of radare's ESIL. +x86 can help in understanding the syntax and conventions of Rizin's ESIL. Introspection diff --git a/doc/flirt.md b/doc/flirt.md index 8c18b1e56c..0a530f1d52 100644 --- a/doc/flirt.md +++ b/doc/flirt.md @@ -1,13 +1,13 @@ FLIRT ===== -At the moment of writing r2 supports loading and finding FLIRT +At the moment of writing Rizin supports loading and finding FLIRT patterns, those files can be generated with the FLIRT tools from IDA. -R2 doesn't yet supports creating those files. But it supports its +Rizin doesn't yet supports creating those files. But it supports its own signature format which can be used to generate signatures and find them. -This document will focus on FLIRT, not the native r2 'Zignatures'. +This document will focus on FLIRT, not the native Rizin 'Zignatures'. You need the flair tools/ida utilities. Those tools are closed source and privative, so you should not distribute them. It is probable that @@ -33,12 +33,12 @@ There's little chance libc.sig will be compatible across systems and libc versions. If libc.exc exists, you need to resolve some functions conflicts. Prepend a '+' on the lines you're sure you want to keep (see end of flair/sigmake.txt). Then redo the sigmake command. The -.sig is now ready to be used with r2. +.sig is now ready to be used with Rizin. -Using it with r2: +Using it with rizin: ----------------- - r2 -c 'zF libc.sig' staticbin + rizin -c 'zF libc.sig' staticbin refs: diff --git a/doc/fortunes.fun b/doc/fortunes.fun index 27138e1b86..d161eb9a35 100644 --- a/doc/fortunes.fun +++ b/doc/fortunes.fun @@ -11,7 +11,7 @@ If you send the program you are debugging to 15 friends in 143 minutes and then To remove this message, put `dbxenv suppress_startup_message 7.5' in your .dbxrc Heisenbug: A bug that disappears or alters its behavior when one attempts to probe or isolate it. rizin is for lulzhats -Microloft Visual Radare.NET 2008. Now OOXML Powered! +Microloft Visual Rizin.NET 2008. Now OOXML Powered! A C program is like a fast dance on a newly waxed dance floor by people carrying razors - Waldi Ravens rizin is like windows 7 but even better. We are surrounded by the enemy. - Excellent, we can attack in any direction! @@ -122,12 +122,12 @@ Stop swearing! I didn't say that it was working, I said that it's implemented Wrong argument Remember that word: C H A I R -what happens in #radare, stays in #radare +what happens in #rizin, stays in #rizin For a full list of commands see `strings /dev/urandom` Good morning, pal *<:-) Of course rizin runs FreeBSD Reverser by Birth, rizin by Choice -Radare2, what else? +rizin, what else? This incident will be reported command not found: calc.exe See you at the defcon CTF @@ -169,16 +169,15 @@ SSAbotage from ISIL "a collection of garbage" -- an rizin pro user A git pull a day keeps the segfault away Are you a wizard? -Learn pancake as if you were radare! rizin is a great OS, but a terrible hex editor THE CAKE IS A PIE rizin 0.9.7 is so old, my grandfarther was using it with his enigma in WWII Have you seen the latest rizin TV spot? -scp ~/.idapro/ida.key radare.org:/var/www/radare.org/pub/losers/ +scp ~/.idapro/ida.key rizin.org:/var/www/rizin.org/pub/losers/ Too bad there is no gif support in rizin. Yet. -- @rizingif Almost 5am, maybe you should go to bed. Jingle sploits, jingle sploits, ropchain all the way. -Mind that the 'g' in radare is silent +Mind that the 'g' in rizin is silent 256 colors ought to be enough for anybody Hang in there, Baby! Run a command with unspecified long sequence of 'a', pancake will be summoned and do the analysis for you. @@ -245,13 +244,12 @@ Place a cat on your keyboard while running rizin, you'll not believe what will h This binary may contain traces of human Help subcommand will be eventually removed. Carpe noctum. -Your mouse has moved. Radare2 NT must be restarted for the change to take effect. Reboot now? [ OK ] +Your mouse has moved. rizin NT must be restarted for the change to take effect. Reboot now? [ OK ] There is only one binary, and we are all just reversing pieces of it. -Radare2 is like violence. If it doesn't solve your problem, you aren't using enough. Order pizza for $12.48? [Y/n] rizinOS rizinpad 0.1 SMP GENERIC rizin_64 GNU/rizinOS AHHHHH!!!! ASSEMBLY CODE!!!!!! HOLD ME I'M SCARED!!!!!!!!!! -In radare we trust +In Rizin we trust We don't make mistakes... just happy little segfaults. rizin is for the people Use headphones for best experience. @@ -273,7 +271,7 @@ Sorry, rizin has experienced an internal error. Segmentation fault (core dumped) Use rz_bin to discover the real TRUTH ==1337== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) -**** COMMODORE 64 RADARE V2 **** 64K RAM SYSTEM 38911 DISASM BYTES FREE READY. +**** COMMODORE 64 RIZIN V2 **** 64K RAM SYSTEM 38911 DISASM BYTES FREE READY. Most likely your core dump fell into a blackhole, can't see it. Long time no C rizin is power, France is pancake. diff --git a/doc/fortunes.nsfw b/doc/fortunes.nsfw index 0a6568456f..e7ad57da5c 100644 --- a/doc/fortunes.nsfw +++ b/doc/fortunes.nsfw @@ -1,4 +1,4 @@ -RADARE CUMS WITH ABSOLUTELY NO WARRANTY +RIZIN CUMS WITH ABSOLUTELY NO WARRANTY Please remove pregnant women, pregnant children, and pregnant pets from the monitor. Everytime you run rizin, a random file is removed I like to suck nibbles and make hex. diff --git a/doc/fortunes.tips b/doc/fortunes.tips index 46867c8447..2e668f9bf8 100644 --- a/doc/fortunes.tips +++ b/doc/fortunes.tips @@ -62,7 +62,7 @@ Setup dbg.fpregs to true to visualize the fpu registers in the debugger view. To debug a program, you can call rizin with 'dbg://' or '-d ' Use 'e' and 't' in Visual mode to edit configuration and track flags. Use 'rz_bin -ris' to get the import/export symbols of any binary. -Remember to maintain your ~/.radare_history +Remember to maintain your ~/.rizin_history Enable the PAGER with 'e scr.pager=less -R' Use 'e asm.offset=true' to show offsets in 16bit segment addressing mode. The '?' command can be used to evaluate math expressions. Like this: '? (0x34+22)*4' diff --git a/doc/freebsd.md b/doc/freebsd.md deleted file mode 100644 index 9f8b6aa01a..0000000000 --- a/doc/freebsd.md +++ /dev/null @@ -1,42 +0,0 @@ -FreeBSD build instructions -========================== - -This document aims to explain the steps needed to build r2 and r2b-python on FreeBSD. - -* Note that `make` (from GNU) is named `gmake` -* Stuff is installed in /usr/local -* clang (or gcc) is named cc and clang++ (or g++) is c++ -* valabind is not packaged in the ports - -Radare2 Dependencies: ---------------------- - - sudo pkg install git gcc gmake patch pkgconf - - git clone https://github.com/rizinorg/rizin - cd rizin - sys/install.sh /usr/local - -Python Swig Bindings Dependencies: ----------------------------------- - - sudo pkg install swig30 pkgconf vala - - git clone https://github.com/radare/valabind - cd valabind - gmake - sudo gmake install PREFIX=/usr/local - -Building Python Swig Bindings: ------------------------------- - - git clone https://github.com/rizinorg/rizin-bindings - cd rizin-bindings - export CC=cc - export CXX=c++ - export SWIG=swig3.0 - export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig - ./configure --prefix=/usr/local - cd python - gmake CC=$CC CXX=$CXX - sudo gmake install diff --git a/doc/gdb.md b/doc/gdb.md index 9854afcab9..42a0723a3a 100644 --- a/doc/gdb.md +++ b/doc/gdb.md @@ -1,4 +1,4 @@ -Connecting r2 with gdb +Connecting rizin with gdb ====================== Running gdbserver @@ -7,15 +7,15 @@ Running gdbserver $ gdbserver :2345 /bin/ls (gdb) target remote localhost:2345 -Connecting from r2 +Connecting from rizin ------------------ - $ r2 -D gdb gdb://127.0.0.1:2345 + $ rizin -D gdb gdb://127.0.0.1:2345 Supported implementations ========================= -r2 have support for connecting to remote GDB instances: +rizin have support for connecting to remote GDB instances: x86-32 x86-64 arm arm64 sh winedbg x x - - - @@ -59,7 +59,7 @@ Supported Packets: TODO ---- -- Implement GDBserver to allow other apps use r2 debugger +- Implement GDBserver to allow other apps use rizin debugger - Fix that usese the gdb internal stepping version - Fix softstep, that it finally recoils correct (it just have to reset the eip/rip) - Add Breakpoints (should be an easy add of the function, because its already implemented in the gdb lib) diff --git a/doc/gprobe.md b/doc/gprobe.md index ba7b49b81e..8653ff0a3e 100644 --- a/doc/gprobe.md +++ b/doc/gprobe.md @@ -52,7 +52,7 @@ Setup for Turbo186 processor core: - e asm.bits=16 - e asm.seggrn=8 -Now enjoy all the great stuff that r2 offers, like: +Now enjoy all the great stuff that rizin offers, like: - run grobe commands with =!? - dump memory with px - Visual mode with V, including cursor mode and insert hexpairs diff --git a/doc/haiku.md b/doc/haiku.md deleted file mode 100644 index 923d5c9894..0000000000 --- a/doc/haiku.md +++ /dev/null @@ -1,22 +0,0 @@ -r2 for Haiku -============ - -To compile for Haiku run configure in this way: - - HOST_CC=gcc-x86 CC=gcc-x86 ./configure --with-ostype=haiku --prefix=/boot/home/Apps/rizin - -And then.. - - HOST_CC=gcc-x86 make - make install - mv /boot/home/Apps/rizin/bin/* /boot/home/Apps/rizin/ - rmdir /boot/home/Apps/rizin/bin/ - -To install r2-bindings you will need to install r2, valac, valabind and swig -and copy/link libs to rizin/lib - - -TODO -==== - -* Add debugging support diff --git a/doc/indent-example.c b/doc/indent-example.c deleted file mode 100644 index 4fe1159f4e..0000000000 --- a/doc/indent-example.c +++ /dev/null @@ -1,50 +0,0 @@ -/* rizin - LGPL - [$minyear-$maxyear] - [$author]*/ - -#include - -typedef struct rz_core_rtr_host_t2 { - int proto; - int port; - char host[512]; - char file[1024]; - RzSocket *fd; -} RzCoreRtrHost2; - -static const char *help_msg_aa[] = { - "Usage:", "aa[0*?]", " # see also 'af' and 'afna'", - "aa", " ", "alias for 'af@@ sym.*;af@entry0;afva'", //;.afna @@ fcn.*'", - "aa*", "", "analyze all flags starting with sym. (af @@ sym.*)", - NULL -}; - -static int cmpaddr(const void *_a, const void *_b) { - const RzAnalFunction *a = _a, *b = _b; - return a->addr - b->addr; -} - -int main(int argc, char **argv) { - rz_anal_esil_set_pc (core->anal->esil, fcn? fcn->addr: core->offset); - switch (*input) { - case '\0': // "aft" - seek = core->offset; - rz_anal_esil_set_pc (core->anal->esil, fcn? fcn->addr: core->offset); - rz_core_anal_type_match (core, fcn); - rz_core_seek (core, seek, true); - break; - case '0': - { - int a = 0; - printf ("LocalA: %d\n", a); - } - break; - case 'a': - argc--; - /* fallthrough */ - case 'b': - case '?': - default: - rz_core_cmd_help (core, help_msg_aft); - break; - } - return 0; -} diff --git a/doc/intro.md b/doc/intro.md deleted file mode 100644 index c224e3f51c..0000000000 --- a/doc/intro.md +++ /dev/null @@ -1,610 +0,0 @@ -# Radare2 - -## Command line options -``` --L: List of supported IO plugins --q: Exit after processing commands --w: Write mode enabled --i [file]: Interprets a r2 script --A: Analyze executable at load time (xrefs, etc) --n: Bare load. Do not load executable info as the entrypoint --c 'cmds': Run r2 and execute commands (eg: r2 -wqc'wx 3c @ main') --p [prj]: Creates a project for the file being analyzed (CC add a comment when opening a file as a project) --: Opens r2 with the malloc plugin that gives a 512 bytes memory area to play with (size can be changed) - Similar to r2 malloc://512 -``` - -## Configuration properties -They can be used in evaluations:`? ${asm.tabs}` - -``` -e: Returns configuration properties -e : Checks a specific property: - e asm.tabs => false -e =: Change property value - e asm.arch=ppc -e? help about a configuration property - e? cmd.stack -``` -You will want to set your favourite options in `~/.rizinrc` since every line there will be interpreted at the beginning of each session. Mine for reference: - -``` -# Show comments at right of disassembly if they fit in screen -e asm.cmt.right=true - -# Shows pseudocode in disassembly. Eg mov eax, str.ok = > eax = str.ok -e asm.pseudo = true - -# Solarized theme -eco solarized - -# Use UTF-8 to show cool arrows that do not look like crap :) -e scr.utf8 = true -``` - -There is an easier interface accessible from the Visual mode, just typing `Ve` - -## Basic Commands -Command syntax: `[.][times][cmd][~grep][@[@iter]addr!size][|>pipe]` -* `;` Command chaining: `x 3;s+3;pi 3;s+3;pxo 4;` -* `|` Pipe with shell commands: `pd | less` -* `!` Run shell commands: `!cat /etc/passwd` -* `!!` Escapes to shell, run command and pass output to radare buffer -* Note: The double exclamation mark tells radare to skip the plugin list to find an IO plugin handling this command to launch it directly to the shell. A single one will walk through the io plugin list. -* `` ` `` Radare commands: `` wx `!rz_gg -i exec` `` -* `~` grep -* `~!` grep -v -* `~[n]` grep by columns `afl~[0]` -* `~:n` grep by rows `afl~:0` -``` - pi~mov,eax ; lines with mov or eax - pi~mov&eax ; lines with mov and eax - pi~mov,eax:6 ; 6 first lines with mov or eax - pd 20~call[0]:0 ; grep first column of the first row matching 'call' -``` -* `.cmd` Interprets command output -``` -is* prints symbols -.is* interprets output and define the symbols in radare (normally they are already loaded if r2 was not invoked with -n) -``` -* `..` repeats last commands (same as enter \n) -* `(` Used to define and run macros -* `$` Used to define alias -* `$$`: Resolves to current address -* Offsets (`@`) are absolute, we can use $$ for relative ones `@ $$+4` -* `?` Evaluate expression -``` -[0x00000000]> ? 33 +2 -35 0x23 043 0000:0023 35 00100011 35.0 0.000000 - -Note: | and & need to be escaped -``` -* `?$?` Help for variables used in expressions -* `$$`: Here -* `$s`: File size -* `$b`: Block size -* `$l`: Opcode length -* `$j`: When `$$` is at a `jmp`, `$j` is the address where we are going to jump to -* `$f`: Same for `jmp` fail address -* `$m`: Opcode memory reference (e.g. mov eax,[0x10] => 0x10) -* `???` Help for `?` command -* `?i` Takes input from stdin. Eg `?i username` -* `??` Result from previous operations -* `?s from to [step]`: Generates sequence from to every -* `?p`: Get physical address for given virtual address -* `?P`: Get virtual address for given physical one -* `?v` Show hex value of math expr -``` -?v 0x1625d4ca ^ 0x72ca4247 = 0x64ef968d -?v 0x4141414a - 0x41414140 = 0xa -``` -* `?l str`: Returns the length of string -* `@@`: Used for iterations -``` -wx ff @@10 20 30 Writes ff at offsets 10, 20 and 30 -wx ff @@`?s 1 10 2` Writes ff at offsets 1, 2 and 3 -wx 90 @@ sym.* Writes a nop on every symbol -``` - -## Positioning -``` -s address: Move cursor to address or symbol - s-5 (5 bytes backwards) - s- undo seek - s+ redo seek -``` - -## Block size -The block size is the default view size for radare. All commands will work with this constraint, but you can always temporally change the block size just giving a numeric argument to the print commands for example (px 20) -``` -b size: Change block size -``` - -## JSON Output -Most of commands such as (i)nfo and (p)rint commands accept a `j` to print their output in `json` -``` -[0x100000d78]> ij -{"bin":{"type":"mach0","class":"MACH064","endian":"little","machine":"x86 64 all","arch":"x86","os":"osx","lang":"c","pic":true,"canary":false,"nx":false,"crypto":false,"va":true,"bits":64,"stripped":true,"static":false,"linenums":false,"syms":false,"relocs":false},"core":{"type":"Executable file","os":"osx","arch":"x86 64 all","bits":64,"endian":"little","file":"/bin/ls","fd":6,"size":34640,"mode":"r--","block":256,"uri":"/bin/ls","format":"mach064"}} -``` -## Analyze -``` -aa: Analyze all (fcns + bbs) same that running r2 with -A -ahl : fake opcode length for a range of bytes -ad: Analyze data - ad@rsp (analyze the stack) -``` -Function analysis (normal mode) - -``` -af: Analyze functions -afl: List all functions - number of functions: afl~? -afi: Returns information about the functions we are currently at -afr: Rename function: structure and flag -afr off: Restore function name set by r2 -afn: Rename function - afn strlen 0x080483f0 -af-: Removes metadata generated by the function analysis -af+: Define a function manually given the start address and length - af+ 0xd6f 403 checker_loop -axt: Returns cross references to (xref to) -axf: Returns cross references from (xref from) -``` -Function analysis (visual mode) - -``` -d, f: Function analysis -d, u: Remove metadata generated by function analysis -``` - -Opcode analysis: - -``` -ao x: Analyze x opcodes from current offset -a8 bytes: Analyze the instruction represented by specified bytes -``` - -## Information -``` -iI: File info -iz: Strings in data section -izz: Strings in the whole binary -iS: Sections - iS~w returns writable sections -is: Symbols - is~FUNC exports -il: Linked libraries -ii: Imports -ie: Entrypoint -``` -Mitigations: - -``` -i~pic : check if the binary has position-independent-code -i~nx : check if the binary has non-executable stack -i~canary : check if the binary has canaries -``` - -Get function address in GOT table: -`pd 1 @ sym.imp` -Returns a `jmp [addr]` where `addr` is the address of function in the GOT. Similar to `objdump -R | grep ` - -# Print -``` -psz n @ offset: Print n zero terminated String -px n @ offset: Print hexdump (or just x) of n bytes -pxw n @ offset: Print hexdump of n words - pxw size@offset prints hexadecimal words at address -pd n @ offset: Print n opcodes disassembled -pD n @ offset: Print n bytes disassembled -pi n @ offset: Print n instructions disassembled (no address, XREFs, etc. just instructions) -pdf @ offset: Print disassembled function - pdf~XREF (grep: XREFs) - pdf~call (grep: calls) -pcp n @ offset: Print n bytes in python string output. - pcp 0x20@0x8048550 - import struct - buf = struct.pack ("32B", - 0x55,0x89,0xe5,0x83,0xzz,0xzz,0xzz,0xzz,0xf0,0x00,0x00, - 0x00,0x00,0xc7,0x45,0xf4,0x00,0x00,0x00,0x00,0xeb,0x20, - 0xc7,0x44,0x24,0x04,0x01,0x00,0x00,0x00,0xzz,0xzz) -p8 n @ offset: Print n bytes (8bits) (no hexdump) -pv: Print file contents as IDA bar and shows metadata for each byte (flags , ...) -pt: Interpret data as dates -pf: Print with format -pf.: list all formats -p=: Print entropy ascii graph -``` - -## Write -``` -wx: Write hex values in current offset - wx 123456 - wx ff @ 4 -wa: Write assembly - wa jnz 0x400d24 -wc: Write cache commit -wv: Writes value doing endian conversion and padding to byte -wo[x]: Write result of operation - wow 11223344 @102!10 - write looped value from 102 to 102+10 - 0x00000066 1122 3344 1122 3344 1122 0000 0000 0000 - wox 0x90 - XOR the current block with 0x90. Equivalent to wox 0x90 $$!$b (write from current position, a whole block) - wox 67 @4!10 - XOR from offset 4 to 10 with value 67 -wf file: Writes the content of the file at the current address or specified offset (ASCII characters only) -wF file: Writes the content of the file at the current address or specified offset -wt file [sz]: Write to file (from current seek, blocksize or sz bytes) - Eg: Dump ELF files with wt @@ hit0* (after searching for ELF headers: \x7fELF) -wopO 41424344 : get the index in the De Bruijn Pattern of the given word -``` - -## Flags -Flags are labels for offsets. They can be grouped in namespaces as `sym` for symbols ... -``` -f: List flags -f label @ offset: Define a flag `label` at offset - f str.pass_len @ 0x804999c -f-label: Removes flag -fr: Rename flag -fd: Returns position from nearest flag (looking backwards). Eg => entry+21 -fs: Show all flag spaces -fs flagspace: Change to the specified flag space -``` - -## yank & paste -``` -y n: Copies n bytes from current position -y: Shows yank buffer content with address and length where each entry was copied from -yp: Prints yank buffer -yy offset: Paste the contents of the yank buffer at the specified offset -yt n target @ source: Yank to. Copy n bytes from source to target address -``` - -## Visual Mode: -`V` enters visual mode - -``` -q: Exits visual mode -hjkl: move around (or HJKL) (left-down-up-right) -o: go/seek to given offset -?: Help -.: Seek EIP -: Follow address of the current jump/call -:cmd: Enter radare commands. Eg: x @ esi -d[f?]: Define cursor as a string, data, code, a function, or simply to undefine it. - dr: Rename a function - df: Define a function -v: Get into the visual code analysis menu to edit/look closely at the current function. -p/P: Rotate print (visualization) modes - hex, the hexadecimal view - disasm, the disassembly listing - Use numbers in [] to follow jump - Use "u" to go back - debug, the debugger - words, the word-hexidecimal view - buf, the C-formatted buffer - annotated, the annotated hexdump. -c: Changes to cursor mode or exits the cursor mode - select: Shift+[hjkl] - i: Insert mode - a: assembly inline - A: Assembly in visual mode - y: Copy - Y: Paste - f: Creates a flag where cursor points to - in the hexdump view to toggle between hex and strings columns -V: View ascii-art basic block graph of current function -W: WebUI -x, X: XREFs to current function. ("u" to go back) -t: track flags (browse symbols, functions..) -gG: Begin or end of file -HUD - _ Show HUD - backspace: Exits HUD - We can add new commands to HUD in: rizin/shlr/hud/main -;[-]cmt: Add/remove comment -m: Define a bookmark -': Go to previously defined bookmark -``` - -## ROP -``` -/R opcodes: Search opcodes - /R pop,pop,ret -/Rl opcodes: Search opcodes and print them in linear way - /Rl jmp eax,call ebx -/a: Search assembly - /a jmp eax -pda: Returns a library of gadgets that can be use. These gadgets are obtained by disassembling byte per byte instead of obeying to opcode length -``` -Search depth can be configure with following properties: - -``` -e search.roplen = 4 (change the depth of the search, to speed-up the hunt) -``` - -## Searching -``` -/ bytes: Search bytes - \x7fELF -``` -Example: Searching function preludes: - -``` -push ebp -mov ebp, esp - -Opcodes: 5589e5 - -/x 5589e5 - [# ]hits: 54c0f4 < 0x0804c600 hits = 1 - 0x08049f70 hit0_0 5589e557565383e4f081ec - 0x0804c31a hit0_1 5589e583ec18c704246031 - 0x0804c353 hit0_2 5589e583ec1889442404c7 - 0x0804c379 hit0_3 5589e583ec08e87cffffff - 0x0804c3a2 hit0_4 5589e583ec18c70424302d - -pi 5 @@hit* (Print 5 first instructions of every hit) -``` -Its possible to run a command for each hit. Use the `cmd.hit` property: - -``` -e cmd.hit=px -``` - -## Comments and defines -``` -Cd [size]: Define as data -C- [size]: Define as code -Cs [size]: Define as String -Cf [size]: Define as struct - We can define structures to be shown in the disassembly -CC: List all comments or add a new comment in console mode - C* Show all comments/metadata - CC add new comment - CC- remove comment -``` - -## Magic files -``` -pm: Print Magic files analysis - [0x00000000]> pm - 0x00000000 1 ELF 32-bit LSB executable, Intel 80386, version 1 -``` -Search for magic numbers - -``` -/m [magicfile]: Search magic number headers with libmagic -``` -Search can be controlled with following properties: - -``` -search.align -search.from (0 = beginning) -search.to (0 = end) -search.asmstr -search.in -``` - -## Yara -Yara can also be used for detecting file signatures to determine compiler types, shellcodes, protections and more. - -``` -:yara scan -``` - -## Zignatures -Zignatures are useful when dealing with stripped binaries. We can take a non-stripped binary, run zignatures on it and apply it to a different binary that was compiled statically with the same libraries. - -``` -zg : Generate signatures - eg: zg go go.z -Run the generated script to load signatures - eg: . go.z -z: To show signatures loaded: -``` -Zignatures are applied as comments: - -``` -r2-(pid2)> pd 35 @ 0x08049adb-10 -| 0x08049adb call fcn.0805b030 -| fcn.0805b030(unk, unk, unk, unk) ; sign.sign.b.sym.fmt.Println -| 0x08049ae0 add esp, 0xc -| 0x08049ae3 call fcn.08095580 -``` - -## Compare files -``` -r2 -m 0xf0000 /etc/fstab ; Open source file -o /etc/issue ; Open file2 at offset 0 -o ; List both files -cc offset: Diff by columns between current offset address and "offset" -``` - -## Graphs -Basic block graphs - -``` -af: Load function metadata -ag $$ > a.dot: Dump basic block graph to file -ag $$ | xdot -: Show current function basic block graph -``` -Call graphs - -``` -af: Load function metadata -agc $$ > b.dot: Dump basic block graph to file -``` -Convert .dot in .png - -``` -dot -Tpng -o /tmp/b.png b.dot -``` -Generate graph for file: - -``` -rz_diff -g main crackme.bin crackme.bin > /tmp/a -xdot /tmp/a -``` - -## Debugger -Start r2 in debugger mode. r2 will fork and attach - -``` -r2 -d [pid|cmd|ptrace] (if command contains spaces use quotes: r2 -d "ls /") - -ptrace://pid (debug backend does not notice, only access to mapped memory) -``` -To pass arguments: - -``` -r2 -d rz_run program=pwn1 arg1=$(python exploit.py) -``` -To pass stdin: - -``` -r2 -d rz_run program=/bin/ls stdin=$(python exploit.py) -``` -Commands - -``` -do: Reopen program -dp: Shows debugged process, child processes and threads -dc: Continue -dcu
: Continue until symbol (sets bp in address, continua until bp and remove bp) -dc[sfcp]: Continue until syscall(eg: write), fork, call, program address (To exit a library) -ds: Step in -dso: Step out -dss: Skip instruction -dr register=value: Change register value -dr(=)?: Show register values -db address: Sets a breakpoint at address - db sym.main add breakpoint into sym.main - db 0x804800 add breakpoint - db -0x804800 remove breakpoint -dsi (conditional step): Eg: "dsi eax==3,ecx>0" -dbt: Shows backtrace -drr: Display in colors and words all the refs from registers or memory -dm: Shows memory map (* indicates current section) - [0xb776c110]> dm - sys 0x08048000 - 0x08062000 s r-x /usr/bin/ls - sys 0x08062000 - 0x08064000 s rw- /usr/bin/ls - sys 0xb776a000 - 0xb776b000 s r-x [vdso] - sys 0xb776b000 * 0xb778b000 s r-x /usr/lib/ld-2.17.so - sys 0xb778b000 - 0xb778d000 s rw- /usr/lib/ld-2.17.so - sys 0xbfe5d000 - 0xbfe7e000 s rw- [stack] -``` -To follow child processes in forks (set-follow-fork-mode in gdb) - -``` -dcf until a fork happen -then use dp to select what process you want to debug. -``` - -PEDA like details: `drr;pd 10@-10;pxr 40@esp` - -Debug in visual mode - -``` -toggl breakpoints with F2 -single-step with F7 (s) -step-over with F8 (S) -continue with F9 -``` - -## WebGUI (Enyo) -``` -=h: Start the server -=H: Start server and browser -``` - -# Radare2 suite commands -All suite commands include a `-r` flag to generate instructions for r2 - -## rz_ax - Base conversion -``` --e: Change endian --K: random ASCII art to represent a number/hash. Similar to how SSH represents keys --s: hexstr -> raw --S: raw -> hexstr -``` - -## rz_hash - Entropy, hashes and checksums -``` --a: Specify the algorithm --b XXX: Block size --B: Print all blocks --a entropy: Show file entropy or entropy per block (-B -b 512 -a entropy) -``` - -## rz_diff - File diffing -``` --s: Calculate text distance from two files. --d: Delta diffing (For files with different sizes. Its not byte per byte) --C: Code diffing (instead of data) -``` -Examples: - -``` -Diff original and patched on x86_32, using graphdiff algorithm - rz_diff -a x86 -b32 -C original patched -Show differences between original and patched on x86_32 - rz_diff -a x86 -b32 original patched : -``` - -## rz_asm - Assembly/Disassembly -``` --L: Supported architectures --a arch instruction: Sets architecture - rz_asm -a x86 'mov eax,30' => b81e000000 --b tam: Sets block size --d: Disassembly - rz_asm -d b81e000000 => mov eax, 0x1e --C: Assembly in C output - rz_asm -C 'mov eax,30' => "\xb8\x1e\x00\x00\x00" --D: Disassemble showing hexpair and opcode - rz_asm -D b81e0000 => 0x00000000 5 b81e000000 mov eax, 0x1e --f: Read data from file instead of ARG. --O filename: Write data to file -``` - -## rz_find - Search -``` --Z: Look for Zero terminated strings --s str: Look for specific string -``` - -## rz_gg - Shellcode generator, C/opcode compiler -``` --P: Generate De Bruijn patterns - rz_gg -P 300 -r --a arch: Configure architecture --b bits: Specify architecture bits (32/64) --i shellcode: Specify shellcode to generate --e encoder: Specify encoder -``` -Example: -``` -Generate a x86, 32 bits exec shellcode - rz_gg -a x86 -b 32 -i exec -``` - -## rz_bin - Executable analysis: symbols, imports, strings ... -``` --I: Executable information --c: Returns classes. Useful to list Java Classes --l: Dynamic linked libraries --s: Symbols --z: Strings -``` - -## rz_run - Launcher to run programs with different environments, args, stdin, permissions, fds -Examples: - -``` -r2 -b 32 -d rz_run program=pwn1 arg1=$(rz_gg -P 300 -r) : runs pwn1 with a De Bruijn Pattern as first argument, inside rizin's debugger, and force 32 bits -r2 -d rz_run program=/bin/ls stdin=$(python exploit.py) : runs /bin/ls with the output of exploit.py directed to stdin -``` - diff --git a/doc/ios.md b/doc/ios.md index ca25b72b0e..73660ef506 100644 --- a/doc/ios.md +++ b/doc/ios.md @@ -6,13 +6,13 @@ Code signing on iOS is simpler, because the Jailbreak simplifies the process (Co Compilation ----------- -There are different ways to build r2 for iOS, use the sys/ script you need: +There are different ways to build rizin for iOS, use the sys/ script you need: * `sys/ios-cydia.sh` * `sys/ios-static.sh` * `sys/ios-simulator.sh` -It is also possible to build r2 natively on your iDevice by following the standard `./configure ; make ; make install` steps. But if you own a Mac is better to use the XCode toolchain to get better build times. +It is also possible to build rizin natively on your iDevice by following the standard `./configure ; make ; make install` steps. But if you own a Mac is better to use the XCode toolchain to get better build times. For incremental compilations or daily development you should: @@ -34,23 +34,3 @@ Packaging If you have used `sys/ios-cydia.sh` you should get already two Cydia packages, one with bins and another with libs for `-dev`, if not, just run this command: $ make -C sys/cydia - -Installation ------------- - -The Cydia packages can be installed by copying the binary: - - $ ssh root@192.168.0.13 - # rm -f rizin - $ scp binrz/rizin root@192.168.0.13:. - -Note that it is important to remove the previous executable from the filesystem because `ldone` signing is associated with the filesystem inode, and it will fail to run if you overwrite the contents of the executable without removing it first. - -Installing the `cydia.radare.org` repository. - - # apt-get update - # apt-install rizin - -Or just doing it from the command line: - - # dpkg -i rizin-*.deb diff --git a/doc/kvast.md b/doc/kvast.md deleted file mode 100644 index d58004e19f..0000000000 --- a/doc/kvast.md +++ /dev/null @@ -1,97 +0,0 @@ -kvast -===== - -KeyValue storage for AST - -To optimize serialized storage use a concatenated -string array and use the sdb array string api - -eax=33 ------- - - 0.op=set []0=set,eax,33 - 0.a=eax - 0.b=33 - - -ebx=(8*(eax+4)) ---------------- - 0.op=set []0=set,ebx,$1 - 0.a=ebx - 0.b=$1 - - 1.op=mul []1=mul,8,$2 - 1.a=8 - 1.b=$2 - - 2.op=add []2=add,eax,4 - 2.a=eax - 2.b=4 - -ebx=8*(eax+4)+3 ---------------- - 0.op=set []0=set,ebx,$3 - 0.a=ebx - 0.b=$3 - - 1.op=mul []1=mul,8,$2 - 1.a=8 - 1.b=$2 - - 2.op=add []2=add,eax,4 - 2.a=eax - 2.b=4 - - 3.op=add []3=add,$1,3 - 3.a=$1 - 3.b=3 - -ebx=8*(eax+4+ecx+2)+1 ---------------------- - 0.op=set - 0.a=ebx - 0.b=$5 - - 1.op=mul - 1.a=8 - 1.b=$4 - -( - 2.op=add - 2.a=eax - 2.b=4 - -// update toplevel b reference - 3.op=add - 3.a=$2 - 3.b=ecx - -// update toplevel b reference - 4.op=add - 4.a=$3 - 4.b=2 -} - -// update toplevel b reference - 5.op=add - 5.a=$1 - 5.b=1 - -Parsing -======= -Parsing is done by a state machine which reads the expression string and creates a keyvalue string that represents the ESIL instruction. - -This is an example -``` - switch (ch) { - case '+': - case '-': - case '*': - case '/': - if (expect_arg) { - - expect_arg = ch; - } - break; - } -``` diff --git a/doc/oo.md b/doc/oo.md deleted file mode 100644 index 8fd30eff74..0000000000 --- a/doc/oo.md +++ /dev/null @@ -1,45 +0,0 @@ -Radare OO -========= - -I do realize that Object Orientation sucks, so I tried to do librz API -following some sane and basic OO concepts. - - - No inheritance - - Instances are used to keep states - - Enforces instance recycling - - Reduce creation/destruction of objects - - Easily interfaced with Vala through the VAPIs - -Global picture --------------- - -``` -[Class] - | - |-- [Plugins] // shared among instances - | \ - | \ - `------> [Instance] ----> [Liberation] -``` - -* We need a construction/destruction API for plugins among instances - - simplify code - -A library implements a set of functionalities, those ones are mainly -the lifecycle of the class containing the state of - -Plugins are singletons. Or we will have to create factories for every class. - -Lifecycle of the class ----------------------- - -Class - - new - - as_new - - init - - free - -Library plugins ---------------- - They are stored in the p/ directory of each library under the librz directory. - diff --git a/doc/openbsd.md b/doc/openbsd.md deleted file mode 100644 index dc75f2442d..0000000000 --- a/doc/openbsd.md +++ /dev/null @@ -1,41 +0,0 @@ -OpenBSD build instructions -========================== - -This document aims to explain the steps needed to build r2 and r2b-python on OpenBSD. - -* Note that `make` (from GNU) is named `gmake` -* Stuff is installed in /usr/local -* clang (or gcc) is named cc and clang++ (or g++) is c++ -* valabind is not packaged in the ports - -Radare2 Dependencies: ---------------------- - - doas pkg_add git gcc gmake pkgconf - - git clone https://github.com/rizinorg/rizin - cd rizin - sys/install.sh /usr/local - -Python Swig Bindings Dependencies: ----------------------------------- - - doas pkg_add pkgconf vala - - git clone https://github.com/radare/valabind - cd valabind - gmake - doas gmake install PREFIX=/usr/local - -Building Python Swig Bindings: ------------------------------- - - git clone https://github.com/rizinorg/rizin-bindings - cd rizin-bindings - export CC=cc - export CXX=c++ - export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig - ./configure --prefix=/usr/local - cd python - gmake CC=$CC CXX=$CXX - doas gmake install diff --git a/doc/plugins.md b/doc/plugins.md deleted file mode 100644 index 67cf94c17e..0000000000 --- a/doc/plugins.md +++ /dev/null @@ -1,27 +0,0 @@ -LIBR PLUGINS -============ - -Plugins must be configured using the root ./configure-plugins script. - -Libraries can be compiled: - - as shared libraries (so, dylib, dll) (DEFAULT) - - as static libraries (a, lib, ..) - - ./configure-plugins --enable-shared --enable-dynamic - -RZ_LIBR_PLUGINS environment variable is honored as another search path for plugins - -Plugins can be: - - not compiled - - compiled as shared - - compiled as static (inside the related library) - - librz/plugins/shared - librz/plugins/static - -the configure-plugins script will regenerate the required Makefiles -to build this stuff as defined. - -PD: This is not implemented :) - ---pancake diff --git a/doc/qnx.md b/doc/qnx.md deleted file mode 100644 index e4828b6b45..0000000000 --- a/doc/qnx.md +++ /dev/null @@ -1,11 +0,0 @@ -r2 on android -============= - -``` -. ./bbndk-env.sh -cd ~/rizin -rm -f plugins.cfg -./configure --with-compiler=qnx --with-ostype=qnx --prefix=/accounts/devuser/rizin --without-pic --with-nonpic -make -j 4 -``` - diff --git a/doc/rapatch.md b/doc/rapatch.md index d1e4bc97dd..f6194cbe39 100644 --- a/doc/rapatch.md +++ b/doc/rapatch.md @@ -21,7 +21,7 @@ OFFSET : assembly Example scripts --------------- -This script will run the `?e ..` command in r2 and then write the string 'Hello' at 0x200 offset +This script will run the `?e ..` command in rizin and then write the string 'Hello' at 0x200 offset ``` # rapatch example :?e hello world @@ -31,8 +31,8 @@ This script will run the `?e ..` command in r2 and then write the string 'Hello' Running rapatches ----------------- - $ r2 -P rapatch.txt target-program.txt + $ rizin -P rapatch.txt target-program.txt Or for scripted patching like `patch(1)`: - $ r2 -w -q -P rapatch.txt target-program.txt + $ rizin -w -q -P rapatch.txt target-program.txt diff --git a/doc/releases.md b/doc/releases.md deleted file mode 100644 index 143ba31492..0000000000 --- a/doc/releases.md +++ /dev/null @@ -1,55 +0,0 @@ -Releasing rules -======================= - -The objective of this paper is to determine a set of rules to be done before -each release and define the instructions for generating the distribution -tarball together with a scheduler. - -* We try to release every 1/2 months -* Version numbering (actually we don't follow any rules for this) -* Codenames for releases MUST be funny (until we didn't get a name that can make - me laugh, we should not release anything!) - -Before any release we have to: - - - Remove warnings - - We don't want to fall in the warning nightmare of r1. Releases should contain - no warnings with `gcc -Wall` or at least no dangerous ones. - - - Sync Vala APIs - - Keeping the VAPI files the last ones to be developed between release cycles - we ensure that we do not have to maintain synced the code with the vapis - and it is possible to easily draw the LIBR API evolution by just diffing - the vapi directory. - - - Unit test programs - - If available, it would be good to have some unit tests to check nothing is - broken. Maybe Vala is the way to go when writing tests, because this way - we ensure that pkg-config, librz and vapis works in a shot. - - - Test build on different platforms - - The same codebase should be compilable on *nix and w32 systems without - modifications. It should be also possible to build it with make threads, - so using quadcore boxes with `-j8` should be a good place for finding - race conditions in the build system. - - - Remove commented code and review TODO/BUG/XXX comments - - While developing a new release, it's pretty common to keep old versions of - the code for testing parts of libraries and be able to go back or find bugs - while refactoring code or re-doing-it from scratch. This code, should be - reviewed and removed if necessary. - - $ grep -r -e TODO -e XXX -e FIX librz - - - Graph per symbol-module dependency graph to identify unused/dupped/- - simplificable use cases of the API for every module. - -FUTURE ------- - - - Commands should be handled in a structural way, not by a bunch of switch/cases diff --git a/doc/rgraph.md b/doc/rgraph.md deleted file mode 100644 index 6c695ae52a..0000000000 --- a/doc/rgraph.md +++ /dev/null @@ -1,23 +0,0 @@ -Not-much-updated graph of relationships between the librz APIs -============================================================= - -``` - +--------+ - .-| config | - / +--------+ - +------+ +------+ +------+ +------+ - | core |--| cons | | asm | | diff | - +------+ | line | | bin | | sign | - | \ +------+ | anal | | hash | ,_____. - +----+ \ +---.--+ +--.---+ +._____.+ - | io | +-------------'------/ | | - +----+ | cmd, search, print |<------>| flags | - | +------.-------------\ | meta | - [ lib ] +----'----------+ +-`-----+ +._____.+ - | .----| debug, bp, vm | | lang | - | | | reg, syscall | | macro | - +------'--+ | var, trace | +-------+ - | plugins | +---------------+ | - +-----.---+ | - `---------------------------' -``` diff --git a/doc/sdb_ordinal.md b/doc/sdb_ordinal.md deleted file mode 100644 index 09b480fe17..0000000000 --- a/doc/sdb_ordinal.md +++ /dev/null @@ -1,6 +0,0 @@ -# Cannot find R2PATH/format/dll/DLLNAME.sdb - -1. Execute `rz_bin -rs DLLNAME.dll | grep -i DLLNAME | grep -v Ordi |grep ^k| cut -d / -f 4- > DLLNAME.sdb.txt` -2. Upload file `DLLNAME.sdb.txt` in https://github.com/rizinorg/rizin/tree/master/librz/bin/d/dll -3. Change the following [Makefile](https://github.com/rizinorg/rizin/blob/master/librz/bin/d/Makefile#L14) -4. Create a Pull Request to Master diff --git a/doc/snap.md b/doc/snap.md deleted file mode 100644 index 3c1f26efb5..0000000000 --- a/doc/snap.md +++ /dev/null @@ -1,112 +0,0 @@ -Installing the snap package of rizin -====================================== -rizin is also available as a snap package and can be installed on a system that supports snap packages. See [Installing snapd](https://snapcraft.io/docs/installing-snapd) to setup your system to support snap packages. - -Status of snap package support ------------------------------- -Currently, rizin is available as a _beta_ snap package that works in _devmode_ security confinement (developer mode). Refer back to this section for updated instructions when rizin is out of _beta/devmode_. - -Currently, you need to prepend `rizin.` to each command you want to run. For example, use `rizin.rz_bin` to run `rz_bin`. - -Snap packages that work in _devmode_ security confinement do not appear in search results, when you search for them in the Snap Store. To find information about this snap package, run `snap info rizin`. See the section below on this. - -Installing rizin ------------------ -This command installs the `rizin` snap package from the _beta_ channel, using the _devmode_ (developer mode) security confinement type. The _devmode_ security confinement disables any restrictions that are applied to typical snap packages. _devmode_ makes a package to work similar to APT and RPM packages. - - $ sudo snap install rizin --channel=beta --devmode - -Running commands ----------------- - -Currently, the rizin commands can be invoked with the following names: - -- `rizin` or `rizin.rizin`: The `r2`/`rizin` command. -- `rizin.rz_pm` : The `rz_pm` command. -- `rizin.rz_agent` : The `rz_agent` command. -- `rizin.rz_find` : The `rz_find` command. -- `rizin.rz_hash` : The `rz_hash` command. -- `rizin.rz_asm` : The `rz_asm` command. -- `rizin.rz_bin` : The `rz_bin` command. -- `rizin.rz_diff` : The `rz_diff` command. -- `rizin.rz_gg` : The `rz_gg` command. -- `rizin.rz_run` : The `rz_run` command. -- `rizin.rz_ax` : The `rz_ax` command. -- `rizin.rz_sign` : The `rz_sign` command. - -Getting info about the rizin snap package -------------------------------------------- - -Run the following command to get info about the rizin snap package. You can see the list of available commands and how to invoke them. There are packages in the `beta` and `edge` channels, currently with rizin 4.5.0. The build number in this example is 5, and is an ascending number that characterises each new build. We have installed radare 4.5.0 from build 5, using the _devmode_ security confinement. We are _tracking_ the `beta` channel. Since the installed build number is the same as the build number in the channel that we are tracking, we are already running the latest available version. - -``` -$ snap info rizin -... -description: | - Radare2 (also known as r2) is a complete framework for reverse-engineering - and analyzing binaries; composed of a set of small utilities - that can be used together or independently from the command line. - Built around a disassembler for computer software which generates - assembly language source code from machine-executable code, - it supports a variety of executable formats for different processors - and operating systems. - -commands: - - rizin.rz_agent - - rizin.rz_pm - - rizin.rz_bin - - rizin.rizin - - rizin.rz_diff - - rizin.rz_find - - rizin.rz_gg - - rizin.rz_hash - - rizin.rz_run - - rizin.rz_sign - - rizin.rz_asm - - rizin.rz_ax -snap-id: ceuTRkmV5T8oTHt2psXxLRma25xfBrfS -tracking: latest/beta -refresh-date: today at 12:51 EEST -channels: - latest/stable: – - latest/candidate: – - latest/beta: 4.5.0 2020-07-23 (5) 15MB devmode - latest/edge: 4.5.0 2020-07-23 (5) 15MB devmode -installed: 4.5.0 (5) 15MB devmode -``` - -Updating rizin ----------------- - -The snap packages that are installed in _devmode_ are not updated automatically. -You can update manually: - - $ sudo snap refresh rizin - -See the section above on how to get info about the rizin snap package and how to determine whether there is an updated version available. - -Uninstalling rizin --------------------- -Run the following command to uninstall the snap package of rizin: - - $ sudo snap remove rizin - -Supported architectures -======================= -The rizin snap package is currently available for the following architectures: - -1. `amd64` -1. `i386` -1. `arm64` -1. `armhf` -1. `ppc64el` -1. `s390x` - -Troubleshooting ---------------- - -- _error: snap "rizin" is not available on stable_: When installing the snap package of rizin, you currently need to specify the _beta_ channel. Append `--channel=beta` on the installation command line. -- _error: The publisher of snap "rizin" has indicated that they do not consider this revision to be of production quality_: When installing the snap package of rizin, you currently need to specify the _devmode_ confinement. Append `--devmode` on the installation command line. -- _How can I download the snap package for offline use?_: Use the command `snap download rizin --channel=beta`. You can then run `sudo snap install` to install the `.snap` package that was just downloaded. -- _Do I need to use "sudo" with snap commands?_: You need to prepend `sudo` when you run most snap commands that perform privileged actions. However, if you log in into the Snap Store using `sudo snap login`, then you do not need anymore to prepend `sudo`. - diff --git a/doc/solaris.md b/doc/solaris.md deleted file mode 100644 index 690d75fe13..0000000000 --- a/doc/solaris.md +++ /dev/null @@ -1,16 +0,0 @@ -ORACLE SOLARIS NOTES -==================== - -Packages you need: ------------------- -``` -pkg install gcc-3 gmake -``` - -To compile it: --------------- -``` -./configure --disable-debugger --without-gmp -gmake -gmake install -``` diff --git a/doc/static-plugins b/doc/static-plugins deleted file mode 100644 index 73788340bd..0000000000 --- a/doc/static-plugins +++ /dev/null @@ -1,11 +0,0 @@ -Edit librz/config.h and librz/config.mk - -In librz/config.mk set a list of static asm plugins... - -STATIC_ASM_PLUGINS=p/java.mk p/mips.mk - -In librz/config.h define the list of struct plugins - -#define RZ_ASM_STATIC_PLUGINS \ - &r_asm_plugin_java, 0 - diff --git a/doc/statis.md b/doc/statis.md deleted file mode 100644 index b0babb1f28..0000000000 --- a/doc/statis.md +++ /dev/null @@ -1,26 +0,0 @@ -Statically Linking r2 -===================== - -Before you try to statically link r2, you should know about the licenses that go along with it, see doc/license for more information. - -Instructions ------------- - -In order to create a static library, configure with: - - ./configure --prefix=/usr --with-nonpic --without-pic - -or just run - - sys/static.sh - -Android -------- - -Bear in mind that the Android build is done statically to simplify distribution and speedup loading times (no need to dynamically resolve external symbols or load libraries). You can achieve this running the following script (for example): - - sys/android-arm.sh - -The build environment for the NDK can be setup by using the: - - sys/android-shell.sh arm diff --git a/doc/strings.md b/doc/strings.md deleted file mode 100644 index c68792ebcf..0000000000 --- a/doc/strings.md +++ /dev/null @@ -1,37 +0,0 @@ -Loading strings from binaries -============================= - -TODO: explain bin.minstr - -Config vars ------------ -``` -bin.strings = [true] - load strings from file -bin.rawstr = [false] - load strings from unknown rbin -``` - -Program args ------------- -``` -rz_bin -z # list strings -rz_bin -zz # list strings from raw binary (unknown rbin type) -``` - -Examples --------- -``` -r2 -e bin.rawstr=true -r2 -z # do not load strings (same as bin.strings=false) -r2 -zz # load strings even if unknown bin (same as bin.rawstr=true) -r2 -n # do not load symbols or anything -r2 -e bin.strings=false # load symbols but not strings -if (bin.strings) { - if RBin.format(isKnown) { - loadStrings() - } else { - if (bin.rawstr) - loadStrings() - } -} -``` - diff --git a/doc/termux.md b/doc/termux.md deleted file mode 100644 index 49b60635c7..0000000000 --- a/doc/termux.md +++ /dev/null @@ -1,58 +0,0 @@ -Termux -====== - -Termux is a terminal emulator that ships a base linux environment using the Debian package system -but compiling everything to run on native Android. The result is a fully functional shell on -Android devices for x86, arm and arm64. - -Installation ------------- - -The Termux maintainer of the rizin package updates the package really fast after every release -which happens every 6 weeks. So in this case, as long as it's supposed to run on embedded devices -it is ok to just install the package from Termux unless you really want to track git master or -develop for this platform. - - sudo apt install rizin - -Building from git ------------------ - -The packages required to build are: - - sudo apt install git make patch clang - -Now you can clone the repo and build: - - git clone --depth 1 https://github.com/rizinorg/rizin - cd rizin - sys/termux.sh - -Building with meson -------------------- - -If you want to build with meson: - - sudo apt install python - sudo pip install meson - sudo rz_pm -i ninja - -And then you can run the build: - - make meson - -To install: - - make meson-symstall PREFIX=/data/data/com.termux/files/usr - -Updating --------- - -To update the repo and rebuild you can do a full and clean rebuild by just running sys/termux.sh -or opt for typing `make` or `make meson` and it will just build what has changed, is something -fails please do a clean build like this: - - git reset --hard - git clean -xdf - sys/termux.sh - diff --git a/doc/uncrustify.cfg b/doc/uncrustify.cfg deleted file mode 100644 index 5b1d19d02c..0000000000 --- a/doc/uncrustify.cfg +++ /dev/null @@ -1,572 +0,0 @@ -# Uncrustify 0.64_d -newlines = auto -input_tab_size = 8 -output_tab_size = 8 -string_escape_char = 92 -string_escape_char2 = 0 -string_replace_tab_chars = false -tok_split_gte = false -disable_processing_cmt = "" -enable_processing_cmt = "" -enable_digraphs = false -utf8_bom = ignore -utf8_byte = false -utf8_force = false -indent_columns = 8 -indent_continue = 0 -indent_param = 0 -indent_with_tabs = 2 -indent_cmt_with_tabs = true -indent_align_string = false -indent_xml_string = 0 -indent_brace = 0 -indent_braces = false -indent_braces_no_func = false -indent_braces_no_class = false -indent_braces_no_struct = false -indent_brace_parent = false -indent_paren_open_brace = false -indent_cs_delegate_brace = false -indent_namespace = false -indent_namespace_single_indent = false -indent_namespace_level = 0 -indent_namespace_limit = 0 -indent_extern = false -indent_class = false -indent_class_colon = false -indent_class_on_colon = false -indent_constr_colon = false -indent_ctor_init_leading = 2 -indent_ctor_init = 0 -indent_else_if = false -indent_var_def_blk = 0 -indent_var_def_cont = false -indent_shift = false -indent_func_def_force_col1 = false -indent_func_call_param = true -indent_func_def_param = false -indent_func_proto_param = false -indent_func_class_param = false -indent_func_ctor_var_param = false -indent_template_param = false -indent_func_param_double = false -indent_func_const = 0 -indent_func_throw = 0 -indent_member = 0 -indent_sing_line_comments = 0 -indent_relative_single_line_comments = false -indent_switch_case = 0 -indent_case_shift = 0 -indent_case_brace = 0 -indent_col1_comment = false -indent_label = 1 -indent_access_spec = 1 -indent_access_spec_body = false -indent_paren_nl = false -indent_paren_close = 2 -indent_comma_paren = false -indent_bool_paren = false -indent_first_bool_expr = false -indent_square_nl = false -indent_preserve_sql = false -indent_align_assign = true -indent_oc_block = false -indent_oc_block_msg = 0 -indent_oc_msg_colon = 0 -indent_oc_msg_prioritize_first_colon = true -indent_oc_block_msg_xcode_style = false -indent_oc_block_msg_from_keyword = false -indent_oc_block_msg_from_colon = false -indent_oc_block_msg_from_caret = false -indent_oc_block_msg_from_brace = false -indent_min_vbrace_open = 0 -indent_vbrace_open_on_tabstop = false -indent_token_after_brace = true -indent_cpp_lambda_body = false -indent_using_block = true -indent_ternary_operator = 0 -sp_arith = force -sp_assign = force -sp_cpp_lambda_assign = ignore -sp_cpp_lambda_paren = ignore -sp_assign_default = force -sp_before_assign = force -sp_after_assign = force -sp_enum_paren = ignore -sp_enum_assign = ignore -sp_enum_before_assign = ignore -sp_enum_after_assign = ignore -sp_pp_concat = add -sp_pp_stringify = ignore -sp_before_pp_stringify = ignore -sp_bool = force -sp_compare = force -sp_inside_paren = remove -sp_paren_paren = remove -sp_cparen_oparen = ignore -sp_balance_nested_parens = false -sp_paren_brace = force -sp_before_ptr_star = add -sp_before_unnamed_ptr_star = ignore -sp_between_ptr_star = remove -sp_after_ptr_star = remove -sp_after_ptr_star_qualifier = ignore -sp_after_ptr_star_func = ignore -sp_ptr_star_paren = ignore -sp_before_ptr_star_func = force -sp_before_byref = ignore -sp_before_unnamed_byref = ignore -sp_after_byref = ignore -sp_after_byref_func = ignore -sp_before_byref_func = ignore -sp_after_type = force -sp_before_template_paren = ignore -sp_template_angle = ignore -sp_before_angle = ignore -sp_inside_angle = ignore -sp_after_angle = ignore -sp_angle_paren = ignore -sp_angle_paren_empty = ignore -sp_angle_word = ignore -sp_angle_shift = add -sp_permit_cpp11_shift = false -sp_before_sparen = force -sp_inside_sparen = remove -sp_inside_sparen_close = ignore -sp_inside_sparen_open = ignore -sp_after_sparen = ignore -sp_sparen_brace = ignore -sp_invariant_paren = ignore -sp_after_invariant_paren = ignore -sp_special_semi = ignore -sp_before_semi = remove -sp_before_semi_for = ignore -sp_before_semi_for_empty = ignore -sp_after_semi = add -sp_after_semi_for = force -sp_after_semi_for_empty = remove -sp_before_square = remove -sp_before_squares = remove -sp_inside_square = remove -sp_after_comma = force -sp_before_comma = remove -sp_after_mdatype_commas = ignore -sp_before_mdatype_commas = ignore -sp_between_mdatype_commas = ignore -sp_paren_comma = force -sp_before_ellipsis = ignore -sp_after_class_colon = ignore -sp_before_class_colon = ignore -sp_after_constr_colon = ignore -sp_before_constr_colon = ignore -sp_before_case_colon = remove -sp_after_operator = ignore -sp_after_operator_sym = ignore -sp_after_operator_sym_empty = ignore -sp_after_cast = force -sp_inside_paren_cast = ignore -sp_cpp_cast_paren = ignore -sp_sizeof_paren = ignore -sp_after_tag = ignore -sp_inside_braces_enum = ignore -sp_inside_braces_struct = ignore -sp_inside_braces = force -sp_inside_braces_empty = remove -sp_type_func = ignore -sp_func_proto_paren = remove -sp_func_proto_paren_empty = remove -sp_func_def_paren = remove -sp_func_def_paren_empty = remove -sp_inside_fparens = ignore -sp_inside_fparen = ignore -sp_inside_tparen = ignore -sp_after_tparen_close = ignore -sp_square_fparen = ignore -sp_fparen_brace = ignore -sp_fparen_dbrace = ignore -sp_func_call_paren = force -sp_func_call_paren_empty = ignore -sp_func_call_user_paren = remove -sp_func_class_paren = ignore -sp_func_class_paren_empty = ignore -sp_return_paren = remove -sp_attribute_paren = ignore -sp_defined_paren = ignore -sp_throw_paren = ignore -sp_after_throw = ignore -sp_catch_paren = ignore -sp_version_paren = ignore -sp_scope_paren = ignore -sp_super_paren = remove -sp_this_paren = remove -sp_macro = ignore -sp_macro_func = ignore -sp_else_brace = force -sp_brace_else = force -sp_brace_typedef = force -sp_catch_brace = ignore -sp_brace_catch = ignore -sp_finally_brace = ignore -sp_brace_finally = ignore -sp_try_brace = ignore -sp_getset_brace = ignore -sp_word_brace = add -sp_word_brace_ns = add -sp_before_dc = force -sp_after_dc = ignore -sp_d_array_colon = ignore -sp_not = remove -sp_inv = remove -sp_addr = remove -sp_member = remove -sp_deref = remove -sp_sign = remove -sp_incdec = remove -sp_before_nl_cont = force -sp_after_oc_scope = ignore -sp_after_oc_colon = ignore -sp_before_oc_colon = ignore -sp_after_oc_dict_colon = ignore -sp_before_oc_dict_colon = ignore -sp_after_send_oc_colon = ignore -sp_before_send_oc_colon = ignore -sp_after_oc_type = ignore -sp_after_oc_return_type = ignore -sp_after_oc_at_sel = ignore -sp_after_oc_at_sel_parens = ignore -sp_inside_oc_at_sel_parens = ignore -sp_before_oc_block_caret = ignore -sp_after_oc_block_caret = ignore -sp_after_oc_msg_receiver = ignore -sp_after_oc_property = ignore -sp_cond_colon = remove -sp_cond_colon_before = remove -sp_cond_colon_after = force -sp_cond_question = force -sp_cond_question_before = remove -sp_cond_question_after = force -sp_cond_ternary_short = remove -sp_case_label = remove -sp_range = ignore -sp_after_for_colon = force -sp_before_for_colon = remove -sp_extern_paren = ignore -sp_cmt_cpp_start = force -sp_cmt_cpp_doxygen = false -sp_cmt_cpp_qttr = false -sp_endif_cmt = ignore -sp_after_new = ignore -sp_between_new_paren = ignore -sp_before_tr_emb_cmt = ignore -sp_num_before_tr_emb_cmt = 0 -sp_annotation_paren = ignore -sp_skip_vbrace_tokens = false -force_tab_after_define = false -align_keep_tabs = false -align_with_tabs = true -align_on_tabstop = true -align_number_right = false -align_keep_extra_space = false -align_func_params = false -align_same_func_call_params = false -align_var_def_span = 0 -align_var_def_star_style = 0 -align_var_def_amp_style = 0 -align_var_def_thresh = 0 -align_var_def_gap = 0 -align_var_def_colon = false -align_var_def_attribute = false -align_var_def_inline = false -align_assign_span = 0 -align_assign_thresh = 0 -align_enum_equ_span = 0 -align_enum_equ_thresh = 0 -align_var_class_span = 0 -align_var_class_thresh = 0 -align_var_class_gap = 0 -align_var_struct_span = 0 -align_var_struct_thresh = 0 -align_var_struct_gap = 0 -align_struct_init_span = 0 -align_typedef_gap = 0 -align_typedef_span = 0 -align_typedef_func = 0 -align_typedef_star_style = 0 -align_typedef_amp_style = 0 -align_right_cmt_span = 0 -align_right_cmt_mix = false -align_right_cmt_gap = 0 -align_right_cmt_at_col = 0 -align_func_proto_span = 0 -align_func_proto_gap = 0 -align_on_operator = false -align_mix_var_proto = false -align_single_line_func = false -align_single_line_brace = false -align_single_line_brace_gap = 0 -align_oc_msg_spec_span = 0 -align_nl_cont = true -align_pp_define_together = true -align_pp_define_gap = 0 -align_pp_define_span = 0 -align_left_shift = true -align_asm_colon = false -align_oc_msg_colon_span = 0 -align_oc_msg_colon_first = false -align_oc_decl_colon = false -nl_collapse_empty_body = true -nl_assign_leave_one_liners = false -nl_class_leave_one_liners = false -nl_enum_leave_one_liners = false -nl_getset_leave_one_liners = false -nl_func_leave_one_liners = false -nl_cpp_lambda_leave_one_liners = false -nl_if_leave_one_liners = false -nl_while_leave_one_liners = false -nl_oc_msg_leave_one_liner = false -nl_oc_block_brace = force -nl_start_of_file = ignore -nl_start_of_file_min = 0 -nl_end_of_file = ignore -nl_end_of_file_min = 0 -nl_assign_brace = ignore -nl_assign_square = ignore -nl_after_square_assign = ignore -nl_func_var_def_blk = 0 -nl_typedef_blk_start = 0 -nl_typedef_blk_end = 0 -nl_typedef_blk_in = 0 -nl_var_def_blk_start = 0 -nl_var_def_blk_end = 0 -nl_var_def_blk_in = 0 -nl_fcall_brace = ignore -nl_enum_brace = ignore -nl_struct_brace = remove -nl_union_brace = ignore -nl_if_brace = remove -nl_brace_else = remove -nl_elseif_brace = remove -nl_else_brace = remove -nl_else_if = remove -nl_brace_finally = ignore -nl_finally_brace = ignore -nl_try_brace = ignore -nl_getset_brace = ignore -nl_for_brace = ignore -nl_catch_brace = ignore -nl_brace_catch = ignore -nl_brace_square = ignore -nl_brace_fparen = ignore -nl_while_brace = remove -nl_scope_brace = ignore -nl_unittest_brace = ignore -nl_version_brace = ignore -nl_using_brace = ignore -nl_brace_brace = ignore -nl_do_brace = remove -nl_brace_while = remove -nl_switch_brace = ignore -nl_synchronized_brace = ignore -nl_multi_line_cond = false -nl_multi_line_define = false -nl_before_case = false -nl_before_throw = ignore -nl_after_case = false -nl_case_colon_brace = ignore -nl_namespace_brace = ignore -nl_template_class = ignore -nl_class_brace = ignore -nl_class_init_args = ignore -nl_constr_init_args = ignore -nl_enum_own_lines = ignore -nl_func_type_name = ignore -nl_func_type_name_class = ignore -nl_func_class_scope = ignore -nl_func_scope_name = ignore -nl_func_proto_type_name = ignore -nl_func_paren = ignore -nl_func_def_paren = ignore -nl_func_decl_start = ignore -nl_func_def_start = ignore -nl_func_decl_start_single = ignore -nl_func_def_start_single = ignore -nl_func_decl_start_multi_line = false -nl_func_def_start_multi_line = false -nl_func_decl_args = ignore -nl_func_def_args = ignore -nl_func_decl_args_multi_line = false -nl_func_def_args_multi_line = false -nl_func_decl_end = ignore -nl_func_def_end = ignore -nl_func_decl_end_single = ignore -nl_func_def_end_single = ignore -nl_func_decl_end_multi_line = false -nl_func_def_end_multi_line = false -nl_func_decl_empty = ignore -nl_func_def_empty = ignore -nl_func_call_start_multi_line = false -nl_func_call_args_multi_line = false -nl_func_call_end_multi_line = false -nl_oc_msg_args = false -nl_fdef_brace = ignore -nl_cpp_ldef_brace = ignore -nl_return_expr = remove -nl_after_semicolon = false -nl_paren_dbrace_open = ignore -nl_after_brace_open = true -nl_after_brace_open_cmt = false -nl_after_vbrace_open = false -nl_after_vbrace_open_empty = false -nl_after_brace_close = false -nl_after_vbrace_close = false -nl_brace_struct_var = ignore -nl_define_macro = false -nl_squeeze_ifdef = false -nl_squeeze_ifdef_top_level = false -nl_before_if = ignore -nl_after_if = ignore -nl_before_for = ignore -nl_after_for = ignore -nl_before_while = ignore -nl_after_while = ignore -nl_before_switch = ignore -nl_after_switch = ignore -nl_before_synchronized = ignore -nl_after_synchronized = ignore -nl_before_do = ignore -nl_after_do = ignore -nl_ds_struct_enum_cmt = false -nl_ds_struct_enum_close_brace = false -nl_before_func_class_def = 0 -nl_before_func_class_proto = 0 -nl_class_colon = ignore -nl_constr_colon = ignore -nl_create_if_one_liner = false -nl_create_for_one_liner = false -nl_create_while_one_liner = false -nl_split_if_one_liner = false -nl_split_for_one_liner = false -nl_split_while_one_liner = false -pos_arith = ignore -pos_assign = ignore -pos_bool = ignore -pos_compare = ignore -pos_conditional = ignore -pos_comma = ignore -pos_enum_comma = ignore -pos_class_comma = ignore -pos_constr_comma = ignore -pos_class_colon = ignore -pos_constr_colon = ignore -code_width = 240 -ls_for_split_full = false -ls_func_split_full = false -ls_code_width = false -nl_max = 0 -nl_max_blank_in_func = 0 -nl_after_func_proto = 0 -nl_after_func_proto_group = 0 -nl_after_func_class_proto = 0 -nl_after_func_class_proto_group = 0 -nl_before_func_body_def = 0 -nl_before_func_body_proto = 0 -nl_after_func_body = 0 -nl_after_func_body_class = 0 -nl_after_func_body_one_liner = 0 -nl_before_block_comment = 0 -nl_before_c_comment = 0 -nl_before_cpp_comment = 0 -nl_after_multiline_comment = false -nl_after_label_colon = true -nl_after_struct = 0 -nl_before_class = 0 -nl_after_class = 0 -nl_before_access_spec = 0 -nl_after_access_spec = 0 -nl_comment_func_def = 0 -nl_after_try_catch_finally = 0 -nl_around_cs_property = 0 -nl_between_get_set = 0 -nl_property_brace = ignore -eat_blanks_after_open_brace = false -eat_blanks_before_close_brace = false -nl_remove_extra_newlines = 0 -nl_before_return = false -nl_after_return = false -nl_after_annotation = ignore -nl_between_annotation = ignore -mod_full_brace_do = force -mod_full_brace_for = force -mod_full_brace_function = ignore -mod_full_brace_if = force -mod_full_brace_if_chain = false -mod_full_brace_if_chain_only = false -mod_full_brace_nl = 0 -mod_full_brace_while = ignore -mod_full_brace_using = ignore -mod_paren_on_return = remove -mod_pawn_semicolon = false -mod_full_paren_if_bool = false -mod_remove_extra_semicolon = false -mod_add_long_function_closebrace_comment = 0 -mod_add_long_namespace_closebrace_comment = 0 -mod_add_long_class_closebrace_comment = 0 -mod_add_long_switch_closebrace_comment = 0 -mod_add_long_ifdef_endif_comment = 0 -mod_add_long_ifdef_else_comment = 0 -mod_sort_import = false -mod_sort_using = false -mod_sort_include = false -mod_move_case_break = false -mod_case_brace = ignore -mod_remove_empty_return = false -mod_sort_oc_properties = false -mod_sort_oc_property_thread_safe_weight = 0 -mod_sort_oc_property_readwrite_weight = 0 -mod_sort_oc_property_reference_weight = 0 -mod_sort_oc_property_getter_weight = 0 -mod_sort_oc_property_setter_weight = 0 -mod_sort_oc_property_nullability_weight = 0 -cmt_width = 0 -cmt_reflow_mode = 0 -cmt_convert_tab_to_spaces = false -cmt_indent_multi = false -cmt_c_group = false -cmt_c_nl_start = false -cmt_c_nl_end = false -cmt_cpp_group = false -cmt_cpp_nl_start = false -cmt_cpp_nl_end = false -cmt_cpp_to_c = false -cmt_star_cont = false -cmt_sp_before_star_cont = 0 -cmt_sp_after_star_cont = 0 -cmt_multi_check_last = true -cmt_multi_first_len_minimum = 4 -cmt_insert_file_header = "" -cmt_insert_file_footer = "" -cmt_insert_func_header = "" -cmt_insert_class_header = "" -cmt_insert_oc_msg_header = "" -cmt_insert_before_preproc = false -cmt_insert_before_inlines = true -cmt_insert_before_ctor_dtor = false -pp_indent = remove -pp_indent_at_level = false -pp_indent_count = 0 -pp_space = remove -pp_space_count = 0 -pp_indent_region = 0 -pp_region_indent_code = true -pp_indent_if = 0 -pp_if_indent_code = false -pp_define_at_level = false -use_indent_func_call_param = true -use_indent_continue_only_once = false -use_options_overriding_for_qt_macros = true -include_category_0 = "" -include_category_1 = "" -include_category_2 = "" -warn_level_tabs_found_in_verbatim_string_literals = 2 -# option(s) with 'not default' value: 0 -# diff --git a/doc/windbg.md b/doc/windbg.md index 7c054e598d..8b7629c00d 100644 --- a/doc/windbg.md +++ b/doc/windbg.md @@ -1,7 +1,7 @@ WinDBG ====== -The WinDBG support for r2 allows you to attach to VM running Windows +The WinDBG support for rizin allows you to attach to VM running Windows using a named socket file (will support more IOs in the future) to debug a windows box using the KD interface over serial port. @@ -43,11 +43,11 @@ Or just spawn the VM with qemu like this: -serial chardev:serial0 -hda Windows7-VM.vdi -Radare2 will use the 'winkd' io plugin to connect to a socket file +Rizin will use the 'winkd' io plugin to connect to a socket file created by virtualbox or qemu. Also, the 'winkd' debugger plugin and we should specify the x86-32 too. (32 and 64 bit debugging is supported) - $ r2 -a x86 -b 32 -D winkd winkd:///tmp/winkd.pipe + $ rizin -a x86 -b 32 -D winkd winkd:///tmp/winkd.pipe On Windows you should run the following line: @@ -71,7 +71,7 @@ In order to skip that trap we will need to change eip and run 'dc' twice: dr eip=eip+1 dc -Now the Windows VM will be interactive again. We will need to kill r2 and +Now the Windows VM will be interactive again. We will need to kill rizin and attach again to get back to control the kernel. In addition, the `dp` command can be used to list all processes, and diff --git a/doc/windows.md b/doc/windows.md deleted file mode 100644 index f95f58ceb7..0000000000 --- a/doc/windows.md +++ /dev/null @@ -1,34 +0,0 @@ -How to Build for Windows -======================== - -You can follow the [r2book](https://radare.gitbooks.io/rizinbook/content/first_steps/windows_compilation.html) for a more complete guide. - -Native ---------------- - -You will need: - -* Python 3 -* Meson (pip3 install meson) -* Visual Studio 2015 (or later) - - -First, call `vcvarsall.bat` with your architecture (x86, x64, arm) to setup the compilation environment. - - cd rizin - python3 sys\meson.py --release --backend vs2019 --shared --install --prefix="%cd%\rizin_dist" --webui - -You can change `--backend` to your VS version (`vs2015`, `vs2017`), `ninja` buildsystem is also supported. - -For XP support, append `--xp` to the command (not compatible with VS2019). - -You can then add `rizin_dist` to your PATH to make rizin accessible from everywhere. - -Crosscompilation ----------------- - -As building with mingw is no longer officially supported in rizin, crosscompilation isn't (easily) possible. - -You can check the official [Meson documentation](https://mesonbuild.com/Cross-compilation.html). - -Good luck. diff --git a/doc/zsh/_rz b/doc/zsh/_rz deleted file mode 100644 index 90d70a93b6..0000000000 --- a/doc/zsh/_rz +++ /dev/null @@ -1,89 +0,0 @@ -#compdef r2 -local context state state_descr line -local -i ret=1 - -r2_qc() { - r2 -qc $1 -- -} - -_rz() { - local -a options=( - '-\=[perform !=! command to run all commands remotely]' - '-0[print \x00 after init and every command]' - '-2[close stderr (silent warnings)]' - '-a+[set asm.arch]: :->arch' - "-A[run 'aaa' command to analyze all referenced code]" - '-b+[set asm.bits]:bits:(8 16 32 64)' - '-B+[set base address for PIE binaries]:baddr' - '-c+[execute radare command]:cmd' - '-C[file is host:port (alias for -c+=http://%s/cmd/)]' - "-d[debug the executable 'file' or running process 'pid']" - '-D+[enable debug mode (e cfg.debug=true)]: :->dbg.backend' - '-e+[evaluate config var]: :->config' - '-f[block size = file size]' - '-F+[force to use that rbin plugin]:binplug' - '(-h -hh)-h[show help message]' - '(-h -hh)-hh[show long help message]' - '-H[display variable]' - '-i+[run script file]:script:_files' - '-I+[run script file before the file is opened]:script:_files' - '-k+[set asm.os (linux, macos, w32, netbsd, ...)]: :->asm.os' - '-l+[load plugin file]:lib:_files' - '-L[list supported IO plugins]' - '-m+[map file at given address (loadaddr)]:addr' - '-M[do not demangle symbol names]' - '(-n -nn)-n[do not load RBin info]' - '(-n -nn)-nn[only load bin structures]' - '-N[do not load user settings and scripts]' - '(-q -Q)-q[quiet mode (no prompt) and quit after -i]' - '(-q -Q)-Q[quiet mode (no prompt) and quit faster (quietLeak=true)]' - '-p+[use project, list if no arg, load if no file]: :->project' - '-P+[apply rapatch file and quit]:rapatch:_files' - '-r+[specify rz_run profile to load (same as -e dbg.profile=X)]:dbg.profile' - '-R+[specify custom rz_run directive]:rrz_testule' - '-s+[initial seek]:addr' - '-S[start r2 in sandbox mode]' - '-t[load rz_bin info in thread]' - '-u[set bin.filter=false to get raw sym/sec/cls names]' - '(-v -V)-v[show rizin version]' - '(-v -V)-V[show rizin and lib versions)]' - '-w[open file in write mode]' - '-x[open without exec-flag, see io.exec]' - '(-z -zz)-z[do not load strings]' - '(-z -zz)-zz[load strings from raw binary (even if unknown)]' - ) - - _arguments -S -s : $options '1:file:_files' && ret=0 - - case $state in - arch) - local -a sub=(${(f)"$(r2_qc 'e asm.arch=?')"}) - _values 'arch' $sub && ret=0 - ;; - asm.os) - _values 'asm.os' $(r2_qc 'e asm.os=?') && ret=0 - ;; - config) - local -a sub=(${(f)"$(r2_qc 'e??' | sed -E -e 's/\[/\\[/g' -e 's/]/\\]/g' -e 's/\s*([^:]+): (.*)/\1[\2]:value:/')"}) - _values 'config var' $sub && ret=0 - ;; - dbg.backend) - _values 'dbg.backend' $(r2 '-D?') && ret=0 - ;; - project) - _values 'project' "${(f)"$(r2 -p)"}" && ret=0 - ;; - esac - return ret -} - -_rz "$@" - -# Local Variables: -# mode: shell-script -# coding: utf-8-unix -# indent-tabs-mode: nil -# sh-indentation: 2 -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 sts=2 et diff --git a/doc/zsh/_rz_asm b/doc/zsh/_rz_asm deleted file mode 100644 index a936b05a58..0000000000 --- a/doc/zsh/_rz_asm +++ /dev/null @@ -1,64 +0,0 @@ -#compdef rz_asm -local context state state_descr line -local -i ret=1 - -r2_qc() { - r2 -qc $1 -- -} - -_rz_asm() { - local -a options=( - '-a+[Set architecture to assemble/disassemble (see -L)]: :->arch' - '-A[Show Analysis information from given hexpairs]' - '-b+[Set cpu register size (8, 16, 32, 64) (RZ_ASM_BITS)]:bits:(8 16 32 64)' - '-c+[Select specific CPU (depends on arch)]:cpu' - '-C[Output in C format]' - '(-d -D)'{-d,-D}'[Disassemble from hexpair bytes (-D show hexpairs)]' - '-e[Use big endian instead of little endian]' - '-E[Display ESIL expression (same input as in -d)]' - '-f+[Read data from file]: :_files' - '-F+[Specify input and/or output filters (att2intel, x86.pseudo, ...)]:in\:out' - '(-h, -hh)'{-h,-hh}'[show help message, -hh for long]' - '-i+[ignore/skip N bytes of the input buffer]:bytes' - '(-j -r)-j[output in json format]' - '-k+[Select operating system (linux, windows, darwin, ..)]: :->asm.os' - '-l+[Input/Output length]:len' - '-L[List Asm plugins: (a=asm, d=disasm, A=analyze, e=ESIL)]' - '-o+[Set start address for code (default 0)]:offset' - '-O+[Output file name (rz_asm -Bf a.asm -O a)]: :_files' - '-p[Run SPP over input for assembly]' - '(-j -r)-r[output in radare commands]' - '-s+[Select syntax (intel, att)]: :->syntax' - '-B[Binary input/output (-l is mandatory for binary input)]' - '-v[Show version information]' - "-w[What's this instruction for? describe opcode]" - '-q[quiet mode]' - ) - - _arguments -S -s : $options '1:code|hex|-' && ret=0 - - case $state in - arch) - local -a sub=(${(f)"$(rz_asm -L | cut -c 18-28 | tr -d ' ')"}) - _values 'arch' $sub && ret=0 - ;; - asm.os) - _values 'asm.os' $(r2_qc 'e asm.os=?') && ret=0 - ;; - syntax) - _values 'syntax' $(rz_asm '-s?') && ret=0 - ;; - esac - return ret -} - -_rz_asm "$@" - -# Local Variables: -# mode: shell-script -# coding: utf-8-unix -# indent-tabs-mode: nil -# sh-indentation: 2 -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 sts=2 et diff --git a/doc/zsh/_rz_ax b/doc/zsh/_rz_ax deleted file mode 100644 index f968c2f730..0000000000 --- a/doc/zsh/_rz_ax +++ /dev/null @@ -1,43 +0,0 @@ -#compdef rz_ax -local context state state_descr line - -_rz_ax() { - local -a options=( - '-b[bin -> str ; rz_ax -b 01000101 01110110]' - '-B[str -> bin ; rz_ax -B hello]' - '-d[force integer ; rz_ax -d 3 -> 3 instead of 0x3]' - '-e[swap endianness ; rz_ax -e 0x33]' - '-D[base64 decode ;]' - '-E[base64 encode ;]' - '-f[floating point ; rz_ax -f 6.3+2.1]' - '-F[stdin slurp C hex ; rz_ax -F < shellcode.c]' - '-h[help ; rz_ax -h]' - '-i[dump as C array ; rz_ax -i < bytes]' - '-k[keep base ; rz_ax -k 33+3 -> 36]' - '-K[randomart ; rz_ax -K 0x34 1020304050]' - '-L[bin -> hex ; rz_ax -L 1111111]' - '-n[binary number ; rz_ax -n 0x1234 # 34120000]' - '-N[binary number ; rz_ax -N 0x1234 # \x34\x12\x00\x00]' - '-r[r2 style output ; rz_ax -r 0x1234]' - '-s[hexstr -> raw ; rz_ax -s 43 4a 50]' - '-S[raw -> hexstr ; rz_ax -S < /bin/ls > ls.hex]' - '-t[tstamp -> str ; rz_ax -t 1234567890]' - '-x[hash string ; rz_ax -x linux osx]' - '-u[units ; rz_ax -u 389289238 # 317.0M]' - '-w[signed word ; rz_ax -w 16 0xffff]' - '-v[version ; rz_ax -v]' - ) - - _arguments -S -s : $options '*:expr' -} - -_rz_ax "$@" - -# Local Variables: -# mode: shell-script -# coding: utf-8-unix -# indent-tabs-mode: nil -# sh-indentation: 2 -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 sts=2 et diff --git a/doc/zsh/_rz_bin b/doc/zsh/_rz_bin deleted file mode 100644 index 3f0dad62fe..0000000000 --- a/doc/zsh/_rz_bin +++ /dev/null @@ -1,90 +0,0 @@ -#compdef rz_bin -local context state state_descr line -local -i ret=1 - -r2_qc() { - r2 -qc $1 -- -} - -_rz_bin() { - local -a options=( - '-@+[show section, symbol or import at addr]:addr' - '-A[list sub-binaries and their arch-bits pairs]' - '-a+[set arch (x86, arm, .. or _)]: :->arch' - '-b+[set bits (32, 64 ...)]:bits:(8 16 32 64)' - '-B+[override base address (pie bins)]:addr' - '-c[list classes]' - '-C[create \[elf,mach0,pe\] with Code and Data hexpairs (see -a)]:fmt\:C\:D' - '-d[show debug/dwarf information]' - '-D+[demangle symbol name (-D all for bin.demangle=true)]:language' - '-e[entrypoint]' - '-E[globally exportable symbols]' - '-f+[select sub-bin named str]:str' - '-F+[force to use that bin plugin (ignore header check)]:binfmt' - '-g[same as -SMZIHVResizcld (show all info)]' - '-G+[load address . offset to header]:addr' - '-h[this help message]' - '-H[header fields]' - '-i[imports (symbols imported from libraries)]' - '-I[binary info]' - '(-j -q -qq -r)-j[output in json]' - "-k+[run sdb query. for example: '*']:sdb-query" - '-K+[calculate checksums (md5, sha1, ..)]: :->checksum' - '-l[linked libraries]' - '-L[list supported bin plugins or plugin details]: :->plugin' - '-m+[show source line at addr]:addr' - '-M[main (show address of main symbol)]' - '-n+[show section, symbol or import named str]:str' - '-N[force min:max number of chars per string (see -z and -zz)]:min\:max' - '-o+[output file/folder for write operations (out by default)]:_files' - '-O+[write/extract operations (-O help)]:str' - '-p[show physical addresses]' - '(-P -PP)-P[show debug/pdb information]' - '(-P -PP)-PP[download pdb file for binary]' - '(-j -q -qq -r)-q[be quiet, just show fewer data]' - '(-j -q -qq -r)-qq[show less info (no offset/size for -z for ex.)]' - '-Q[show load address used by dlopen (non-aslr libs)]' - '-r[radare output]' - '-R[relocations]' - '-s[symbols]' - '-S[sections]' - '-u[unfiltered (no rename duplicated symbols/sections)]' - '-U[resoUrces]' - '-v[display version and quit]' - '-V[Show binary version information]' - '-x[extract bins contained in file]' - '-X+[\[f\] .. package in fat or zip the given files and bins contained in file]:fmt' - '(-z -zz -zzz)-z[strings (from data section)]' - '(-z -zz -zzz)-zz[strings (from raw bins \[e bin.rawstr=1\])]' - '(-z -zz -zzz)-zzz[dump raw strings to stdout (for huge files)]' - '-Z[guess size of binary program]' - ) - - _arguments -S -s : $options '*:file:_files' && ret=0 - - case $state in - arch) - local -a sub=(${(f)"$(r2_qc 'e asm.arch=?')"}) - _values 'arch' $sub && ret=0 - ;; - checksum) - _values 'checksum' all $(r2_qc 'ph?') && ret=0 - ;; - plugin) - local -a sub=(${(f)"$(rz_bin -L | grep '^bin ' | sed -E 's/bin +([^ ]+) +(.*)/\1[\2]/')"}) - _values 'plugin' $sub && ret=0 - ;; - esac - return ret -} - -_rz_bin "$@" - -# Local Variables: -# mode: shell-script -# coding: utf-8-unix -# indent-tabs-mode: nil -# sh-indentation: 2 -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 sts=2 et diff --git a/doc/zsh/_rz_diff b/doc/zsh/_rz_diff deleted file mode 100644 index 1b3bee0872..0000000000 --- a/doc/zsh/_rz_diff +++ /dev/null @@ -1,61 +0,0 @@ -#compdef rz_diff -local context state state_descr line -local -i ret=1 - -r2_qc() { - r2 -qc $1 -- -} - -_rz_diff() { - local -a options=( - '-a[specify architecture plugin to use (x86, arm, ..)]: :->arch' - '(-A -AA)-A[run aaa after loading each binary (see -C)]' - '(-A -AA)-AA[run aaaa after loading each binary (see -C)]' - '-b+[specify register size for arch (16 (thumb), 32, 64, ..)]:bits:(8 16 32 64)' - '-c[count of changes]' - '(-C -g -i)-C[graphdiff code (columns: off-A, match-ratio, off-B) (see -A)]' - '-d[use delta diffing]' - '-D[show disasm instead of hexpairs]' - '-e+[set eval config var value for all RCore instances]:config' - '(-C -g -i)-g+[graph diff of given symbol, or between two offsets]:sym|off1,off2' - '-G+[run an r2 command on every RCore instance created]:cmd' - '(-C -g -i)-i[diff imports of target files (see -u, -U and -z)]' - '(-j -r -u -U)-j[output in json format]' - '-n[print bare addresses only (diff.bare=1)]' - '-O[code diffing with opcode bytes only]' - '-p[use physical addressing (io.va=0)]' - '-q[quiet mode (disable colors, reduce output)]' - '(-j -r -u -U)-r[output in radare commands]' - '(-s -ss)-s[compute text distance]' - '(-s -ss)-ss[compute text distance (using levenstein algorithm)]' - '-S+[sort code diff (name, namelen, addr, size, type, dist) (only for -C or -g)]:sort:(addr dist name namelen size type)' - '-t+[set threshold for code diff (default is 70%)]:0-100' - '-x[show two column hexdump diffing]' - '(-j -r -u -U)-u[unified output (---+++)]' - "(-j -r -u -U)-U[unified output using system 'diff']" - '-v[show version information]' - '-V[be verbose (current only for -s)]' - '-z[diff on extracted strings]' - ) - - _arguments -S -s : $options '1:file:_files' '2:file:_files' && ret=0 - - case $state in - arch) - local -a sub=(${(f)"$(r2_qc 'e asm.arch=?')"}) - _values 'arch' $sub && ret=0 - ;; - esac - return ret -} - -_rz_diff "$@" - -# Local Variables: -# mode: shell-script -# coding: utf-8-unix -# indent-tabs-mode: nil -# sh-indentation: 2 -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 sts=2 et diff --git a/doc/zsh/_rz_find b/doc/zsh/_rz_find deleted file mode 100644 index efd9618b1e..0000000000 --- a/doc/zsh/_rz_find +++ /dev/null @@ -1,39 +0,0 @@ -#compdef rz_find -local context state state_descr line - -_rz_find() { - local -a options=( - '-a+[only accept aligned hits]:align' - '-b+[set block size]:size' - '*-e+[search for regular expression string matches]:regex' - "-f+[start searching from address 'from']:from" - '-h[show this help]' - '-i[identify filetype (r2 -nqcpm file)]' - '-m[magic search, file-type carver]' - '-M+[set a binary mask to be applied on keywords]:str' - '-n[do not stop on read errors]' - '-q[quiet]' - '-r[print using radare commands]' - '*-s+[search for a specific string (can be used multiple times)]:str' - '*-S+[search for a specific wide string (can be used multiple times)]:str' - "-t+[stop search at address 'to']:to" - '-v[print version and exit]' - '*-x+[search for hexpair string (909090) (can be used multiple times)]:hex' - '-X[show hexdump of search results]' - '-z[search for zero-terminated strings]' - '-Z[show string found on each search hit]' - ) - - _arguments -S -s : $options '*:file:_files' -} - -_rz_find "$@" - -# Local Variables: -# mode: shell-script -# coding: utf-8-unix -# indent-tabs-mode: nil -# sh-indentation: 2 -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 sts=2 et diff --git a/doc/zsh/_rz_gg b/doc/zsh/_rz_gg deleted file mode 100644 index d715d71cc8..0000000000 --- a/doc/zsh/_rz_gg +++ /dev/null @@ -1,64 +0,0 @@ -#compdef rz_gg -local context state state_descr line -local -i ret=1 - -r2_qc() { - r2 -qc $1 -- -} - -_rz_gg() { - local -a options=( - '-a+[select architecture (x86, mips, arm)]: :->arch' - '-b+[register size (32, 64, ..)]:bits:(32 64)' - '-B+[append some hexpair bytes]:hexpairs' - '-c+[set configuration options]:k=v' - '-C+[append contents of file]:file' - '-d+[patch dword (4 bytes) at given offset]:off\:dword' - '-D+[patch qword (8 bytes) at given offset]:off\:qword' - '-e+[use specific encoder. see -L]:encoder' - '-f+[output format (raw, pe, elf, mach0)]:format' - '-F[output native format (osx=mach0, linux=elf, ..)]' - '-h[show this help]' - '-i+[include shellcode plugin, uses options. see -L]:shellcode' - '-I+[add include path]: :_directories' - "-k+[operating system's kernel (linux,bsd,osx,w32)]: :->asm.os" - '-L[list all plugins (shellcodes and encoders)]' - '-n+[append 32bit number (4 bytes)]:dword' - '-N+[append 64bit number (8 bytes)]:dword' - '-o+[output file]: :_files' - '-O[use default output file (filename without extension or a.out)]' - '-p+[add padding after compilation (padding=n10s32)]:padding' - '-P+[prepend debruijn pattern]:size' - '-q+[debruijn pattern offset]:fragment' - '-r[show raw bytes instead of hexpairs]' - '-s[show assembler]' - '-v[show version]' - '-w+[patch hexpairs at given offset]:off\:hex' - '-x[execute]' - '-z[output in C string syntax]' - ) - - _arguments -S -s : $options '1:file:_files' && ret=0 - - case $state in - arch) - local -a sub=(${(f)"$(r2_qc 'e asm.arch=?')"}) - _values 'arch' $sub && ret=0 - ;; - asm.os) - _values 'asm.os' $(r2_qc 'e asm.os=?') && ret=0 - ;; - esac - return ret -} - -_rz_gg "$@" - -# Local Variables: -# mode: shell-script -# coding: utf-8-unix -# indent-tabs-mode: nil -# sh-indentation: 2 -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 sts=2 et diff --git a/doc/zsh/_rz_hash b/doc/zsh/_rz_hash deleted file mode 100644 index 8f669b9bad..0000000000 --- a/doc/zsh/_rz_hash +++ /dev/null @@ -1,56 +0,0 @@ -#compdef rz_hash -local context state state_descr line -local -i ret=1 - -r2_qc() { - r2 -qc $1 -- -} - -_rz_hash() { - local -a options=( - "-a+[comma separated list of algorithms (default is 'sha256')]: :->algo" - '-b+[specify the size of the block (instead of full file)]:bsize' - '-B[show per-block hash]' - '-c+[compare with this hash]:hash' - '-e[swap endian (use little endian)]' - '-E[encrypt. Use -S to set key and -I to set IV]: :->coder' - '-D[decrypt. Use -S to set key and -I to set IV]: :->coder' - '-f+[start hashing at given address]:from' - '-i+[repeat hash N iterations]:num' - '-I[use give initialization vector (IV) (hexa or s:string)]:iv' - '-S[use given seed (hexa or s:string) use ^ to prefix (key for -E)]:seed' - "-k[show hash using the openssh's randomkey algorithm]" - '-q[run in quiet mode (-qq to show only the hash)]' - '-L[list all available algorithms (see -a)]' - '-r[output radare commands]' - '-s[hash this string instead of files]:string' - '-t[stop hashing at given address]:to' - '-x[hash this hexpair string instead of files]:hexstr' - '-v[show version information]' - ) - - _arguments -S -s : $options '*:file:_files' && ret=0 - - case $state in - algo) - _values 'algo' all $(r2_qc 'ph?') && ret=0 - ;; - coder) - local -a crypto=(rc2 rc4 rc6 aes-ecb aes-cbc ror rol rot blowfish cps2 des-ecb xor) - local -a coder=(base64 base91 punycode) - _values 'encoder/decoder' $crypto $coder && ret=0 - ;; - esac - return ret -} - -_rz_hash "$@" - -# Local Variables: -# mode: shell-script -# coding: utf-8-unix -# indent-tabs-mode: nil -# sh-indentation: 2 -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 sts=2 et diff --git a/librz/include/rz_cmd.h b/librz/include/rz_cmd.h index f6ea4e0e55..ef8b3ae388 100644 --- a/librz/include/rz_cmd.h +++ b/librz/include/rz_cmd.h @@ -17,24 +17,31 @@ typedef struct rz_core_t RzCore; #define MACRO_LABELS 20 #define RZ_CMD_MAXLEN 4096 +/** + * Value returned by a command handler. + */ typedef enum rz_cmd_status_t { - RZ_CMD_STATUS_OK = 0, // command handler exited in the right way - RZ_CMD_STATUS_WRONG_ARGS, // command handler could not handle the arguments passed to it - RZ_CMD_STATUS_ERROR, // command handler had issues while running (e.g. allocation error, etc.) - RZ_CMD_STATUS_INVALID, // command could not be executed (e.g. shell level error, not existing command, bad expression, etc.) - RZ_CMD_STATUS_EXIT, // command handler asks to exit the prompt loop + RZ_CMD_STATUS_OK = 0, ///< command handler exited in the right way + RZ_CMD_STATUS_WRONG_ARGS, ///< command handler could not handle the arguments passed to it + RZ_CMD_STATUS_ERROR, ///< command handler had issues while running (e.g. allocation error, etc.) + RZ_CMD_STATUS_INVALID, ///< command could not be executed (e.g. shell level error, not existing command, bad expression, etc.) + RZ_CMD_STATUS_EXIT, ///< command handler asks to exit the prompt loop } RzCmdStatus; +/** + * Type of argument a command handler can have. This is used for visualization + * in help messages and for autocompletion as well. + */ typedef enum rz_cmd_arg_type_t { - RZ_CMD_ARG_TYPE_NUM, //< Argument that can be interpreted by RzNum (numbers, flags, operations, etc.) - RZ_CMD_ARG_TYPE_STRING, //< Argument that can be an arbitrary string - RZ_CMD_ARG_TYPE_ENV, //< Argument can be the name of an existing rizin variable - RZ_CMD_ARG_TYPE_ZIGN, //< Argument can be the name of an existing zignature - RZ_CMD_ARG_TYPE_CHOICES, //< Argument can be one of the provided choices - RZ_CMD_ARG_TYPE_ARRAY_STRING, //< Argument is an array of arbitrary strings (if present, must be last in the list) - RZ_CMD_ARG_TYPE_FCN, //< Argument can be the name of an existing function - RZ_CMD_ARG_TYPE_FILE, //< Argument is a filename - RZ_CMD_ARG_TYPE_OPTION, //< Argument is an option, prefixed with `-`. It is present or not. + RZ_CMD_ARG_TYPE_NUM, ///< Argument that can be interpreted by RzNum (numbers, flags, operations, etc.) + RZ_CMD_ARG_TYPE_STRING, ///< Argument that can be an arbitrary string + RZ_CMD_ARG_TYPE_ENV, ///< Argument can be the name of an existing rizin variable + RZ_CMD_ARG_TYPE_ZIGN, ///< Argument can be the name of an existing zignature + RZ_CMD_ARG_TYPE_CHOICES, ///< Argument can be one of the provided choices + RZ_CMD_ARG_TYPE_ARRAY_STRING, ///< Argument is an array of arbitrary strings (if present, must be last in the list) + RZ_CMD_ARG_TYPE_FCN, ///< Argument can be the name of an existing function + RZ_CMD_ARG_TYPE_FILE, ///< Argument is a filename + RZ_CMD_ARG_TYPE_OPTION, ///< Argument is an option, prefixed with `-`. It is present or not. No argument. } RzCmdArgType; typedef int (*RzCmdCb) (void *user, const char *input); @@ -42,6 +49,9 @@ typedef RzCmdStatus (*RzCmdArgvCb) (RzCore *core, int argc, const char **argv); typedef RzCmdStatus (*RzCmdArgvModesCb) (RzCore *core, int argc, const char **argv, RzOutputMode mode); typedef int (*RzCmdNullCb) (void *user); +/** + * argc/argv data created from parsing the input command string. + */ typedef struct rz_cmd_parsed_args_t { int argc; char **argv; @@ -89,7 +99,8 @@ typedef struct rz_cmd_alias_t { } RzCmdAlias; /** - * A detailed entry that can be used to show additional info about a command entry. + * \brief A detailed entry that can be used to show additional info about a command entry. + * * It can contain whatever relevant information (e.g. examples, specific uses of * a command, variables, etc.). * @@ -232,35 +243,47 @@ typedef struct rz_cmd_desc_help_t { const RzCmdDescArg *args; } RzCmdDescHelp; -typedef enum { - // for old handlers that parse their own input and accept a single string. - // Mainly used for legacy reasons with old command handlers. +typedef enum rz_cmd_desc_type_t { + /** + * For old handlers that parse their own input and accept a single string. + * Mainly used for legacy reasons with old command handlers. + */ RZ_CMD_DESC_TYPE_OLDINPUT = 0, - // for handlers that accept argc/argv. It cannot have children. Use - // RZ_CMD_DESC_TYPE_GROUP if you need a command that can be both - // executed and has sub-commands. + /** + * For handlers that accept argc/argv. It cannot have children. Use + * RZ_CMD_DESC_TYPE_GROUP if you need a command that can be both + * executed and has sub-commands. + */ RZ_CMD_DESC_TYPE_ARGV, - // for cmd descriptors that are parent of other sub-commands, even if - // they may also have a sub-command with the same name. For example, - // `wc` is both the parent of `wci`, `wc*`, etc. but there is also `wc` - // as a sub-command. + /** + * For cmd descriptors that are parent of other sub-commands, even if + * they may also have a sub-command with the same name. For example, + * `wc` is both the parent of `wci`, `wc*`, etc. but there is also `wc` + * as a sub-command. + */ RZ_CMD_DESC_TYPE_GROUP, - // for cmd descriptors that are just used to group together related - // sub-commands. Do not use this if the command can be used by itself or - // if it's necessary to show its help, because this descriptor is not - // stored in the hashtable and cannot be retrieved except by listing the - // children of its parent. Most of the time you want RZ_CMD_DESC_TYPE_GROUP. + /** + * For cmd descriptors that are just used to group together related + * sub-commands. Do not use this if the command can be used by itself or + * if it's necessary to show its help, because this descriptor is not + * stored in the hashtable and cannot be retrieved except by listing the + * children of its parent. Most of the time you want RZ_CMD_DESC_TYPE_GROUP. + */ RZ_CMD_DESC_TYPE_INNER, - // for entries that shall be shown in the help tree but that are not - // commands on their own. `|?`, `@?`, `>?` are example of this. It is - // useful to provide help entries for them in the tree, but there are no - // command handlers for these. The RzCmdDescDetail in the help can be - // used to show fake children of this descriptor. + /** + * For entries that shall be shown in the help tree but that are not + * commands on their own. `|?`, `@?`, `>?` are example of this. It is + * useful to provide help entries for them in the tree, but there are no + * command handlers for these. The RzCmdDescDetail in the help can be + * used to show fake children of this descriptor. + */ RZ_CMD_DESC_TYPE_FAKE, - // for handlers that accept argc/argv and that provides multiple output - // modes (e.g. rizin commands, quiet output, json, long). It cannot have - // children. Use RZ_CMD_DESC_TYPE_GROUP if you need a command that can - // be both executed and has sub-commands. + /** + * For handlers that accept argc/argv and that provides multiple output + * modes (e.g. rizin commands, quiet output, json, long). It cannot have + * children. Use RZ_CMD_DESC_TYPE_GROUP if you need a command that can + * be both executed and has sub-commands. + */ RZ_CMD_DESC_TYPE_ARGV_MODES, } RzCmdDescType; diff --git a/meson.build b/meson.build index a3d14193a8..6a1eb303c1 100644 --- a/meson.build +++ b/meson.build @@ -211,8 +211,6 @@ else rizin_bindings = join_paths(rizin_libdir, 'rizin-bindings', rizin_version) endif -rizin_zsh_compdir = join_paths(rizin_datdir, 'zsh', 'site-functions') - # load plugin configuration subdir('librz') @@ -692,16 +690,4 @@ if cli_enabled install_dir: rizin_hud, rename: 'main' ) - - install_data( - 'doc/zsh/_rz', - 'doc/zsh/_rz_bin', - 'doc/zsh/_rz_diff', - 'doc/zsh/_rz_find', - 'doc/zsh/_rz_gg', - 'doc/zsh/_rz_hash', - 'doc/zsh/_rz_asm', - 'doc/zsh/_rz_ax', - install_dir: rizin_zsh_compdir - ) endif diff --git a/sys/emscripten.sh b/sys/emscripten.sh deleted file mode 100755 index b0cd832150..0000000000 --- a/sys/emscripten.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# find root -cd `dirname $PWD/$0` ; cd .. -#TODO: add support for ccache - -# XXX. fails with >1 -[ -z "${MAKE_JOBS}" ] && MAKE_JOBS=8 - -OLD_LDFLAGS="${LDFLAGS}" -unset LDFLAGS - -export CC="emcc --ignore-dynamic-linking -Oz" -export AR="emar" - -CFGFLAGS="--prefix=/usr --with-compiler=emscripten" -CFGFLAGS="${CFGFLAGS} --host x86_64-unknown-linux" -CFGFLAGS="${CFGFLAGS} --disable-debugger --with-librz --without-gpl" -CFGFLAGS="${CFGFLAGS} --without-libuv --without-jemalloc" -CFGFLAGS="${CFGFLAGS} --without-fork" # no process support in Emscripten - -make mrproper -cp -f plugins.emscripten.cfg plugins.cfg -./configure-plugins - -./configure ${CFGFLAGS} --host=emscripten && \ - make -s -j ${MAKE_JOBS} DEBUG=0 - -rm -f r2js.zip -zip r2js.zip binrz/*/*.js binrz/*/*/*.wasm