diff -Nru radare2-2.3.0+dfsg/.appveyor.yml radare2-2.8.0+dfsg/.appveyor.yml --- radare2-2.3.0+dfsg/.appveyor.yml 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/.appveyor.yml 2018-08-07 14:12:36.000000000 +0000 @@ -64,16 +64,16 @@ - ps: $env:ARTIFACT_ZIP = "$env:DIST_FOLDER.zip" # Download required packages - cmd: if defined BUILD_DIR ( %PYTHON%\python.exe -m pip install meson ) - - cmd: if defined NINJA_URL ( powershell -Command wget %NINJA_URL% -OutFile ninja.zip && unzip ninja.zip ) + - cmd: if defined NINJA_URL ( powershell -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; wget %NINJA_URL% -OutFile ninja.zip" && unzip ninja.zip ) # Build scripts build_script: - appveyor AddMessage "Compiling radare2 %R2_VERSION% (%builder%)" - if %builder% == msvc_cccl_64 ( sys\msvc.bat && make windist WINBITS=%builder% ) - - cmd: if %builder% == vs2015_64 ( set "PATH=C:\mingw\bin;C:\mingw\msys\1.0\bin;%PYTHON%;%PATH%" && call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 && python sys\meson.py --backend vs2015 --release --xp --install="%DIST_FOLDER%" && zip -r %ARTIFACT_ZIP% %DIST_FOLDER% ) + - cmd: if %builder% == vs2015_64 ( set "PATH=C:\mingw\bin;C:\mingw\msys\1.0\bin;%PYTHON%;%PATH%" && call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 && python sys\meson.py --backend vs2015 --release --xp --install="%DIST_FOLDER%" --options static_runtime=true && zip -r %ARTIFACT_ZIP% %DIST_FOLDER% ) - - cmd: if %builder% == vs2015_32 ( set "PATH=C:\mingw\bin;C:\mingw\msys\1.0\bin;%PYTHON%;%PATH%" && call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 && python sys\meson.py --backend vs2015 --release --xp --install="%DIST_FOLDER%" && zip -r %ARTIFACT_ZIP% %DIST_FOLDER% ) + - cmd: if %builder% == vs2015_32 ( set "PATH=C:\mingw\bin;C:\mingw\msys\1.0\bin;%PYTHON%;%PATH%" && call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 && python sys\meson.py --backend vs2015 --release --xp --install="%DIST_FOLDER%" --options static_runtime=true && zip -r %ARTIFACT_ZIP% %DIST_FOLDER% ) - cmd: if %builder% == vs2015_64_dyn ( set "PATH=C:\mingw\bin;C:\mingw\msys\1.0\bin;%PYTHON%;%PATH%" && call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 && python sys\meson.py --release --shared --install="%DIST_FOLDER%" && zip -r %ARTIFACT_ZIP% %DIST_FOLDER% ) diff -Nru radare2-2.3.0+dfsg/binr/blob/Makefile radare2-2.8.0+dfsg/binr/blob/Makefile --- radare2-2.3.0+dfsg/binr/blob/Makefile 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/binr/blob/Makefile 2018-08-07 14:12:36.000000000 +0000 @@ -3,15 +3,14 @@ BINS=rabin2 rarun2 rasm2 ragg2 rahash2 rax2 rafind2 radiff2 BINS2=radare2 ${BINS} + +SOURCES= main.c rabin2.c radare2.c radiff2.c rafind2.c +SOURCES+=rahash2.c rarun2.c rasm2.c rax2.c ragg2.c + include ../../config-user.mk -ifneq ($(OSTYPE),windows) -CFLAGS+=-pie -fPIC -fPIE -LDFLAGS+=-pie -endif SHLR=../../shlr - ifneq (${ANDROID},1) ifneq (${OSTYPE},linux) LDFLAGS+=-lpthread @@ -22,41 +21,6 @@ CFLAGS+=-I../../libr/include/ CFLAGS+=-I$(SHLR)/spp -#ifeq ($(STATIC_BUILD),1) -ifeq ($(WITHNONPIC),1) -LDFLAGS+=../../libr/config/libr_config.a -LDFLAGS+=../../libr/io/libr_io.a -LDFLAGS+=../../libr/asm/libr_asm.a -LDFLAGS+=../../libr/egg/libr_egg.a -LDFLAGS+=../../libr/core/libr_core.a -LDFLAGS+=../../libr/crypto/libr_crypto.a -LDFLAGS+=../../libr/parse/libr_parse.a -LDFLAGS+=../../libr/anal/libr_anal.a -LDFLAGS+=../../libr/fs/libr_fs.a -LDFLAGS+=../../libr/magic/libr_magic.a -LDFLAGS+=../../libr/cons/libr_cons.a -LDFLAGS+=../../libr/syscall/libr_syscall.a -LDFLAGS+=../../libr/flag/libr_flag.a -LDFLAGS+=../../libr/reg/libr_reg.a -LDFLAGS+=../../libr/debug/libr_debug.a -LDFLAGS+=../../libr/search/libr_search.a -LDFLAGS+=../../libr/lang/libr_lang.a -LDFLAGS+=../../libr/bp/libr_bp.a -LDFLAGS+=../../libr/hash/libr_hash.a -LDFLAGS+=../../libr/bin/libr_bin.a -LDFLAGS+=../../libr/util/libr_util.a -# extra libs # -ifeq (1,$(WITH_GPL)) -LDFLAGS+=../../shlr/grub/libgrubfs.a -endif -LDFLAGS+=../../shlr/capstone/libcapstone.a -LDFLAGS+=../../shlr/sdb/src/libsdb.a -LDFLAGS+=../../shlr/gdb/lib/libgdbr.a -LDFLAGS+=../../shlr/windbg/libr_windbg.a -LDFLAGS+=../../shlr/java/libr_java.a -LDFLAGS+=-lm -LDFLAGS+=../../libr/socket/libr_socket.a -else LDFLAGS+=-L../../libr/io -lr_io LDFLAGS+=-L../../libr/bp -lr_bp LDFLAGS+=-L../../libr/socket -lr_socket @@ -78,7 +42,6 @@ LDFLAGS+=-L../../libr/debug -lr_debug LDFLAGS+=-L../../libr/search -lr_search LDFLAGS+=-L../../libr/config -lr_config -endif LDFLAGS+=${LINK} include ../../libr/config.mk @@ -102,9 +65,6 @@ mv version.k version.c rm -f ${BINS2} r2 -SOURCES= main.c rabin2.c radare2.c radiff2.c rafind2.c -SOURCES+=rahash2.c rarun2.c rasm2.c rax2.c ragg2.c - build: mv main.c main.k mv version.c version.k @@ -130,6 +90,6 @@ mkdir -p "${DESTDIR}${BINDIR}" for FILE in r2 ${BINS2} ; do \ rm -f "${DESTDIR}${BINDIR}/$$FILE" ; \ - cp -af "$$FILE" "${DESTDIR}${BINDIR}/$$FILE" ; \ + cp -PRpf "$$FILE" "${DESTDIR}${BINDIR}/$$FILE" ; \ done diff -Nru radare2-2.3.0+dfsg/binr/Makefile radare2-2.8.0+dfsg/binr/Makefile --- radare2-2.3.0+dfsg/binr/Makefile 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/binr/Makefile 2018-08-07 14:12:36.000000000 +0000 @@ -28,11 +28,9 @@ ${INSTALL_PROGRAM} "$$BINARY/$$BINARY" "${DESTDIR}${BINDIR}/$$BINARY" ; \ done ${INSTALL_SCRIPT} "$(BTOP)/r2pm/r2pm" "${DESTDIR}${BINDIR}/r2pm" - rm -f "${DESTDIR}${BINDIR}/ragg2-cc" rm -rf "${DESTDIR}${DATADIR}/radare2/${VERSION}/r2pm" #mkdir -p "${DESTDIR}${DATADIR}/radare2/${VERSION}/r2pm" #cp -rf r2pm/d/* "${DESTDIR}${DATADIR}/radare2/${VERSION}/r2pm" - ${INSTALL_SCRIPT} ragg2/ragg2-cc "${DESTDIR}${BINDIR}/ragg2-cc" -cd "${DESTDIR}${BINDIR}" && rm -f r2 ; ln -fs radare2 r2 ifeq ($(WITHPIC),1) ${INSTALL_LIB} "preload/libr2.$(EXT_SO)" "${DESTDIR}${LIBDIR}" @@ -42,13 +40,14 @@ endif ios_sign ios-sign ios-sdk-sign: - for a in $(BINS) ; do xcrun --sdk iphoneos codesign -s- --entitlements radare2/radare2.xml $$a ; done + -for a in $(BINS) ; do xcrun --sdk iphoneos codesign -s- --entitlements radare2/radare2.xml $$a ; done + -for a in ../libr/*/*.${EXT_SO} ; do xcrun --sdk iphoneos codesign -s- --entitlements radare2/radare2.xml $$a ; done + -for a in ../libr/*/p/*.${EXT_SO} ; do xcrun --sdk iphoneos codesign -s- --entitlements radare2/radare2.xml $$a ; done symstall install-symlink: cd .. && \ mkdir -p "${DESTDIR}${BINDIR}" && \ for BINARY in ${BINS} ; do ln -fs "${BTOP}/$$BINARY/$$BINARY" "${DESTDIR}${BINDIR}/$$BINARY" ; done - cd .. && ln -fs "${BTOP}/ragg2/ragg2-cc" "${DESTDIR}${BINDIR}/ragg2-cc" cd .. && ln -fs "${BTOP}/r2pm/r2pm" "${DESTDIR}${BINDIR}/r2pm" cd .. && rm -rf "${DESTDIR}${DATADIR}/radare2/${VERSION}/r2pm" cd .. && mkdir -p "${DESTDIR}${DATADIR}/radare2/${VERSION}/" @@ -62,7 +61,6 @@ deinstall uninstall: -cd .. ; \ for BINARY in ${BINS} ; do rm -f "${DESTDIR}${BINDIR}/$$BINARY" ; done ; \ - rm -f "${DESTDIR}${BINDIR}/ragg2-cc" ; \ rm -f "${DESTDIR}${BINDIR}/r2pm" ; \ rm -f "${DESTDIR}${BINDIR}/r2" diff -Nru radare2-2.3.0+dfsg/binr/r2agent/Makefile radare2-2.8.0+dfsg/binr/r2agent/Makefile --- radare2-2.3.0+dfsg/binr/r2agent/Makefile 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/binr/r2agent/Makefile 2018-08-07 14:12:36.000000000 +0000 @@ -1,4 +1,9 @@ +include ../../config-user.mk BIN=r2agent BINDEPS=r_socket r_cons r_util +ifeq ($(OSTYPE),android) +LDFLAGS+=${DL_LIBS} -lm +endif + include ../rules.mk diff -Nru radare2-2.3.0+dfsg/binr/r2agent/meson.build radare2-2.8.0+dfsg/binr/r2agent/meson.build --- radare2-2.3.0+dfsg/binr/r2agent/meson.build 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/binr/r2agent/meson.build 2018-08-07 14:12:36.000000000 +0000 @@ -1,5 +1,10 @@ executable('r2agent', 'r2agent.c', include_directories: [platform_inc], - link_with: [r_util, r_socket, r_cons], - install: true + dependencies: [ + r_util_dep, + r_socket_dep, + r_cons_dep + ], + install: true, + implicit_include_directories: false ) diff -Nru radare2-2.3.0+dfsg/binr/r2agent/r2agent.c radare2-2.8.0+dfsg/binr/r2agent/r2agent.c --- radare2-2.3.0+dfsg/binr/r2agent/r2agent.c 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/binr/r2agent/r2agent.c 2018-08-07 14:12:36.000000000 +0000 @@ -1,4 +1,4 @@ -/* radare2 - LGPL - Copyright 2013-2016 - pancake */ +/* radare2 - LGPL - Copyright 2013-2018 - pancake */ #include #include @@ -78,13 +78,11 @@ if (dodaemon) { #if LIBC_HAVE_FORK int pid = fork (); -#else - int pid = -1; -#endif if (pid > 0) { printf ("%d\n", pid); return 0; } +#endif } s = r_socket_new (false); s->local = listenlocal; @@ -93,17 +91,17 @@ r_socket_free (s); return 1; } - + eprintf ("http://localhost:%d/\n", s->port); if (dosandbox && !r_sandbox_enable (true)) { eprintf ("sandbox: Cannot be enabled.\n"); return 1; } - while (!r_cons_singleton ()->breaked) { + while (!r_cons_singleton ()->context->breaked) { char *result_heap = NULL; const char *result = page_index; - rs = r_socket_http_accept (s, timeout); + rs = r_socket_http_accept (s, 0, timeout); if (!rs) continue; if (!strcmp (rs->method, "GET")) { if (!strncmp (rs->path, "/proc/kill/", 11)) { @@ -116,21 +114,23 @@ int pid; int session_port = 3000 + r_num_rand (1024); char *filename = rs->path + 11; - int filename_len = strlen (filename); + char *escaped_filename = r_str_escape (filename); + int escaped_len = strlen (escaped_filename); char *cmd; - if (!(cmd = malloc (filename_len + 40))) { + if (!(cmd = malloc (escaped_len + 40))) { perror ("malloc"); return 1; } sprintf (cmd, "r2 -q %s-e http.port=%d -c=h \"%s\"", listenlocal? "": "-e http.bind=public ", - session_port, filename); + session_port, escaped_filename); // TODO: use r_sys api to get pid when running in bg pid = r_sys_cmdbg (cmd); free (cmd); - result = result_heap = malloc (1024 + filename_len); + free (escaped_filename); + result = result_heap = malloc (1024 + escaped_len); if (!result) { perror ("malloc"); return 1; diff -Nru radare2-2.3.0+dfsg/binr/r2pm/meson.build radare2-2.8.0+dfsg/binr/r2pm/meson.build --- radare2-2.3.0+dfsg/binr/r2pm/meson.build 1970-01-01 00:00:00.000000000 +0000 +++ radare2-2.8.0+dfsg/binr/r2pm/meson.build 2018-08-07 14:12:36.000000000 +0000 @@ -0,0 +1 @@ +install_data('r2pm', install_dir: get_option('bindir')) diff -Nru radare2-2.3.0+dfsg/binr/r2pm/r2pm radare2-2.8.0+dfsg/binr/r2pm/r2pm --- radare2-2.3.0+dfsg/binr/r2pm/r2pm 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/binr/r2pm/r2pm 2018-08-07 14:12:36.000000000 +0000 @@ -20,19 +20,35 @@ export GLOBAL=0 export R2PM_JOBS=4 export R2VERSION="`r2 -qv`" +export R2PMCACHE="$HOME/.r2pm.cache" R2PM=$0 -PREFIX="`r2 -H PREFIX`" +R2PMCACHE_LOADED=0 +if [ -f ~/.r2pm.cache ]; then + . ~/.r2pm.cache + export LIBEXT="$LIBEXT" + export R2CONFIGHOME="$R2CONFIGHOME" + export R2DATAHOME="$R2DATAHOME" + PREFIX="$PREFIX" + if [ -z "${LIBEXT}" -o -z "${R2CONFIGHOME}" -o -z "${R2DATAHOME}" -o -z "${PREFIX}" ]; then + echo "[r2pm] corrupted cache, please run r2pm cache" + else + R2PMCACHE_LOADED=1 + fi +fi +if [ "${R2PMCACHE_LOADED}" != 1 ]; then + export LIBEXT="`r2 -H LIBEXT`" + export R2CONFIGHOME="`r2 -H RCONFIGHOME`" + export R2DATAHOME="`r2 -H RDATAHOME`" + PREFIX="`r2 -H PREFIX`" +fi BINDIR="${PREFIX}/bin/" LIBDIR="${PREFIX}/lib/" WRKDIR="$PWD" -export LIBEXT="`r2 -H LIBEXT`" -export R2HOMEDIR="`r2 -H RHOMEDIR`" - # prefix export R2PM_SYSPREFIX="${PREFIX}" -export R2PM_HOMEPREFIX="${R2HOMEDIR}/prefix" +export R2PM_HOMEPREFIX="${R2DATAHOME}/prefix" export R2PM_PREFIX="${R2PM_HOMEPREFIX}" # bindir @@ -43,12 +59,12 @@ export R2PM_BINDIR # plugdir -[ -z "${R2PM_PLUGDIR}" ] && R2PM_PLUGDIR="${R2HOMEDIR}/plugins" +[ -z "${R2PM_PLUGDIR}" ] && R2PM_PLUGDIR="${R2DATAHOME}/plugins" export R2PM_PLUGDIR # www export R2PM_SYSWWWROOT="`r2 -qc 'e http.root' --`" -export R2PM_HOMEWWWROOT="${R2HOMEDIR}/www/" +export R2PM_HOMEWWWROOT="${R2DATAHOME}/www/" export R2PM_WWWROOT="${R2PM_HOMEWWWROOT}" # pkgconfig @@ -59,6 +75,8 @@ export R2PM_PYPATH="${R2PM_PREFIX}/python" export R2PM_OLDPWD="${PWD}" +export RHOMEDIR="`r2 -H RHOMEDIR`" + if [ "`uname`" = Darwin ]; then export LD_LIBRARY_PATH="${R2PM_HOMEPREFIX}/lib" else @@ -69,16 +87,16 @@ TRAVIS_TYPE=XX TRAVIS_JOB=86948888 IS_SYSPKG=0 -[ -z "$R2PM_USRDIR" ] && R2PM_USRDIR="${HOME}/.config/radare2/r2pm" -R2PM_ETCD="${R2HOMEDIR}/radare2rc.d" +[ -z "$R2PM_USRDIR" ] && R2PM_USRDIR="${R2DATAHOME}/r2pm" +R2PM_ETCD="${R2CONFIGHOME}/radare2rc.d" # TODO. support system plugin installs R2PM_PLUGDIR="${R2PM_PREFIX}/lib/radare2/last" if [ -z "${R2PM_GITDIR}" ]; then R2PM_GITDIR="${R2PM_USRDIR}/git/" fi if [ -z "${R2PM_DBDIR}" ]; then - if [ -d "${HOME}/.config/radare2/r2pm/db" ]; then - R2PM_DBDIR="${HOME}/.config/radare2/r2pm/db" + if [ -d "${R2DATAHOME}/r2pm/db" ]; then + R2PM_DBDIR="${R2DATAHOME}/r2pm/db" fi fi if [ -z "${R2PM_DBDIR}" ]; then @@ -123,16 +141,17 @@ } commitSuicide() { - confirm "Do you wanna purge r2 completely from your system and home? (y/N)?" + confirm "Do you wanna purge r2 completely from your system and home?" if [ $? != 0 ]; then echo "Aborted." > /dev/stderr exit 1 fi countDown "Self destroying in" 3 - confirm "> Delete ~/config.radare2" && ( - rm -rf ~/.config/radare2 + confirm "> Delete $RHOMEDIR" && ( + rm -rf "$RHOMEDIR" ) - R2PATHS="${PREFIX} /usr /usr/local /opt/radare2 ~/config/radare2/prefix /" + R2PATHS="${PREFIX}:/usr:/usr/local:/opt/radare2:${RHOMEDIR}/prefix:/" + IFS=: for a in $R2PATHS ; do if [ -x "${a}/bin/radare2" ]; then confirm "> Delete r2 from ${a}" && ( @@ -140,12 +159,14 @@ ) fi done + unset IFS } case "$1" in init|up|update) [ -z "$R2PM_DBDIR" ] && R2PM_DBDIR="${R2PM_USRDIR}/db" mkdir -p "${R2PM_GITDIR}" + mkdir -p "${HOME}/.config" cd "${R2PM_GITDIR}" if [ -d radare2-pm ]; then cd radare2-pm @@ -490,6 +511,11 @@ #TODO set R2PM_ETCD= to a "global" radare2rc.d r2pm_uninstall "$@" ;; +-cp) + if [ -n "${R2PM_PLUGDIR}" ]; then + rm -f "${R2PM_PLUGDIR}/*" + fi + ;; -ci) shift ${R2PM} clean $* @@ -547,6 +573,13 @@ exit 1 fi ;; +cache) + echo "export LIBEXT=\"${LIBEXT}\"" > "${R2PMCACHE}" + echo "export R2CONFIGHOME=\"${R2CONFIGHOME}\"" >> "${R2PMCACHE}" + echo "export R2DATAHOME=\"${R2DATAHOME}\"" >> "${R2PMCACHE}" + echo "export PREFIX=\"${PREFIX}\"" >> "${R2PMCACHE}" + echo "[r2pm] r2 environment cached in ${R2PMCACHE}" + ;; -a|add) if [ "$2" = "help" ]; then printf '%s\n' \ @@ -627,19 +660,21 @@ -H variable show value of given variable -c,clean ([git/dir]) clear source cache (GITDIR) -ci (pkgname) clean install of given package + -cp clean the user's home plugin directory -d,doc [pkgname] show documentation for given package -w what/where is installed init | update .. initialize/update database cd [git/dir] cd into given git (see 'r2pm ls') ls ls all cloned git repos in GITDIR suicide self remove all (home + system) installations of r2 + cache cache contents of r2 -H to make r2pm r2-independent Environment: SUDO=sudo use this tool as sudo - R2PM_PLUGDIR=~/.config/radare2/plugins # default value, home-install for plugins - R2PM_BINDIR=~/.config/radare2/prefix/bin # bindir in r2's PATH - R2PM_PLUGDIR=/usr/lib/radare2/last/ # for system-wide plugin installs - R2PM_DBDIR=~/.config/radare2/r2pm/db # location of the db - R2PM_GITDIR=~/.config/radare2/r2pm/git # cloned git repositories + R2PM_PLUGDIR=~/.local/share/radare2/plugins # default value, home-install for plugins + R2PM_BINDIR=~/.local/share/radare2/prefix/bin # bindir in r2's PATH + R2PM_PLUGDIR=/usr/lib/radare2/last/ # for system-wide plugin installs + R2PM_DBDIR=~/.local/share/radare2/r2pm/db # location of the db + R2PM_GITDIR=~/.local/share/radare2/r2pm/git # cloned git repositories HELP ;; esac diff -Nru radare2-2.3.0+dfsg/binr/rabin2/Makefile radare2-2.8.0+dfsg/binr/rabin2/Makefile --- radare2-2.3.0+dfsg/binr/rabin2/Makefile 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/binr/rabin2/Makefile 2018-08-07 14:12:36.000000000 +0000 @@ -6,7 +6,6 @@ include ../rules.mk -ifeq ($(WITHNONPIC),1) include ../../libr/socket/deps.mk include ../../shlr/zip/deps.mk include ../../shlr/gdb/deps.mk @@ -14,4 +13,3 @@ include ../../shlr/bochs/deps.mk include ../../shlr/qnx/deps.mk include ../../shlr/ar/deps.mk -endif diff -Nru radare2-2.3.0+dfsg/binr/rabin2/meson.build radare2-2.8.0+dfsg/binr/rabin2/meson.build --- radare2-2.3.0+dfsg/binr/rabin2/meson.build 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/binr/rabin2/meson.build 2018-08-07 14:12:36.000000000 +0000 @@ -1,10 +1,17 @@ - executable('rabin2', 'rabin2.c', include_directories: [platform_inc], - link_with: [r_util, r_cons, r_config, r_hash, r_io, r_crypto, r_core, r_magic, libr2java], - objects: [ - libr2sdb.extract_all_objects(), - r_bin.extract_all_objects() + dependencies: [ + r_util_dep, + r_cons_dep, + r_config_dep, + r_hash_dep, + r_io_dep, + r_crypto_dep, + r_core_dep, + r_magic_dep, + r_bin_dep, + sdb_dep ], - install: true + install: true, + implicit_include_directories: false ) diff -Nru radare2-2.3.0+dfsg/binr/rabin2/rabin2.c radare2-2.8.0+dfsg/binr/rabin2/rabin2.c --- radare2-2.3.0+dfsg/binr/rabin2/rabin2.c 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/binr/rabin2/rabin2.c 2018-08-07 14:12:36.000000000 +0000 @@ -27,7 +27,7 @@ static int rabin_show_help(int v) { printf ("Usage: rabin2 [-AcdeEghHiIjlLMqrRsSUvVxzZ] [-@ at] [-a arch] [-b bits] [-B addr]\n" " [-C F:C:D] [-f str] [-m addr] [-n str] [-N m:M] [-P[-P] pdb]\n" - " [-o str] [-O str] [-k query] [-D lang symname] | file\n"); + " [-o str] [-O str] [-k query] [-D lang symname] file\n"); if (v) { printf ( " -@ [addr] show section, symbol or import at addr\n" @@ -45,7 +45,7 @@ " -E globally exportable symbols\n" " -f [str] select sub-bin named str\n" " -F [binfmt] force to use that bin plugin (ignore header check)\n" - " -g same as -SMZIHVResizcld (show all info)\n" + " -g same as -SMZIHVResizcld -SS -ee (show all info)\n" " -G [addr] load address . offset to header\n" " -h this help message\n" " -H header fields\n" @@ -72,6 +72,7 @@ " -R relocations\n" " -s symbols\n" " -S sections\n" + " -SS segments\n" " -u unfiltered (no rename duplicated symbols/sections)\n" " -U resoUrces\n" " -v display version and quit\n" @@ -95,6 +96,7 @@ " RABIN2_DEBASE64: e bin.debase64 # try to debase64 all strings\n" " RABIN2_DMNGLRCMD: e bin.demanglercmd # try to purge false positives\n" " RABIN2_PDBSERVER: e pdb.server # use alternative PDB server\n" + " RABIN2_SYMSTORE: e pdb.symstore # path to downstream symbol store\n" " RABIN2_PREFIX: e bin.prefix # prefix symbols/sections/relocs with a specific string\n"); } return 1; @@ -145,12 +147,12 @@ static bool extract_binobj(const RBinFile *bf, RBinXtrData *data, int idx) { ut64 bin_size = data ? data->size : 0; ut8 *bytes; + const char *xtr_type = ""; char *arch = "unknown"; int bits = 0; char *libname = NULL; const char *filename = bf ? bf->file : NULL; - char *path = NULL, *outpath = NULL, *outfile = NULL, *ptr = NULL; - ut32 outfile_sz = 0, outpath_sz = 0; + char *path = NULL, *ptr = NULL; bool res = false; if (!bf || !data || !filename) { @@ -160,8 +162,9 @@ arch = data->metadata->arch; bits = data->metadata->bits; libname = data->metadata->libname; + xtr_type = data->metadata->xtr_type; } - if (bin_size == bf->size && bin_size) { + if (!strcmp (xtr_type, "fat") && bin_size == bf->size && bin_size) { eprintf ("This is not a fat bin\n"); return false; } @@ -184,14 +187,7 @@ } else { ptr = path; } - outpath_sz = strlen (path) + 20; - if (outpath_sz > 0) { - outpath = malloc (outpath_sz); - } - - if (outpath) { - snprintf (outpath, outpath_sz, "%s.fat", ptr); - } + char *outpath = r_str_newf ("%s.fat", ptr); if (!outpath || !r_sys_mkdirp (outpath)) { free (path); free (outpath); @@ -199,20 +195,9 @@ return false; } - outfile_sz = outpath_sz + strlen (ptr) + strlen (arch) + 23; - if (outfile_sz) { - outfile = malloc (outfile_sz); - } - - if (outfile) { - if (libname) { - snprintf (outfile, outfile_sz, "%s/%s.%s.%s_%i.%d", - outpath, ptr, arch, libname, bits, idx); - } else { - snprintf (outfile, outfile_sz, "%s/%s.%s_%i.%d", - outpath, ptr, arch, bits, idx); - } - } + char *outfile = libname + ? r_str_newf ("%s/%s.%s.%s_%i.%d", outpath, ptr, arch, libname, bits, idx) + : r_str_newf ("%s/%s.%s_%i.%d", outpath, ptr, arch, bits, idx); if (!outfile || !r_file_dump (outfile, bytes, bin_size, 0)) { eprintf ("Error extracting %s\n", outfile); @@ -573,7 +558,10 @@ bin = core.bin; if (!(tmp = r_sys_getenv ("RABIN2_NOPLUGINS"))) { - char *homeplugindir = r_str_home (R2_HOMEDIR "/plugins"); + char *homeplugindir = r_str_home (R2_HOME_PLUGINS); + char *plugindir = r_str_r2_prefix (R2_PLUGINS); + char *extrasdir = r_str_r2_prefix (R2_EXTRAS); + char *bindingsdir = r_str_r2_prefix (R2_BINDINGS); l = r_lib_new ("radare_plugin"); r_lib_add_handler (l, R_LIB_TYPE_BIN, "bin plugins", &__lib_bin_cb, &__lib_bin_dt, NULL); @@ -588,10 +576,13 @@ r_lib_opendir (l, path); } r_lib_opendir (l, homeplugindir); + r_lib_opendir (l, plugindir); + r_lib_opendir (l, extrasdir); + r_lib_opendir (l, bindingsdir); free (homeplugindir); - r_lib_opendir (l, R2_LIBDIR "/radare2/" R2_VERSION); - r_lib_opendir (l, R2_LIBDIR "/radare2-extras/" R2_VERSION); - r_lib_opendir (l, R2_LIBDIR "/radare2-bindings/" R2_VERSION); + free (plugindir); + free (extrasdir); + free (bindingsdir); } free (tmp); @@ -638,12 +629,14 @@ set_action (R_BIN_REQ_IMPORTS); set_action (R_BIN_REQ_SYMBOLS); set_action (R_BIN_REQ_SECTIONS); + set_action (R_BIN_REQ_SEGMENTS); set_action (R_BIN_REQ_STRINGS); set_action (R_BIN_REQ_SIZE); set_action (R_BIN_REQ_INFO); set_action (R_BIN_REQ_FIELDS); set_action (R_BIN_REQ_DWARF); set_action (R_BIN_REQ_ENTRIES); + set_action (R_BIN_REQ_INITFINI); set_action (R_BIN_REQ_MAIN); set_action (R_BIN_REQ_LIBS); set_action (R_BIN_REQ_RELOCS); @@ -664,11 +657,11 @@ case 'u': bin->filter = 0; break; case 'k': query = optarg; break; case 'K': chksum = optarg; break; - case 'c': + case 'c': if (is_active (R_BIN_REQ_CLASSES)) { rad = R_CORE_BIN_CLASSDUMP; } else { - set_action (R_BIN_REQ_CLASSES); + set_action (R_BIN_REQ_CLASSES); } break; case 'f': arch_name = strdup (optarg); break; @@ -680,7 +673,14 @@ break; case 'i': set_action (R_BIN_REQ_IMPORTS); break; case 's': set_action (R_BIN_REQ_SYMBOLS); break; - case 'S': set_action (R_BIN_REQ_SECTIONS); break; + case 'S': + if (is_active (R_BIN_REQ_SECTIONS)) { + action &= ~R_BIN_REQ_SECTIONS; + action |= R_BIN_REQ_SEGMENTS; + } else { + set_action (R_BIN_REQ_SECTIONS); + } + break; case 'z': if (is_active (R_BIN_REQ_STRINGS)) { if (rawstr) { @@ -738,15 +738,15 @@ op = optarg; set_action (R_BIN_REQ_OPERATION); if (isBinopHelp (op)) { - printf ("Operation string:\n" - " Change Entrypoint: e/0x8048000\n" - " Dump Symbols: d/s/1024\n" - " Dump Section: d/S/.text\n" - " Resize Section: r/.data/1024\n" - " Remove RPATH: R\n" - " Add Library: a/l/libfoo.dylib\n" - " Change Permissions: p/.data/rwx\n" - " Show LDID entitlements: C\n"); + printf ("Usage: iO [expression]:\n" + " e/0x8048000 change entrypoint\n" + " d/s/1024 dump symbols\n" + " d/S/.text dump section\n" + " r/.data/1024 resize section\n" + " R remove RPATH\n" + " a/l/libfoo.dylib add library\n" + " p/.data/rwx change section permissions\n" + " C show LDID entitlements\n"); r_core_fini (&core); return 0; } @@ -922,6 +922,15 @@ } if (file && *file && action & R_BIN_REQ_DLOPEN) { +#if __UNIX__ + int child = r_sys_fork (); + if (child == -1) { + return 1; + } + if (child == 0) { + return waitpid (child, NULL, 0); + } +#endif void *addr = r_lib_dl_open (file); if (addr) { eprintf ("%s is loaded at 0x%"PFMT64x"\n", file, (ut64)(size_t)(addr)); @@ -929,7 +938,7 @@ return 0; } eprintf ("Cannot open the '%s' library\n", file); - return 1; + return 0; } if (action & R_BIN_REQ_PACKAGE) { RList *files = r_list_newf (NULL); @@ -975,11 +984,24 @@ r_bin_force_plugin (bin, forcebin); r_bin_load_filter (bin, action); - if (!r_bin_load (bin, file, baddr, laddr, xtr_idx, fd, rawstr)) { + + RBinOptions *bo = r_bin_options_new (0LL, baddr, rawstr); + if (!bo) { + eprintf ("Could not create RBinOptions\n"); + r_core_fini (&core); + return 1; + } + + bo->loadaddr = laddr; + bo->xtr_idx = xtr_idx; + bo->iofd = fd; + + if (!r_bin_open (bin, file, bo)) { //if this return null means that we did not return a valid bin object //but we have yet the chance that this file is a fat binary if (!bin->cur || !bin->cur->xtr_data) { eprintf ("r_bin: Cannot open file\n"); + r_bin_options_free (bo); r_core_fini (&core); return 1; } @@ -995,7 +1017,7 @@ RBinFile *bf = r_core_bin_cur (&core); if (bf) { bf->strmode = rad; - r_bin_dump_strings (bf, bin->minstrlen); + r_bin_dump_strings (bf, bin->minstrlen, bf->rawstr); } } if (query) { @@ -1009,6 +1031,7 @@ sdb_query (bin->cur->sdb, query); } } + r_bin_options_free (bo); r_core_fini (&core); return 0; } @@ -1047,7 +1070,14 @@ pdbopts.user_agent = (char*) r_config_get (core.config, "pdb.useragent"); pdbopts.symbol_server = (char*) r_config_get (core.config, "pdb.server"); pdbopts.extract = r_config_get_i (core.config, "pdb.extract"); + + if ((tmp = r_sys_getenv ("RABIN2_SYMSTORE"))) { + r_config_set (core.config, "pdb.symstore", tmp); + R_FREE (tmp); + } + pdbopts.symbol_store_path = (char*) r_config_get (core.config, "pdb.symstore"); int r = r_bin_pdb_download (&core, isradjson, &actions_done, &pdbopts); + r_bin_options_free (bo); r_core_fini (&core); return r; } @@ -1058,8 +1088,9 @@ } run_action ("sections", R_BIN_REQ_SECTIONS, R_CORE_BIN_ACC_SECTIONS); + run_action ("segments", R_BIN_REQ_SEGMENTS, R_CORE_BIN_ACC_SEGMENTS); run_action ("entries", R_BIN_REQ_ENTRIES, R_CORE_BIN_ACC_ENTRIES); - run_action ("entries", R_BIN_REQ_INITFINI, R_CORE_BIN_ACC_INITFINI); + run_action ("initfini", R_BIN_REQ_INITFINI, R_CORE_BIN_ACC_INITFINI); run_action ("main", R_BIN_REQ_MAIN, R_CORE_BIN_ACC_MAIN); run_action ("imports", R_BIN_REQ_IMPORTS, R_CORE_BIN_ACC_IMPORTS); run_action ("classes", R_BIN_REQ_CLASSES, R_CORE_BIN_ACC_CLASSES); @@ -1094,9 +1125,10 @@ rabin_do_operation (op); } if (isradjson) { - printf ("}"); + r_cons_print ("}"); } r_cons_flush (); + r_bin_options_free (bo); r_core_fini (&core); free (stdin_buf); diff -Nru radare2-2.3.0+dfsg/binr/radare2/Makefile radare2-2.8.0+dfsg/binr/radare2/Makefile --- radare2-2.3.0+dfsg/binr/radare2/Makefile 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/binr/radare2/Makefile 2018-08-07 14:12:36.000000000 +0000 @@ -73,6 +73,7 @@ endif include ../../libr/socket/deps.mk +include ../../libr/magic/deps.mk include ../../shlr/zip/deps.mk include ../../shlr/gdb/deps.mk include ../../shlr/java/deps.mk diff -Nru radare2-2.3.0+dfsg/binr/radare2/meson.build radare2-2.8.0+dfsg/binr/radare2/meson.build --- radare2-2.3.0+dfsg/binr/radare2/meson.build 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/binr/radare2/meson.build 2018-08-07 14:12:36.000000000 +0000 @@ -1,5 +1,28 @@ executable('radare2', 'radare2.c', include_directories: [platform_inc], - link_with: [r_util, r_socket, r_core, r_io, r_magic, r_fs, r_bin, r_flag, r_cons, r_asm, r_debug, r_config, r_bp, r_reg, r_syscall, r_anal, r_parse, r_egg, r_search, r_hash, r_crypto,], - install: true -) \ No newline at end of file + dependencies: [ + r_util_dep, + r_socket_dep, + r_core_dep, + r_io_dep, + r_fs_dep, + r_bin_dep, + r_flag_dep, + r_cons_dep, + r_asm_dep, + r_debug_dep, + r_config_dep, + r_bp_dep, + r_reg_dep, + r_syscall_dep, + r_anal_dep, + r_parse_dep, + r_egg_dep, + r_search_dep, + r_hash_dep, + r_crypto_dep, + r_magic_dep + ], + install: true, + implicit_include_directories: false +) diff -Nru radare2-2.3.0+dfsg/binr/radare2/radare2.c radare2-2.8.0+dfsg/binr/radare2/radare2.c --- radare2-2.3.0+dfsg/binr/radare2/radare2.c 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/binr/radare2/radare2.c 2018-08-07 14:12:36.000000000 +0000 @@ -8,15 +8,15 @@ #endif #endif #include -#include +#include #include #include #include +#include #include "../blob/version.c" #if USE_THREADS -#include static char *rabin_cmd = NULL; #endif static bool threaded = false; @@ -38,6 +38,32 @@ return NULL; } +static RThread *thread = NULL; + +static int loading_thread(RThread *th) { + const char *tok = "\\|/-"; + int i = 0; + if (th) { + while (!th->breaked) { + eprintf ("%c] Loading..%c \r[", tok[i%4], "."[i%2]); + r_sys_usleep (100000); + i++; + } + } + return 0; +} + +static void loading_start() { + thread = r_th_new (loading_thread, NULL, 1); + r_th_start (thread, true); +} + +static void loading_stop() { + r_th_kill (thread, true); + r_th_free (thread); + thread = NULL; +} + static int verify_version(int show) { int i, ret; typedef const char* (*vc)(); @@ -60,7 +86,9 @@ { "r_hash", &r_hash_version }, { "r_fs", &r_fs_version }, { "r_io", &r_io_version }, +#if !USE_LIB_MAGIC { "r_magic", &r_magic_version }, +#endif { "r_parse", &r_parse_version }, { "r_reg", &r_reg_version }, { "r_sign", &r_sign_version }, @@ -97,7 +125,7 @@ static int main_help(int line) { if (line < 2) { printf ("Usage: r2 [-ACdfLMnNqStuvwzX] [-P patch] [-p prj] [-a arch] [-b bits] [-i file]\n" - " [-s addr] [-B baddr] [-M maddr] [-c cmd] [-e k=v] file|pid|-|--|=\n"); + " [-s addr] [-B baddr] [-m maddr] [-c cmd] [-e k=v] file|pid|-|--|=\n"); } if (line != 1) { printf ( @@ -148,22 +176,22 @@ " -z, -zz do not load strings or load them even in raw\n"); } if (line == 2) { - char *homedir = r_str_home (R2_HOMEDIR); + char *datahome = r_str_home (R2_HOME_DATADIR); + const char *dirPrefix = r_sys_prefix (NULL); printf ( "Scripts:\n" " system ${R2_PREFIX}/share/radare2/radare2rc\n" - " user ~/.radare2rc ${RHOMEDIR}/radare2/radare2rc (and radare2rc.d/)\n" + " user ~/.radare2rc " R_JOIN_2_PATHS ("~", R2_HOME_RC) " (and " R_JOIN_3_PATHS ("~", R2_HOME_RC_DIR,"") ")\n" " file ${filename}.r2\n" "Plugins:\n" - " binrc ~/.config/radare2/rc.d/bin-/ (elf, elf64, mach0, ..)\n" - " plugins "R2_PREFIX"/lib/radare2/last\n" - " USER_PLUGINS ~/.config/radare2/plugins\n" - " LIBR_PLUGINS "R2_PREFIX"/lib/radare2/"R2_VERSION"\n" - " USER_ZIGNS ~/.config/radare2/zigns\n" + " binrc " R_JOIN_4_PATHS ("~", R2_HOME_BINRC, "bin-", "") " (elf, elf64, mach0, ..)\n" + " USER_PLUGINS " R_JOIN_2_PATHS ("~", R2_HOME_PLUGINS) "\n" + " LIBR_PLUGINS " R_JOIN_2_PATHS ("%s", R2_PLUGINS) "\n" + " USER_ZIGNS " R_JOIN_2_PATHS ("~", R2_HOME_ZIGNS) "\n" "Environment:\n" - " RHOMEDIR %s\n" // TODO: rename to RHOME R2HOME? + " RDATAHOME %s\n" // TODO: rename to RHOME R2HOME? " RCFILE ~/.radare2rc (user preferences, batch script)\n" // TOO GENERIC - " MAGICPATH "R_MAGIC_PATH"\n" + " MAGICPATH " R_JOIN_2_PATHS ("%s", R2_SDB_MAGIC) "\n" " R_DEBUG if defined, show error messages and crash signal\n" " VAPIDIR path to extra vapi directory\n" " R2_NOPLUGINS do not load r2 shared plugins\n" @@ -172,30 +200,36 @@ " R2_INCDIR "R2_INCDIR"\n" " R2_LIBDIR "R2_LIBDIR"\n" " R2_LIBEXT "R_LIB_EXT"\n" - , homedir); - free (homedir); + , dirPrefix, datahome, dirPrefix); + free (datahome); } return 0; } static int main_print_var(const char *var_name) { int i = 0; - char *homedir = r_str_home (R2_HOMEDIR); - char *homeplugs = r_str_newf ("%s" R_SYS_DIR "plugins", homedir); - char *homezigns = r_str_newf ("%s" R_SYS_DIR "zigns", homedir); + char *confighome = r_str_home (R2_HOME_CONFIGDIR); + char *datahome = r_str_home (R2_HOME_DATADIR); + char *cachehome = r_str_home (R2_HOME_CACHEDIR); + char *homeplugins = r_str_home (R2_HOME_PLUGINS); + char *homezigns = r_str_home (R2_HOME_ZIGNS); + char *plugins = r_str_r2_prefix (R2_PLUGINS); + char *magicpath = r_str_r2_prefix (R2_SDB_MAGIC); struct radare2_var_t { const char *name; const char *value; } r2_vars[] = { { "R2_PREFIX", R2_PREFIX }, - { "MAGICPATH", R_MAGIC_PATH }, + { "MAGICPATH", magicpath }, { "PREFIX", R2_PREFIX }, { "INCDIR", R2_INCDIR }, { "LIBDIR", R2_LIBDIR }, { "LIBEXT", R_LIB_EXT }, - { "RHOMEDIR", homedir }, - { "LIBR_PLUGINS", R2_PREFIX"/lib/radare2/"R2_VERSION }, - { "USER_PLUGINS", homeplugs }, + { "RCONFIGHOME", confighome }, + { "RDATAHOME", datahome }, + { "RCACHEHOME", cachehome }, + { "LIBR_PLUGINS", plugins }, + { "USER_PLUGINS", homeplugins }, { "USER_ZIGNS", homezigns }, { NULL, NULL } }; @@ -213,9 +247,13 @@ i++; } } - free (homedir); - free (homeplugs); + free (confighome); + free (datahome); + free (cachehome); + free (homeplugins); free (homezigns); + free (plugins); + free (magicpath); return 0; } @@ -271,7 +309,7 @@ r_core_cmd_file (r, homerc); } free (homerc); - homerc = r_str_home (".config/radare2/radare2rc"); + homerc = r_str_home (R2_HOME_RC); if (homerc && r_file_is_regular (homerc)) { if (has_debug) { eprintf ("USER CONFIG loaded from %s\n", homerc); @@ -279,7 +317,7 @@ r_core_cmd_file (r, homerc); } free (homerc); - homerc = r_str_home (".config/radare2/radare2rc.d"); + homerc = r_str_home (R2_HOME_RC_DIR); if (homerc) { if (r_file_is_directory (homerc)) { char *file; @@ -325,7 +363,8 @@ } /* -c */ r_list_foreach (cmds, iter, cmdn) { - r_core_cmd0 (&r, cmdn); + //r_core_cmd0 (&r, cmdn); + r_core_cmd (&r, cmdn, false); r_cons_flush (); } if (quiet) { @@ -445,7 +484,6 @@ r_list_free (prefiles); \ } - int va = 1; // set va = 0 to load physical offsets from rbin bool noStderr = false; r_sys_set_environ (envp); @@ -459,6 +497,7 @@ return main_help (1); } r_core_init (&r); + r_core_task_sync_begin (&r); if (argc == 2 && !strcmp (argv[1], "-p")) { r_core_project_list (&r, 0); r_cons_flush (); @@ -466,7 +505,7 @@ return 0; } // HACK TO PERMIT '#!/usr/bin/r2 - -i' hashbangs - if (argc > 1 && !strcmp (argv[1], "-")) { + if (argc > 2 && !strcmp (argv[1], "-") && !strcmp (argv[2], "-i")) { argv[1] = argv[0]; prefile = 1; argc--; @@ -496,11 +535,10 @@ break; case '0': zerosep = true; - //r_config_set (r.config, "scr.color", "false"); /* implicit -q */ r_config_set (r.config, "scr.interactive", "false"); r_config_set (r.config, "scr.prompt", "false"); - r_config_set (r.config, "scr.color", "false"); + r_config_set_i (r.config, "scr.color", COLOR_MODE_DISABLED); quiet = true; break; case 'u': @@ -515,10 +553,11 @@ case 'A': do_analysis += do_analysis ? 1: 2; break; - case 'b': asmbits = optarg; break; + case 'b': + asmbits = optarg; + break; case 'B': baddr = r_num_math (r.num, optarg); - va = 2; break; case 'X': r_config_set (r.config, "bin.usextr", "false"); @@ -666,11 +705,7 @@ eprintf ("Failed to close stderr"); return 1; } -#if __WINDOWS__ && !__CYGWIN__ - const char nul[] = "nul"; -#else - const char nul[] = "/dev/null"; -#endif + const char nul[] = R_SYS_DEVNULL; int new_stderr = open (nul, O_RDWR); if (-1 == new_stderr) { eprintf ("Failed to open %s", nul); @@ -779,12 +814,15 @@ ret = run_commands (NULL, prefiles, false); r_list_free (prefiles); +#if 0 + // if "- -i" is used we will open malloc:// instead // HACK TO PERMIT '#!/usr/bin/r2 - -i' hashbangs if (prefile) { optind = 1; argc = 2; argv[1] = "-"; } +#endif r_bin_force_plugin (r.bin, forcebin); //cverify_version (0); @@ -870,6 +908,9 @@ return 1; } } else if (strcmp (argv[optind - 1], "--") && !(r_config_get (r.config, "prj.name") && r_config_get (r.config, "prj.name")[0]) ) { + if (threaded) { + loading_start (); + } if (debug) { if (asmbits) { r_config_set (r.config, "asm.bits", asmbits); @@ -1070,6 +1111,15 @@ } } } + if (mapaddr) { + eprintf ("WARNING: using oba to load the syminfo from different mapaddress.\n"); + eprintf ("TODO: Must use the API instead of running commands to speedup loading times.\n"); + if (r_config_get_i (r.config, "file.info")) { + // load symbols when using r2 -m 0x1000 /bin/ls + r_core_cmdf (&r, "oba 0x%"PFMT64x, mapaddr); + r_core_cmd0 (&r, ".ies*"); + } + } } else { RCoreFile *f = r_core_file_open (&r, pfile, perms, mapaddr); if (f) { @@ -1083,7 +1133,6 @@ baddr = r_debug_get_baddr (r.dbg, pfile); if (baddr != UT64_MAX && baddr != 0) { eprintf ("bin.baddr 0x%08" PFMT64x "\n", baddr); - va = 2; } if (run_anal > 0) { if (baddr && baddr != UT64_MAX) { @@ -1197,10 +1246,10 @@ } nsha1 = r_config_get (r.config, "file.sha1"); npath = r_config_get (r.config, "file.path"); - if (!quiet && sha1 && *sha1 && strcmp (sha1, nsha1)) { + if (!quiet && sha1 && *sha1 && nsha1 && strcmp (sha1, nsha1)) { eprintf ("WARNING: file.sha1 change: %s => %s\n", sha1, nsha1); } - if (!quiet && path && *path && strcmp (path, npath)) { + if (!quiet && path && *path && npath && strcmp (path, npath)) { eprintf ("WARNING: file.path change: %s => %s\n", path, npath); } free (sha1); @@ -1256,7 +1305,7 @@ #if UNCOLORIZE_NONTTY #if __UNIX__ if (!r_cons_isatty ()) { - r_config_set_i (r.config, "scr.color", 0); + r_config_set_i (r.config, "scr.color", COLOR_MODE_DISABLED); } #endif #endif @@ -1314,6 +1363,7 @@ r_core_cmd0 (&r, "aeip"); } } + loading_stop (); for (;;) { #if USE_THREADS do { @@ -1352,13 +1402,13 @@ if (debug) { if (no_question_debug) { if (r_config_get_i (r.config, "dbg.exitkills") && y_kill_debug){ - r_debug_kill (r.dbg, 0, false, 9); // KILL + r_debug_kill (r.dbg, r.dbg->pid, r.dbg->tid, 9); // KILL } } else { if (r_cons_yesno ('y', "Do you want to quit? (Y/n)")) { if (r_config_get_i (r.config, "dbg.exitkills") && r_cons_yesno ('y', "Do you want to kill the process? (Y/n)")) { - r_debug_kill (r.dbg, 0, false, 9); // KILL + r_debug_kill (r.dbg, r.dbg->pid, r.dbg->tid, 9); // KILL } else { r_debug_detach (r.dbg, r.dbg->pid); } @@ -1389,8 +1439,8 @@ } } - if (mustSaveHistory(r.config)) { - r_line_hist_save (R2_HOMEDIR"/history"); + if (mustSaveHistory (r.config)) { + r_line_hist_save (R2_HOME_HISTORY); } // TODO: kill thread @@ -1401,9 +1451,12 @@ exit (ret); return ret; } + + r_core_task_sync_end (&r); + // not really needed, cause r_core_fini will close the file // and this fh may be come stale during the command - // exectution. + // execution. //r_core_file_close (&r, fh); r_core_fini (&r); r_cons_set_raw (0); diff -Nru radare2-2.3.0+dfsg/binr/radare2/radare2.xml radare2-2.8.0+dfsg/binr/radare2/radare2.xml --- radare2-2.3.0+dfsg/binr/radare2/radare2.xml 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/binr/radare2/radare2.xml 2018-08-07 14:12:36.000000000 +0000 @@ -4,6 +4,12 @@ com.apple.springboard.debugapplications + platform-application + + + com.apple.private.skip-library-validation + + app-identifier diff -Nru radare2-2.3.0+dfsg/binr/radiff2/meson.build radare2-2.8.0+dfsg/binr/radiff2/meson.build --- radare2-2.3.0+dfsg/binr/radiff2/meson.build 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/binr/radiff2/meson.build 2018-08-07 14:12:36.000000000 +0000 @@ -1,5 +1,17 @@ executable('radiff2', 'radiff2.c', include_directories: [platform_inc], - link_with: [r_util, r_io, r_search, r_cons, r_core, r_bin, r_anal, r_asm, r_hash, r_config], - install: true + dependencies: [ + r_util_dep, + r_io_dep, + r_search_dep, + r_cons_dep, + r_core_dep, + r_bin_dep, + r_anal_dep, + r_asm_dep, + r_hash_dep, + r_config_dep + ], + install: true, + implicit_include_directories: false ) diff -Nru radare2-2.3.0+dfsg/binr/radiff2/radiff2.c radare2-2.8.0+dfsg/binr/radiff2/radiff2.c --- radare2-2.3.0+dfsg/binr/radiff2/radiff2.c 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/binr/radiff2/radiff2.c 2018-08-07 14:12:36.000000000 +0000 @@ -1,4 +1,4 @@ -/* radare - LGPL - Copyright 2009-2017 - pancake */ +/* radare - LGPL - Copyright 2009-2018 - pancake */ #include #include @@ -113,16 +113,14 @@ if (!quiet) { printf (Color_RED); } - if (r_mem_is_printable ((const ut8 *) s, R_MIN (strlen (s), 5))) { - printf ("- %s\n", s); - } else { - printf ("-:"); - int len = op->a_len; // R_MIN (op->a_len, strlen (op->a_buf)); - for (i = 0; i < len; i++) { - printf ("%02x", op->a_buf[i]); - } - printf (" \"%s\"\n", op->a_buf); - } + printf ("-0x%08"PFMT64x":", op->a_off); + int len = op->a_len; // R_MIN (op->a_len, strlen (op->a_buf)); + for (i = 0; i < len; i++) { + printf ("%02x", op->a_buf[i]); + } + char *p = r_str_escape ((const char*)op->a_buf); + printf (" \"%s\"\n", p); + free (p); if (!quiet) { printf (Color_RESET); } @@ -134,17 +132,17 @@ if (!quiet) { printf (Color_GREEN); } - if (r_mem_is_printable ((const ut8 *) s, R_MIN (strlen (s), 5))) { - printf ("+ %s\n", s); - } else { - printf ("+:"); - for (i = 0; i < op->b_len; i++) { - printf ("%02x", op->b_buf[i]); - } - printf (" \"%s\"\n", op->b_buf); + printf ("+0x%08"PFMT64x":", op->b_off); + for (i = 0; i < op->b_len; i++) { + printf ("%02x", op->b_buf[i]); } if (!quiet) { + char *p = r_str_escape((const char*)op->b_buf); + printf (" \"%s\"\n", p); + free (p); printf (Color_RESET); + } else { + printf ("\n"); } } } @@ -287,7 +285,7 @@ unsigned char UCLen = 0; unsigned short USLen = 0; int ILen = 0; - + // we copy from gdiff_start to a_off if (offset_diff > 0) { @@ -334,7 +332,7 @@ } else { print_bytes (&gdiff_start, sizeof (gdiff_start), true); } - + // print length for COPY switch (opcode) { case 249: @@ -352,7 +350,7 @@ break; } } - + // we append data if (op->b_len <= 246) { ut8 data = op->b_len; @@ -431,6 +429,10 @@ ut32 sz = R_MIN (as, bs); ut32 i, j; int ctx = DUMP_CONTEXT; + int pad = 0; + if (!a || !b || as < 0 || bs < 0) { + return; + } switch (w) { case 8: r_cons_printf (" offset 0 1 2 3 4 5 6 7 01234567 0 1 2 3 4 5 6 7 01234567\n"); @@ -445,6 +447,10 @@ return; } for (i = 0; i < sz; i += w) { + if (i + w >= sz) { + pad = w - sz + i; + w = sz - i; + } bool eq = !memcmp (a + i, b + i, w); if (eq) { ctx--; @@ -472,6 +478,9 @@ r_cons_printf (Color_RESET); } } + for (j = 0; j < pad; j++) { + r_cons_printf (" "); + } r_cons_printf (" "); for (j = 0; j < w; j++) { bool eq2 = a[i + j] == b[i + j]; @@ -483,6 +492,9 @@ r_cons_printf (Color_RESET); } } + for (j = 0; j < pad; j++) { + r_cons_printf (" "); + } r_cons_printf (" "); for (j = 0; j < w; j++) { bool eq2 = a[i + j] == b[i + j]; @@ -494,6 +506,9 @@ r_cons_printf (Color_RESET); } } + for (j = 0; j < pad; j++) { + r_cons_printf (" "); + } r_cons_printf (" "); for (j = 0; j < w; j++) { bool eq2 = a[i + j] == b[i + j]; @@ -661,7 +676,7 @@ const char *addr = NULL; RCore *c = NULL, *c2 = NULL; RDiff *d; - ut8 *bufa, *bufb; + ut8 *bufa = NULL, *bufb = NULL; int o, sza, szb, /*diffmode = 0,*/ delta = 0; int mode = MODE_DIFF; int diffops = 0; @@ -793,7 +808,9 @@ if (!c || !c2) { eprintf ("Cannot open '%s'\n", r_str_get (file2)); return 1; - } + } + c->c2 = c2; + c2->c2 = c; if (arch) { r_config_set (c->config, "asm.arch", arch); r_config_set (c2->config, "asm.arch", arch); @@ -816,8 +833,8 @@ addr = "main"; } /* should be in mode not in bool pdc */ - r_config_set (c->config, "scr.color", "false"); - r_config_set (c2->config, "scr.color", "false"); + r_config_set_i (c->config, "scr.color", COLOR_MODE_DISABLED); + r_config_set_i (c2->config, "scr.color", COLOR_MODE_DISABLED); ut64 addra = r_num_math (c->num, addr); bufa = (ut8 *) r_core_cmd_strf (c, "af;pdc @ 0x%08"PFMT64x, addra); @@ -828,22 +845,26 @@ szb = strlen ((const char *) bufb); mode = MODE_DIFF; } else if (mode == MODE_GRAPH) { + int depth = r_config_get_i (c->config, "anal.depth"); + if (depth < 1) { + depth = 64; + } char *words = strdup (addr? addr: "0"); char *second = strstr (words, ","); if (second) { *second++ = 0; ut64 off = r_num_math (c->num, words); // define the same function at each offset - r_core_anal_fcn (c, off, UT64_MAX, R_ANAL_REF_TYPE_NULL, 0); + r_core_anal_fcn (c, off, UT64_MAX, R_ANAL_REF_TYPE_NULL, depth); r_core_anal_fcn (c2, r_num_math (c2->num, second), - UT64_MAX, R_ANAL_REF_TYPE_NULL, 0); + UT64_MAX, R_ANAL_REF_TYPE_NULL, depth); r_core_gdiff (c, c2); r_core_anal_graph (c, off, R_CORE_ANAL_GRAPHBODY | R_CORE_ANAL_GRAPHDIFF); } else { r_core_anal_fcn (c, r_num_math (c->num, words), - UT64_MAX, R_ANAL_REF_TYPE_NULL, 0); + UT64_MAX, R_ANAL_REF_TYPE_NULL, depth); r_core_anal_fcn (c2, r_num_math (c2->num, words), - UT64_MAX, R_ANAL_REF_TYPE_NULL, 0); + UT64_MAX, R_ANAL_REF_TYPE_NULL, depth); r_core_gdiff (c, c2); r_core_anal_graph (c, r_num_math (c->num, addr), R_CORE_ANAL_GRAPHBODY | R_CORE_ANAL_GRAPHDIFF); @@ -912,7 +933,9 @@ write (1, "\x04", 1); } if (diffmode == 'U') { - r_diff_buffers_unified (d, bufa, sza, bufb, szb); + char * res = r_diff_buffers_unified (d, bufa, sza, bufb, szb); + printf ("%s", res); + free (res); } else if (diffmode == 'B') { r_diff_set_callback (d, &bcb, 0); r_diff_buffers (d, bufa, sza, bufb, szb); diff -Nru radare2-2.3.0+dfsg/binr/rafind2/meson.build radare2-2.8.0+dfsg/binr/rafind2/meson.build --- radare2-2.3.0+dfsg/binr/rafind2/meson.build 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/binr/rafind2/meson.build 2018-08-07 14:12:36.000000000 +0000 @@ -1,5 +1,11 @@ executable('rafind2', 'rafind2.c', include_directories: [platform_inc], - link_with: [r_util, r_search, r_io, r_cons], - install: true + dependencies: [ + r_util_dep, + r_search_dep, + r_io_dep, + r_cons_dep + ], + install: true, + implicit_include_directories: false ) diff -Nru radare2-2.3.0+dfsg/binr/rafind2/rafind2.c radare2-2.8.0+dfsg/binr/rafind2/rafind2.c --- radare2-2.3.0+dfsg/binr/rafind2/rafind2.c 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/binr/rafind2/rafind2.c 2018-08-07 14:12:36.000000000 +0000 @@ -22,6 +22,7 @@ static char *mask = NULL; static int nonstop = 0; static bool identify = false; +static bool quiet = false; static int mode = R_SEARCH_STRING; static ut64 cur = 0; static ut8 *buf = NULL; @@ -34,6 +35,10 @@ static int hit(RSearchKeyword *kw, void *user, ut64 addr) { int delta = addr - cur; + if (cur > addr && (cur - addr == kw->keyword_length - 1)) { + // This case occurs when there is hit in search left over + delta = cur - addr; + } if (delta < 0 || delta >= bsize) { eprintf ("Invalid delta\n"); return 0; @@ -77,7 +82,7 @@ } static int show_help(char *argv0, int line) { - printf ("Usage: %s [-mXnzZhv] [-a align] [-b sz] [-f/t from/to] [-[e|s|S] str] [-x hex] file ..\n", argv0); + printf ("Usage: %s [-mXnzZhqv] [-a align] [-b sz] [-f/t from/to] [-[e|s|S] str] [-x hex] file|dir ..\n", argv0); if (line) return 0; printf ( " -a [align] only accept aligned hits\n" @@ -93,6 +98,7 @@ " -s [str] search for a specific string (can be used multiple times)\n" " -S [str] search for a specific wide string (can be used multiple times)\n" " -t [to] stop search at address 'to'\n" + " -q quiet - do not show headings (filenames) above matching contents (default for searching a single file)\n" " -v print version and exit\n" " -x [hex] search for hexpair string (909090) (can be used multiple times)\n" " -X show hexdump of search results\n" @@ -102,12 +108,18 @@ return 0; } -static int rafind_open(char *file) { +static int rafind_open(char *file); + +static int rafind_open_file(char *file) { const char *kw; RListIter *iter; bool last = false; int ret; + if (!quiet) { + printf ("File: %s\n", file); + } + if (identify) { char *cmd = r_str_newf ("r2 -e search.show=false -e search.maxhits=1 -nqcpm '%s'", file); r_sandbox_system (cmd, 1); @@ -154,6 +166,15 @@ free (tostr); return 0; } + if (mode == R_SEARCH_ESIL) { + char *cmd; + r_list_foreach (keywords, iter, kw) { + cmd = r_str_newf ("r2 -qc \"/E %s\" %s", kw, file); + r_sandbox_system (cmd, 1); + free (cmd); + } + return 0; + } if (mode == R_SEARCH_KEYWORD) { r_list_foreach (keywords, iter, kw) { if (hexstr) { @@ -199,11 +220,44 @@ return 0; } +static int rafind_open_dir(char *dir) { + RList *files; + RListIter *iter; + char *fullpath; + char *fname = NULL; + + files = r_sys_dir (dir); + + if (files) { + r_list_foreach (files, iter, fname) { + /* Filter-out unwanted entries */ + if (*fname == '.') { + continue; + } + + fullpath = r_str_newf ("%s"R_SYS_DIR"%s", dir, fname); + rafind_open (fullpath); + free (fullpath); + } + r_list_free (files); + } + + return 0; +} + +static int rafind_open(char *file) { + if (r_file_is_directory (file)) { + return rafind_open_dir (file); + } + + return rafind_open_file (file); +} + int main(int argc, char **argv) { int c; keywords = r_list_new (); - while ((c = getopt (argc, argv, "a:ie:b:mM:s:S:x:Xzf:t:rnhvZ")) != -1) { + while ((c = getopt (argc, argv, "a:ie:b:mM:s:S:x:Xzf:t:E:rqnhvZ")) != -1) { switch (c) { case 'a': align = r_num_math (NULL, optarg); @@ -225,6 +279,10 @@ hexstr = 0; r_list_append (keywords, optarg); break; + case 'E': + mode = R_SEARCH_ESIL; + r_list_append (keywords, optarg); + break; case 's': mode = R_SEARCH_KEYWORD; hexstr = 0; @@ -259,6 +317,9 @@ case 'X': pr = r_print_new (); break; + case 'q': + quiet = true; + break; case 'v': printf ("rafind2 v"R2_VERSION"\n"); return 0; @@ -277,6 +338,10 @@ if (optind == argc) { return show_help (argv[0], 1); } + /* Enable quiet mode if searching just a single file */ + if (optind + 1 == argc && !r_file_is_directory (argv[optind])) { + quiet = true; + } for (; optind < argc; optind++) { rafind_open (argv[optind]); } diff -Nru radare2-2.3.0+dfsg/binr/ragg2/meson.build radare2-2.8.0+dfsg/binr/ragg2/meson.build --- radare2-2.3.0+dfsg/binr/ragg2/meson.build 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/binr/ragg2/meson.build 2018-08-07 14:12:36.000000000 +0000 @@ -1,6 +1,17 @@ - executable('ragg2', 'ragg2.c', include_directories: [platform_inc], - link_with: [r_util, r_egg, r_bin, r_core, r_hash, r_debug, r_fs, r_config, r_bp, r_crypto], - install: true + dependencies: [ + r_util_dep, + r_egg_dep, + r_bin_dep, + r_core_dep, + r_hash_dep, + r_debug_dep, + r_fs_dep, + r_config_dep, + r_bp_dep, + r_crypto_dep + ], + install: true, + implicit_include_directories: false ) diff -Nru radare2-2.3.0+dfsg/binr/ragg2/ragg2.c radare2-2.8.0+dfsg/binr/ragg2/ragg2.c --- radare2-2.3.0+dfsg/binr/ragg2/ragg2.c 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/binr/ragg2/ragg2.c 2018-08-07 14:12:36.000000000 +0000 @@ -11,7 +11,7 @@ #include -static int usage (int v) { +static int usage(int v) { printf ("Usage: ragg2 [-FOLsrxhvz] [-a arch] [-b bits] [-k os] [-o file] [-I path]\n" " [-i sc] [-e enc] [-B hex] [-c k=v] [-C file] [-p pad] [-q off]\n" " [-q off] [-dDw off:hex] file|f.asm|-\n"); @@ -50,7 +50,8 @@ return 1; } -static void list (REgg *egg) { + +static void list(REgg *egg) { RListIter *iter; REggPlugin *p; printf ("shellcodes:\n"); @@ -67,7 +68,7 @@ } } -static int create (const char *format, const char *arch, int bits, const ut8 *code, int codelen) { +static int create(const char *format, const char *arch, int bits, const ut8 *code, int codelen) { RBin *bin = r_bin_new (); RBuffer *b; if (!r_bin_use_arch (bin, arch, bits, format)) { @@ -86,7 +87,7 @@ return 0; } -static int openfile (const char *f, int x) { +static int openfile(const char *f, int x) { int fd = open (f, O_RDWR | O_CREAT, 0644); if (fd == -1) { fd = open (f, O_RDWR); @@ -179,19 +180,19 @@ free (arg); } break; - case 'n': + case 'n': { ut32 n = r_num_math (NULL, optarg); append = 1; r_egg_patch (egg, -1, (const ut8*)&n, 4); } break; - case 'N': + case 'N': { ut64 n = r_num_math (NULL, optarg); r_egg_patch (egg, -1, (const ut8*)&n, 8); append = 1; - } + } break; case 'd': { @@ -315,6 +316,12 @@ // catch this first if (get_offset) { + if (strncmp (sequence, "0x", 2)) { + eprintf ("Need hex value with `0x' prefix e.g. 0x41414142\n"); + free (sequence); + return 1; + } + get_offset = r_num_math (0, sequence); printf ("Little endian: %d\n", r_debruijn_offset (get_offset, false)); printf ("Big endian: %d\n", r_debruijn_offset (get_offset, true)); @@ -334,6 +341,28 @@ } r_egg_load (egg, buf, 0); } + } else if (strstr (file, ".c")) { + char *fileSanitized = strdup (file); + r_str_sanitize (fileSanitized); + char *textFile = r_egg_Cfile_parser (fileSanitized, arch, os, bits); + + if (!textFile) { + eprintf ("Failure while parsing '%s'\n", fileSanitized); + goto fail; + } + + int l; + char *buf = r_file_slurp (textFile, &l); + if (buf && l > 0) { + r_egg_raw (egg, (const ut8*)buf, l); + } else { + eprintf ("Error loading '%s'\n", textFile); + } + + r_file_rm (textFile); + free (fileSanitized); + free (textFile); + free (buf); } else { if (strstr (file, ".s") || strstr (file, ".asm")) { fmt = 'a'; @@ -436,7 +465,7 @@ // add padding if (padding) { - r_egg_padding (egg, padding); + r_egg_padding (egg, padding); } // add pattern @@ -455,7 +484,7 @@ r_egg_finalize (egg); if (show_asm) { - printf ("%s\n", r_egg_get_assembly (egg)); + printf ("%s\n", r_egg_get_assembly (egg)); } if (show_raw || show_hex || show_execute) { diff -Nru radare2-2.3.0+dfsg/binr/ragg2/ragg2-cc radare2-2.8.0+dfsg/binr/ragg2/ragg2-cc --- radare2-2.3.0+dfsg/binr/ragg2/ragg2-cc 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/binr/ragg2/ragg2-cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,320 +0,0 @@ -#!/bin/sh -# ragg2-cc : a shellcode compiler -- pancake - 2011-2016 -# -# Supported operating systems: -# - GNU/Linux -# - OSX -# - BSD -# Supported compilers -# - gcc -# - clang -# TODO -# add support for arm -# add support for nested shellcodes - -# Find which compiler is installed -if [ -z "${CC}" ]; then - for a in llvm-gcc clang gcc ; do - $a --version >/dev/null 2>&1 - if [ $? = 0 ]; then - CC="$a" - break - fi - done - if [ -z "${CC}" ]; then - echo "Cannot find CC" >&2 - exit 1 - fi -fi - -# Get path for sflib -if [ -z "${SFLIBPATH}" ]; then - SFLIBPATH="$(r2 -hh | grep INCDIR | awk '{print $2}')"/sflib -fi -if [ ! -d "${SFLIBPATH}" ]; then - echo "Cannot find ${SFLIBPATH}" - echo "Define SFLIBPATH env var or fix the r2 installation" - exit 1 -fi - -# Get local architecture -case "$(uname -m)" in -arm64|aarch64|x86_64) - B=64 - ;; -*) - B=32 - ;; -esac - -dohelp() { - cat< Compile" - echo "${CC} ${CFLAGS} -o $F.tmp -S ${OPT} $F" -fi -rm -f "$F.bin" -echo ${CC} ${CFLAGS} -o "$F.tmp" -S ${OPT} "$F" -${CC} ${CFLAGS} -o "$F.tmp" -S ${OPT} "$F" || fail -echo "${SHDR}" > $F.s -cat "$F.tmp" \ - | sed -e s,rdata,text, -e s,rodata,text, -e 's,get_pc_thunk.bx,__getesp__,g' \ - | grep -v .cstring | grep -v size | grep -v ___main | grep -v section \ - | grep -v __alloca | grep -v zero | grep -v cfi >> $F.s -rm -f "$F.tmp" -if [ $ASM = 1 ]; then - echo "$F.s" - exit 0 -fi - -echo ============================== - -if [ "$D" ]; then - echo "==> Assemble" - echo "${CC} ${LDFLAGS} ${OPT} -o $F.o $F.s" -fi -echo "${CC} ${LDFLAGS} ${OPT} -o $F.o $F.s" -${CC} ${LDFLAGS} ${OPT} -o "$F.o" "$F.s" || fail 'compile object' - -if [ "$D" ]; then - echo "==> Link" - #echo "${OBJCOPY} -j .text -O binary $F.o $.text" - echo "rabin2 -o '$F.text' -O d/S/${TEXT} $F.o" -fi -rabin2 -o "$F.text" -O d/S/${TEXT} $F.o -if [ ! -f "$F.o" ]; then - echo "Cannot find $F.o" - exit 1 -fi -if [ "`du $F.text|awk '{print $1}'`" = 0 ]; then - # use objcopy as falback for rabin2 - echo "FALLBACK: Using objcopy instead of rabin2" - ${OBJCOPY} -j .text -O binary $F.o $F.text || fail -fi -if [ "$C" = 1 ]; then - if [ "$O" ]; then - mv "$F.text" "$O" - else - O="$F.text" - fi - echo "$O" - exit 0 -fi - -[ "$X" = 1 ] && exec rax2 -S < "$F.text" - -if [ "$D" ]; then -# hexdump -C $F.text - rax2 -S - < $F.text - ls -l $F.text -fi -[ -z "$O" ] && O="$F.bin" -ragg2 -b "$B" -C "$F.text" -f ${FMT} -a $A -o "$O" || fail "ragg2 cannot generate executable. Use -x" -echo "$O" -rmtemps -exit 0 diff -Nru radare2-2.3.0+dfsg/binr/rahash2/meson.build radare2-2.8.0+dfsg/binr/rahash2/meson.build --- radare2-2.3.0+dfsg/binr/rahash2/meson.build 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/binr/rahash2/meson.build 2018-08-07 14:12:36.000000000 +0000 @@ -1,5 +1,12 @@ executable('rahash2', 'rahash2.c', include_directories: [platform_inc], - link_with: [r_util, r_hash, r_io, r_crypto, r_socket], - install: true + dependencies: [ + r_util_dep, + r_hash_dep, + r_io_dep, + r_crypto_dep, + r_socket_dep + ], + install: true, + implicit_include_directories: false ) diff -Nru radare2-2.3.0+dfsg/binr/rahash2/rahash2.c radare2-2.8.0+dfsg/binr/rahash2/rahash2.c --- radare2-2.3.0+dfsg/binr/rahash2/rahash2.c 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/binr/rahash2/rahash2.c 2018-08-07 14:12:36.000000000 +0000 @@ -1,4 +1,4 @@ -/* radare - LGPL - Copyright 2009-2017 - pancake */ +/* radare - LGPL - Copyright 2009-2018 - pancake */ #include #include @@ -96,7 +96,11 @@ printf ("0x%08"PFMT64x "-0x%08"PFMT64x " %s: ", from, to > 0? to - 1: 0, hname); } - do_hash_hexprint (c, dlen, ule, rad); + if (dlen == R_HASH_SIZE_ENTROPY) { + printf("%.8f\n", ctx->entropy); + } else { + do_hash_hexprint (c, dlen, ule, rad); + } break; case 1: printf ("e file.%s=", hname); @@ -124,28 +128,13 @@ return 0; } dlen = r_hash_calculate (ctx, hash, buf, len); - if (!dlen) { - return 0; - } if (!print) { return 1; } - if (hash == R_HASH_ENTROPY) { - double e = r_hash_entropy (buf, len); - if (rad) { - eprintf ("entropy: %10f\n", e); - } else { - printf ("0x%08"PFMT64x "-0x%08"PFMT64x " %10f: ", - from, to > 0? to - 1: 0, e); - r_print_progressbar (NULL, 12.5 * e, 60); - printf ("\n"); - } - } else { - if (iterations > 0) { - r_hash_do_spice (ctx, hash, iterations, _s); - } - do_hash_print (ctx, hash, dlen, rad, le); + if (iterations > 0) { + r_hash_do_spice (ctx, hash, iterations, _s); } + do_hash_print (ctx, hash, dlen, rad, le); return 1; } @@ -313,14 +302,14 @@ bits = 1ULL << i; const char *name = r_hash_name (bits); if (name && *name) { - printf (" %s\n", name); + printf ("h %s\n", name); } } eprintf ("\nAvailable Encoders/Decoders: \n"); // TODO: do not hardcode - printf (" base64\n"); - printf (" base91\n"); - printf (" punycode\n"); + printf ("e base64\n"); + printf ("e base91\n"); + printf ("e punycode\n"); eprintf ("\nAvailable Crypto Algos: \n"); for (i = 0;; i++) { bits = ((ut64) 1) << i; @@ -328,7 +317,7 @@ if (!name || !*name) { break; } - printf (" %s\n", name); + printf ("c %s\n", name); } } @@ -440,6 +429,7 @@ int ivlen = -1; char *ivseed = NULL; const char *compareStr = NULL; + const char *ptype = NULL; ut8 *compareBin = NULL; int hashstr_len = -1; int hashstr_hex = 0; @@ -448,7 +438,7 @@ RHash *ctx; RIO *io; - while ((c = getopt (argc, argv, "jD:rveE:a:i:I:S:s:x:b:nBhf:t:kLqc:")) != -1) { + while ((c = getopt (argc, argv, "p:jD:rveE:a:i:I:S:s:x:b:nBhf:t:kLqc:")) != -1) { switch (c) { case 'q': quiet++; break; case 'i': @@ -468,6 +458,7 @@ case 'e': ule = 1; break; case 'r': rad = 1; break; case 'k': rad = 2; break; + case 'p': ptype = optarg; break; case 'a': algo = optarg; break; case 'B': incremental = 0; break; case 'b': bsize = (int) r_num_math (NULL, optarg); break; @@ -534,6 +525,16 @@ return 1; } } + if (ptype) { + // TODO: support p=%s (horizontal bars) + // TODO: list supported statistical metrics + // TODO: support -f and -t + for (i = optind; i < argc; i++) { + printf ("%s:\n", argv[i]); + r_sys_cmdf ("r2 -qfnc \"p==%s 100\" \"%s\"", ptype, argv[i]); + } + return 0; + } // convert iv to hex or string. if (ivseed) { iv = (ut8 *) malloc (strlen (ivseed) + 128); diff -Nru radare2-2.3.0+dfsg/binr/rarun2/meson.build radare2-2.8.0+dfsg/binr/rarun2/meson.build --- radare2-2.3.0+dfsg/binr/rarun2/meson.build 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/binr/rarun2/meson.build 2018-08-07 14:12:36.000000000 +0000 @@ -1,5 +1,9 @@ executable('rarun2', 'rarun2.c', include_directories: [platform_inc], - link_with: [r_util, r_socket], - install: true + dependencies: [ + r_util_dep, + r_socket_dep + ], + install: true, + implicit_include_directories: false ) diff -Nru radare2-2.3.0+dfsg/binr/rasm2/meson.build radare2-2.8.0+dfsg/binr/rasm2/meson.build --- radare2-2.3.0+dfsg/binr/rasm2/meson.build 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/binr/rasm2/meson.build 2018-08-07 14:12:36.000000000 +0000 @@ -1,9 +1,12 @@ - executable('rasm2', 'rasm2.c', include_directories: [platform_inc], - link_with: [r_util, r_asm, r_anal, r_syscall], - objects: [ - libr2sdb.extract_all_objects(), + dependencies: [ + r_util_dep, + r_asm_dep, + r_anal_dep, + r_syscall_dep, + sdb_dep ], - install: true + install: true, + implicit_include_directories: false ) diff -Nru radare2-2.3.0+dfsg/binr/rasm2/rasm2.c radare2-2.8.0+dfsg/binr/rasm2/rasm2.c --- radare2-2.3.0+dfsg/binr/rasm2/rasm2.c 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/binr/rasm2/rasm2.c 2018-08-07 14:12:36.000000000 +0000 @@ -30,7 +30,7 @@ } for (ret = 0; ret < len;) { aop.size = 0; - if (r_anal_op (anal, &aop, offset, buf + ret, len - ret) > 0) { + if (r_anal_op (anal, &aop, offset, buf + ret, len - ret, R_ANAL_OP_MASK_BASIC) > 0) { //printf ("%s\n", R_STRBUF_SAFEGET (&aop.esil)); } if (aop.size < 1) { @@ -148,7 +148,7 @@ char *bytes, *stackop = NULL; int ret; - ret = r_anal_op (anal, op, offset, buf, len); + ret = r_anal_op (anal, op, offset, buf, len, R_ANAL_OP_MASK_ESIL); if (ret) { stackop = stackop2str (op->stackop); optype = r_anal_optype_to_string (op->type); @@ -273,7 +273,7 @@ RAnalOp aop = { 0 }; while (ret < len) { aop.size = 0; - if (r_anal_op (anal, &aop, offset, data + ret, len - ret) > 0) { + if (r_anal_op (anal, &aop, offset, data + ret, len - ret, R_ANAL_OP_MASK_ESIL) > 0) { printf ("%s\n", R_STRBUF_SAFEGET (&aop.esil)); } if (aop.size < 1) { @@ -446,15 +446,21 @@ r_lib_opendir (l, path); if (1) { - char *homeplugindir = r_str_home (R2_HOMEDIR "/plugins"); + char *homeplugindir = r_str_home (R2_HOME_PLUGINS); // eprintf ("OPENDIR (%s)\n", homeplugindir); r_lib_opendir (l, homeplugindir); free (homeplugindir); } if (1) { //where & R_CORE_LOADLIBS_SYSTEM) { - r_lib_opendir (l, R2_LIBDIR "/radare2/" R2_VERSION); - r_lib_opendir (l, R2_LIBDIR "/radare2-extras/" R2_VERSION); - r_lib_opendir (l, R2_LIBDIR "/radare2-bindings/" R2_VERSION); + char *plugindir = r_str_r2_prefix (R2_PLUGINS); + char *extrasdir = r_str_r2_prefix (R2_EXTRAS); + char *bindingsdir = r_str_r2_prefix (R2_BINDINGS); + r_lib_opendir (l, plugindir); + r_lib_opendir (l, extrasdir); + r_lib_opendir (l, bindingsdir); + free (plugindir); + free (extrasdir); + free (bindingsdir); } free (tmp); } diff -Nru radare2-2.3.0+dfsg/binr/rax2/meson.build radare2-2.8.0+dfsg/binr/rax2/meson.build --- radare2-2.3.0+dfsg/binr/rax2/meson.build 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/binr/rax2/meson.build 2018-08-07 14:12:36.000000000 +0000 @@ -1,6 +1,6 @@ - executable('rax2', 'rax2.c', include_directories: [platform_inc], - link_with: [r_util], - install: true + dependencies: [r_util_dep], + install: true, + implicit_include_directories: false ) diff -Nru radare2-2.3.0+dfsg/binr/rax2/rax2.c radare2-2.8.0+dfsg/binr/rax2/rax2.c --- radare2-2.3.0+dfsg/binr/rax2/rax2.c 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/binr/rax2/rax2.c 2018-08-07 14:12:36.000000000 +0000 @@ -1,7 +1,8 @@ -/* radare - LGPL - Copyright 2007-2017 - pancake */ +/* radare - LGPL - Copyright 2007-2018 - pancake */ #include "../blob/version.c" #include +#include #define STDIN_BUFFER_SIZE 354096 #define R_STATIC_ASSERT(x)\ @@ -32,22 +33,20 @@ case 'I': printf ("%" PFMT64d "\n", n); break; - case '0': { - int len = strlen (s); - if (len > 0 && s[len - 1] == 'f') { - R_STATIC_ASSERT (sizeof (float) == 4) - float f = (float) num->fvalue; - ut8 *p = (ut8 *) &f; - printf ("Fx%02x%02x%02x%02x\n", p[3], p[2], p[1], p[0]); - } else { - printf ("0x%" PFMT64x "\n", n); - } - } break; + case '0': + printf ("0x%" PFMT64x "\n", n); + break; case 'F': { float *f = (float *) &n; printf ("%ff\n", *f); } break; case 'f': printf ("%.01lf\n", num->fvalue); break; + case 'l': + R_STATIC_ASSERT (sizeof (float) == 4); + float f = (float) num->fvalue; + ut8 *p = (ut8 *) &f; + printf ("Fx%02x%02x%02x%02x\n", p[3], p[2], p[1], p[0]); + break; case 'O': printf ("0%" PFMT64o "\n", n); break; case 'B': if (n) { @@ -72,6 +71,10 @@ return true; } +static void print_ascii_table() { + printf("%s", ret_ascii_table()); +} + static int help() { printf ( " =[base] ; rax2 =10 0x46 -> output in base 10\n" @@ -94,6 +97,7 @@ " raw -> hex ; rax2 -S < /binfile\n" " hex -> raw ; rax2 -s 414141\n" " -l ; append newline to output (for -E/-D/-r/..\n" + " -a show ascii table ; rax2 -a\n" " -b bin -> str ; rax2 -b 01000101 01110110\n" " -B str -> bin ; rax2 -B hello\n" " -d force integer ; rax2 -d 3 -> 3 instead of 0x3\n" @@ -101,8 +105,9 @@ " -D base64 decode ;\n" " -E base64 encode ;\n" " -f floating point ; rax2 -f 6.3+2.1\n" - " -F stdin slurp code hex ; rax2 -F < shellcode.c\n" + " -F stdin slurp code hex ; rax2 -F < shellcode.[c/py/js]\n" " -h help ; rax2 -h\n" + " -i dump as C byte array ; rax2 -i < bytes\n" " -k keep base ; rax2 -k 33+3 -> 36\n" " -K randomart ; rax2 -K 0x34 1020304050\n" " -L bin -> hex(bignum) ; rax2 -L 111111111 # 0x1ff\n" @@ -120,7 +125,6 @@ } static int rax(char *str, int len, int last) { - float f; ut8 *buf; char *p, out_mode = (flags & 128)? 'I': '0'; int i; @@ -145,6 +149,7 @@ while (str[1] && str[1] != ' ') { switch (str[1]) { case 'l': nl = "\n"; break; + case 'a': print_ascii_table (); return 0; case 's': flags ^= 1; break; case 'e': flags ^= 1 << 1; break; case 'S': flags ^= 1 << 2; break; @@ -165,13 +170,17 @@ case 'w': flags ^= 1 << 16; break; case 'r': flags ^= 1 << 18; break; case 'L': flags ^= 1 << 19; break; + case 'i': flags ^= 1 << 21; break; case 'v': blob_version ("rax2"); return 0; case '\0': return !use_stdin (); default: + /* not as complete as for positive numbers */ out_mode = (flags ^ 32)? '0': 'I'; if (str[1] >= '0' && str[1] <= '9') { if (str[2] == 'x') { out_mode = 'I'; + } else if (r_str_endswith (str, "f")) { + out_mode = 'l'; } return format_output (out_mode, str); } @@ -361,7 +370,7 @@ char *out = calloc (sizeof (char), (len + 2) / 3 * 4 + 1); // ceil(len/3)*4 plus 1 for NUL if (out) { r_base64_encode (out, (const ut8 *) str, len); - printf ("%s\n", out); + printf ("%s%s", out, nl); fflush (stdout); free (out); } @@ -411,6 +420,7 @@ s = n >> 16 << 12; a = n & 0x0fff; r_num_units (unit, n); +#if 0 eprintf ("%" PFMT64d " 0x%" PFMT64x " 0%" PFMT64o " %s %04x:%04x ", n, n, n, unit, s, a); @@ -428,25 +438,56 @@ r_str_bits (out, (const ut8 *) &n, sizeof (n), NULL); eprintf ("%s %.01lf %ff %lf\n", out, num->fvalue, f, d); +#endif + printf ("hex 0x%"PFMT64x"\n", n); + printf ("octal 0%"PFMT64o"\n", n); + printf ("unit %s\n", unit); + printf ("segment %04x:%04x\n", s, a); + if (n >> 32) { + printf ("int64 %"PFMT64d"\n", (st64)n); + } else { + printf ("int32 %d\n", (st32)n); + } + if (asnum) { + printf ("string \"%s\"\n", asnum); + free (asnum); + } + /* binary and floating point */ + r_str_bits64 (out, n); + memcpy (&f, &n, sizeof (f)); + memcpy (&d, &n, sizeof (d)); + printf ("binary 0b%s\n", out); + printf ("float: %ff\n", f); + printf ("double: %lf\n", d); + + /* ternary */ + r_num_to_trits (out, n); + printf ("trits 0t%s\n", out); return true; } else if (flags & (1 << 19)) { // -L r_print_hex_from_bin (NULL, str); return true; - } else if (flags & (1 << 20)) { // -P - char *str = r_stdin_slurp (NULL); - if (str) { - char *res = r_hex_from_py (str); - if (res) { - printf ("%s\n", res); - fflush (stdout); - free (res); - } else { - eprintf ("Invalid input.\n"); - } - free (str); - } - return false; + } else if (flags & (1 << 21)) { // -i + static const char start[] = "unsigned char buf[] = {"; + printf (start); + /* resonable amount of bytes per line */ + const int byte_per_col = 12; + for (i = 0; i < len-1; i++) { + /* wrapping every N bytes */ + if (i % byte_per_col == 0) { + printf ("\n "); + } + printf ("0x%02x, ", (ut8) str[i]); + } + /* some care for the last element */ + if (i % byte_per_col == 0) { + printf("\n "); + } + printf ("0x%02x\n", (ut8) str[len-1]); + printf ("};\n"); + printf ("unsigned int buf_len = %d;\n", len); + return true; } if (r_str_startswith (str, "0x")) { @@ -474,10 +515,7 @@ str[strlen (str) - 1] = 'b'; // TODO: Move print into format_output } else if (r_str_endswith (str, "f")) { - ut8 *p = (ut8 *) &f; - sscanf (str, "%f", &f); - printf ("Fx%02x%02x%02x%02x\n", p[3], p[2], p[1], p[0]); - return true; + out_mode = 'l'; } else if (r_str_endswith (str, "dt")) { out_mode = 'I'; str[strlen (str) - 2] = 't'; @@ -500,7 +538,7 @@ if (!buf) { return 0; } - if (!(flags & 16384)) { + if (!(flags & (1<<14))) { for (l = 0; l >= 0 && l < STDIN_BUFFER_SIZE; l++) { // make sure we don't read beyond boundaries int n = read (0, buf + l, STDIN_BUFFER_SIZE - l); @@ -514,7 +552,7 @@ } buf[n] = 0; // if (sflag && strlen (buf) < STDIN_BUFFER_SIZE) // -S - buf[STDIN_BUFFER_SIZE] = '\0'; + buf[STDIN_BUFFER_SIZE] = '\0'; if (!rax (buf, l, 0)) { break; } diff -Nru radare2-2.3.0+dfsg/binr/rules.mk radare2-2.8.0+dfsg/binr/rules.mk --- radare2-2.3.0+dfsg/binr/rules.mk 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/binr/rules.mk 2018-08-07 14:12:36.000000000 +0000 @@ -2,12 +2,9 @@ include ../../libr/config.mk include ../../shlr/zip/deps.mk -ifneq ($(OSTYPE),windows) -# tcc doesn't recognize the -pie option ifeq (,$(findstring tcc,${CC})) CFLAGS+=-pie endif -endif CFLAGS+=-I$(LTOP)/include ifeq (${COMPILER},emscripten) @@ -21,25 +18,26 @@ OBJ+=${BIN}.o BEXE=${BIN}${EXT_EXE} -ifeq ($(WITHNONPIC),1) -## LDFLAGS+=$(addsuffix /lib${BINDEPS}.a,$(addprefix ../../libr/,$(subst r_,,$(BINDEPS)))) -LDFLAGS+=$(shell for a in ${BINDEPS} ; do b=`echo $$a |sed -e s,r_,,g`; echo ../../libr/$$b/lib$$a.${EXT_AR} ; done ) -LDFLAGS+=../../shlr/sdb/src/libsdb.a -ifeq (1,$(WITH_GPL)) -LDFLAGS+=../../shlr/grub/libgrubfs.a -endif -LDFLAGS+=../../shlr/gdb/lib/libgdbr.a -LDFLAGS+=../../shlr/windbg/libr_windbg.a -LDFLAGS+=../../shlr/capstone/libcapstone.a -LDFLAGS+=../../shlr/java/libr_java.a -LDFLAGS+=../../libr/socket/libr_socket.a -LDFLAGS+=../../libr/util/libr_util.a -ifneq (${OSTYPE},haiku) -ifneq ($(CC),cccl) -LDFLAGS+=-lm -endif -endif -endif +# ifeq ($(WITHNONPIC),1) +# ## LDFLAGS+=$(addsuffix /lib${BINDEPS}.a,$(addprefix ../../libr/,$(subst r_,,$(BINDEPS)))) +# LDFLAGS+=$(shell for a in ${BINDEPS} ; do b=`echo $$a |sed -e s,r_,,g`; echo ../../libr/$$b/lib$$a.${EXT_AR} ; done ) +# LDFLAGS+=../../shlr/sdb/src/libsdb.a +# ifeq (1,$(WITH_GPL)) +# LDFLAGS+=../../shlr/grub/libgrubfs.a +# endif +# LDFLAGS+=../../shlr/gdb/lib/libgdbr.a +# LDFLAGS+=../../shlr/windbg/libr_windbg.a +# LDFLAGS+=../../shlr/capstone/libcapstone.a +# LDFLAGS+=../../shlr/java/libr_java.a +# LDFLAGS+=../../libr/socket/libr_socket.a +# LDFLAGS+=../../libr/util/libr_util.a +# ifneq (${OSTYPE},haiku) +# ifneq ($(CC),cccl) +# LDFLAGS+=-lm +# endif +# endif +# endif + LDFLAGS+=${DL_LIBS} LDFLAGS+=${LINK} ifneq (${ANDROID},1) @@ -76,15 +74,11 @@ # -static fails because -ldl -lpthread static-gcc ... ${BEXE}: ${OBJ} ${SHARED_OBJ} -ifeq ($(WITHNONPIC),1) - ${CC} -pie ${CFLAGS} $+ -L.. -o $@ $(REAL_LDFLAGS) -else ifneq ($(SILENT),) @echo LD $@ endif ${CC} ${CFLAGS} $+ -L.. -o $@ $(REAL_LDFLAGS) endif -endif # Dummy myclean rule that can be overriden by the t/ Makefile # TODO: move to config.mk ? it must be a precondition diff -Nru radare2-2.3.0+dfsg/configure radare2-2.8.0+dfsg/configure --- radare2-2.3.0+dfsg/configure 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/configure 2018-08-07 14:12:36.000000000 +0000 @@ -1,9 +1,10 @@ #!/bin/sh -# This script was automatically generated by ACR v1.4 +# This script was automatically generated by ACR v1.6.2 # @author: pancake # @url: http://www.nopcode.org # @repo: git clone https://github.com/radare/acr +[ -z "${AWK}" ] && AWK=awk do_remove() { if [ "${ACR_RMFILES}" ]; then printf "cleaning temporally files... " @@ -21,15 +22,15 @@ USE_MAGIC=0 LOADLIBS=1 HAVE_FORK=1 +WITH_LIBR=0 WITH_CAPSTONE=0 USE_ZIP=0 +USE_XXHASH=0 WITH_GPL=1 WANT_OPENSSL=0 USE_RPATH=0 [ -z "${USERCC}" ] && USERCC="gcc" [ -z "${USEROSTYPE}" ] && USEROSTYPE="auto" -WITHPIC=1 -WITHNONPIC=0 [ -z "${LIBVERSION}" ] && LIBVERSION="xxx" HAVE_JEMALLOC=1 split_host() { @@ -38,7 +39,7 @@ ENVWORDS="${ENVWORDS} $1_CPU $1_OS" STR=`eval "echo ${S}$1"` SPLIT_CPU="`echo "$STR" | cut -d - -f 1`" -SPLIT_OS="`echo "$STR" | awk -F - '{ +SPLIT_OS="`echo "$STR" | $AWK -F - '{ if ($2=="unknown"){ if (NF<3) { print $2; } else { print $3; } } else { @@ -116,12 +117,12 @@ : ${INSTALL_PROGRAM_STRIP:=${INSTALL} -m 755 -s} : ${INSTALL_MAN:=${INSTALL} -m 444} : ${INSTALL_LIB:=${INSTALL} -m 755 -c} - PKGNAME='radare2' ; VERSION='2.3.0' ; CONTACT_MAIL="pancake@nopcode.org" ; CONTACT_NAME="pancake" ; CONTACT="pancake " ; + PKGNAME='radare2' ; VERSION='2.8.0' ; CONTACT_MAIL="pancake@nopcode.org" ; CONTACT_NAME="pancake" ; CONTACT="pancake " ; } show_usage() { cat <." exit 0 @@ -212,7 +213,7 @@ parse_options() { flag=`echo $1| cut -d = -f 1` -value=`echo $1| awk 'BEGIN{FS="=";}{print $2}'` +value=`echo $1| $AWK 'BEGIN{FS="=";}{print $2}'` flag2=`echo $flag|cut -f2- -d -| sed -e 's,-,_,g' -e 's,^_,,g'|tr '[a-z]' '[A-Z]'` if [ "${TARGET_OS}" = "darwin" ]; then @@ -228,12 +229,12 @@ show_version ; ;; -r|--r|--report) echo "PKGNAME: radare2" -echo "VERSION: 2.3.0" +echo "VERSION: 2.8.0" echo "LANGS: c" echo "REQUIRED: libdl" -echo "OPTIONAL: libmagic" +echo "OPTIONAL: libmagic libz libzip libxxhash libssl" echo "PKG-CONFIG: capstone openssl" -echo "FLAGS: --disable-debugger --with-sysmagic --disable-loadlibs --without-fork --with-syscapstone --with-syszip --without-gpl --with-openssl --with-rpath --with-compiler=gcc --with-ostype=auto --without-pic --with-nonpic --with-libversion=xxx --without-jemalloc" +echo "FLAGS: --disable-debugger --with-sysmagic --disable-loadlibs --without-fork --with-libr --with-syscapstone --with-syszip --with-sysxxhash --without-gpl --with-openssl --with-rpath --with-compiler=gcc --with-ostype=auto --with-libversion=xxx --without-jemalloc" exit 0 ;; --cache-file) @@ -283,15 +284,15 @@ "--with-sysmagic") USE_MAGIC="1"; ;; "--disable-loadlibs") LOADLIBS="0"; ;; "--without-fork") HAVE_FORK="0"; ;; +"--with-libr") WITH_LIBR="1"; ;; "--with-syscapstone") WITH_CAPSTONE="1"; ;; "--with-syszip") USE_ZIP="1"; ;; +"--with-sysxxhash") USE_XXHASH="1"; ;; "--without-gpl") WITH_GPL="0"; ;; "--with-openssl") WANT_OPENSSL="1"; ;; "--with-rpath") USE_RPATH="1"; ;; --with-compiler) if [ -z "${value}" ]; then USERCC="gcc"; else USERCC="${value}" ; fi ;; --with-ostype) if [ -z "${value}" ]; then USEROSTYPE="auto"; else USEROSTYPE="${value}" ; fi ;; -"--without-pic") WITHPIC="0"; ;; -"--with-nonpic") WITHNONPIC="1"; ;; --with-libversion) if [ -z "${value}" ]; then LIBVERSION="xxx"; else LIBVERSION="${value}" ; fi ;; "--without-jemalloc") HAVE_JEMALLOC="0"; ;; *) if [ "$value" ]; then eval "`echo $flag2=$value`" ; @@ -311,7 +312,7 @@ shift done -ENVWORDS="MANDIR INFODIR LIBDIR INCLUDEDIR LOCALSTATEDIR SYSCONFDIR DATADIR DOCDIR LIBEXECDIR SBINDIR BINDIR EPREFIX PREFIX SPREFIX TARGET HOST BUILD INSTALL INSTALL_LIB INSTALL_MAN INSTALL_PROGRAM INSTALL_PROGRAM_STRIP INSTALL_DIR INSTALL_SCRIPT INSTALL_DATA HOST_OS HOST_CPU BUILD_OS BUILD_CPU TARGET_OS TARGET_CPU PKGNAME VPATH VERSION CONTACT CONTACT_NAME CONTACT_MAIL CC CFLAGS CPPFLAGS LDFLAGS HAVE_LANG_C DEBUGGER HAVE_LIB_DL DL_LIBS HAVE_PATCH PATCH HAVE_GIT GIT HAVE_LIB_MAGIC USE_MAGIC USE_LIB_MAGIC LIBMAGIC LOADLIBS HAVE_FORK WITH_CAPSTONE CAPSTONE_CFLAGS CAPSTONE_LDFLAGS HAVE_PKGCFG_CAPSTONE USE_CAPSTONE HAVE_LIB_Z HAVE_LIB_ZIP USE_ZIP USE_LIB_ZIP LIBZIP WITH_GPL HAVE_LIB_GMP HAVE_LIB_SSL SSL_CFLAGS SSL_LDFLAGS HAVE_PKGCFG_OPENSSL HAVE_OPENSSL WANT_OPENSSL USE_RPATH USERCC USEROSTYPE WITHPIC WITHNONPIC LIBVERSION HAVE_JEMALLOC" +ENVWORDS="MANDIR INFODIR LIBDIR INCLUDEDIR LOCALSTATEDIR SYSCONFDIR DATADIR DOCDIR LIBEXECDIR SBINDIR BINDIR EPREFIX PREFIX SPREFIX TARGET HOST BUILD INSTALL INSTALL_LIB INSTALL_MAN INSTALL_PROGRAM INSTALL_PROGRAM_STRIP INSTALL_DIR INSTALL_SCRIPT INSTALL_DATA HOST_OS HOST_CPU BUILD_OS BUILD_CPU TARGET_OS TARGET_CPU PKGNAME VPATH VERSION CONTACT CONTACT_NAME CONTACT_MAIL CC CFLAGS CPPFLAGS LDFLAGS HAVE_LANG_C DEBUGGER HAVE_LIB_DL DL_LIBS HAVE_PATCH PATCH HAVE_GIT GIT HAVE_LIB_MAGIC USE_MAGIC USE_LIB_MAGIC LIBMAGIC LOADLIBS HAVE_FORK WITH_LIBR WITH_CAPSTONE CAPSTONE_CFLAGS CAPSTONE_LDFLAGS HAVE_PKGCFG_CAPSTONE USE_CAPSTONE HAVE_LIB_Z HAVE_LIB_ZIP USE_ZIP USE_LIB_ZIP LIBZIP HAVE_LIB_XXHASH USE_XXHASH USE_LIB_XXHASH LIBXXHASH WITH_GPL HAVE_DECL_ADDR_NO_RANDOMIZE HAVE_ARC4RANDOM_UNIFORM HAVE_EXPLICIT_BZERO HAVE_LIB_GMP HAVE_LIB_SSL SSL_CFLAGS SSL_LDFLAGS HAVE_PKGCFG_OPENSSL HAVE_OPENSSL WANT_OPENSSL USE_RPATH USERCC USEROSTYPE LIBVERSION HAVE_JEMALLOC" create_environ @@ -416,7 +417,15 @@ echo yes else eval ${VAR}=0 - echo no ; fi } + echo no + if [ "${_REQUIRED}" = 1 ]; then + echo "this library is required." + do_remove + exit 1 + fi +fi +} + check_library HAVE_LIB_MAGIC magic 0 if [ 11 = "$HAVE_LIB_MAGIC$USE_MAGIC" ]; then @@ -455,6 +464,36 @@ else USE_LIB_ZIP="0" LIBZIP=""; fi +check_library HAVE_LIB_XXHASH xxhash 0 +if [ 11 = "$HAVE_LIB_XXHASH$USE_XXHASH" ]; then + +USE_LIB_XXHASH="1" +LIBXXHASH="-lxxhash" +else +USE_LIB_XXHASH="0" +LIBXXHASH=""; fi +printf "checking declaration of ADDR_NO_RANDOMIZE in sys/personality.h... " +echo "#include " > test.c +echo "int main(int ac, char **av){ void *a = ADDR_NO_RANDOMIZE; return 0; }" >> test.c +${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} test.c >/dev/null 2>&1 +if [ $? = 0 ]; then + echo yes ; HAVE_DECL_ADDR_NO_RANDOMIZE=1 +else + HAVE_DECL_ADDR_NO_RANDOMIZE=0 ; echo no ; fi +printf "checking function arc4random_uniform() in c... " +echo "int main(int ac, char **av){ arc4random_uniform(0); return 0; }" > test.c +${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -lc test.c >/dev/null 2>&1 +if [ $? = 0 ]; then + echo yes ; HAVE_ARC4RANDOM_UNIFORM=1 +else + HAVE_ARC4RANDOM_UNIFORM=0 ; echo no ; fi +printf "checking function explicit_bzero() in c... " +echo "int main(int ac, char **av){ explicit_bzero(0); return 0; }" > test.c +${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -lc test.c >/dev/null 2>&1 +if [ $? = 0 ]; then + echo yes ; HAVE_EXPLICIT_BZERO=1 +else + HAVE_EXPLICIT_BZERO=0 ; echo no ; fi HAVE_LIB_GMP="0" check_library HAVE_LIB_SSL ssl 0 [ -z "${PKGCONFIG}" ] && PKGCONFIG=pkg-config @@ -548,7 +587,7 @@ MARK="##${A}##" if [ -n "`grep \"${MARK}\" ${SD_TARGET}.tmp`" ]; then mv ${SD_TARGET}.tmp ${SD_TARGET}.tmp2 - cat ${SD_TARGET}.tmp2 | MARK=$MARK awk 'BEGIN{a=0;}{if($1==ENVIRON["MARK"]){if(a)a=0;else a=1}else{if(!a)print;}}' > ${SD_TARGET}.tmp + cat ${SD_TARGET}.tmp2 | MARK=$MARK $AWK 'BEGIN{a=0;}{if($1==ENVIRON["MARK"]){if(a)a=0;else a=1}else{if(!a)print;}}' > ${SD_TARGET}.tmp fi fi done @@ -559,7 +598,7 @@ do_remove echo echo "Final report:" -for A in PREFIX HAVE_LIB_GMP HAVE_OPENSSL USE_CAPSTONE HAVE_FORK VERSION USE_LIB_ZIP USE_LIB_MAGIC DEBUGGER CC USERCC USEROSTYPE LIBVERSION BUILD HOST TARGET ; do # REPORT +for A in PREFIX HAVE_LIB_GMP HAVE_OPENSSL USE_CAPSTONE HAVE_FORK VERSION USE_LIB_ZIP USE_LIB_MAGIC USE_LIB_XXHASH DEBUGGER CC USERCC HAVE_ARC4RANDOM_UNIFORM HAVE_EXPLICIT_BZERO USEROSTYPE LIBVERSION BUILD HOST TARGET ; do # REPORT eval VAL="\$${A}" [ -z "${VAL}" ] && VAL="(null)" echo " - ${A} = ${VAL}" diff -Nru radare2-2.3.0+dfsg/configure.acr radare2-2.8.0+dfsg/configure.acr --- radare2-2.3.0+dfsg/configure.acr 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/configure.acr 2018-08-07 14:12:36.000000000 +0000 @@ -1,5 +1,5 @@ PKGNAME radare2 -VERSION 2.3.0 +VERSION 2.8.0 CONTACT pancake ; pancake@nopcode.org LANG_C! @@ -26,6 +26,8 @@ ARG_WITHOUT HAVE_FORK fork disable fork ; +ARG_WITH WITH_LIBR libr build libr.a and libr.dylib ; + ARG_WITH WITH_CAPSTONE syscapstone force to use system-wide capstone ; PKGCFG CAPSTONE_CFLAGS CAPSTONE_LDFLAGS capstone IFAND WITH_CAPSTONE HAVE_PKGCFG_CAPSTONE { @@ -50,8 +52,22 @@ LIBZIP = '' ; (( static linking to shlr/zip )) } +CHKLIB xxhash +ARG_WITH USE_XXHASH sysxxhash force to use system's xxhash ; +IFAND HAVE_LIB_XXHASH USE_XXHASH { + USE_LIB_XXHASH = 1 ; + LIBXXHASH = -lxxhash ; +}{ + USE_LIB_XXHASH = 0 ; + LIBXXHASH = '' ; +} + ARG_WITHOUT WITH_GPL gpl do not build GPL code (grub, cxx, ... ) ; +CHKDECL sys/personality.h ADDR_NO_RANDOMIZE +CHKFNC c arc4random_uniform +CHKFNC c explicit_bzero + (( TODO must deprecate CHKLIB gmp ARG_WITHOUT HAVE_GMP gmp disable GMP dependency ; @@ -124,8 +140,6 @@ } } } } } } } } } } } -ARG_WITHOUT WITHPIC pic do not build libr as a program independent location ; -ARG_WITH WITHNONPIC nonpic build the library archives .a ; (( this hack is required for openbsd ports )) ARG_WITH LIBVERSION=xxx libversion specify different libversion ; ARG_WITHOUT HAVE_JEMALLOC jemalloc build without jemalloc ; @@ -135,8 +149,8 @@ } REPORT PREFIX HAVE_LIB_GMP HAVE_OPENSSL USE_CAPSTONE HAVE_FORK - VERSION USE_LIB_ZIP USE_LIB_MAGIC DEBUGGER CC USERCC - USEROSTYPE LIBVERSION BUILD HOST TARGET ; + VERSION USE_LIB_ZIP USE_LIB_MAGIC USE_LIB_XXHASH DEBUGGER CC USERCC HAVE_ARC4RANDOM_UNIFORM + HAVE_EXPLICIT_BZERO USEROSTYPE LIBVERSION BUILD HOST TARGET ; (( TODO: Add the rest of .pc files here.. add a rule for acr? )) SUBDIRS ./config-user.mk diff -Nru radare2-2.3.0+dfsg/config-user.mk.acr radare2-2.8.0+dfsg/config-user.mk.acr --- radare2-2.3.0+dfsg/config-user.mk.acr 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/config-user.mk.acr 2018-08-07 14:12:36.000000000 +0000 @@ -16,6 +16,7 @@ USE_RPATH=@USE_RPATH@ HAVE_JEMALLOC=@HAVE_JEMALLOC@ HAVE_FORK=@HAVE_FORK@ +WITH_LIBR=@WITH_LIBR@ MKPLUGINS=mk/stat.mk mk/sloc.mk @@ -45,8 +46,6 @@ ifeq ($(OSTYPE),qnx) DL_LIBS= endif -WITHPIC=@WITHPIC@ -WITHNONPIC=@WITHNONPIC@ # capstone USE_CAPSTONE=@USE_CAPSTONE@ @@ -62,9 +61,12 @@ HAVE_LIB_SSL=@HAVE_OPENSSL@ HAVE_LIB_MAGIC=@HAVE_LIB_MAGIC@ USE_LIB_MAGIC=@USE_LIB_MAGIC@ +HAVE_LIB_XXHASH=@HAVE_LIB_XXHASH@ +USE_LIB_XXHASH=@USE_LIB_XXHASH@ USE_LIB_ZIP=@USE_LIB_ZIP@ LIBMAGIC=@LIBMAGIC@ LIBZIP=@LIBZIP@ +LIBXXHASH=@LIBXXHASH@ SSL_CFLAGS=@SSL_CFLAGS@ SSL_LDFLAGS=@SSL_LDFLAGS@ diff -Nru radare2-2.3.0+dfsg/CONTRIBUTING.md radare2-2.8.0+dfsg/CONTRIBUTING.md --- radare2-2.3.0+dfsg/CONTRIBUTING.md 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/CONTRIBUTING.md 2018-08-07 14:12:36.000000000 +0000 @@ -23,235 +23,13 @@ * Make commits of logical units. * Check for unnecessary whitespace with ```git diff --check``` and be sure to follow the CODINGSTYLE (more on this in the next section). * Submit the Pull Request(PR) on Github. -* When relevant, write a test for [radare2-regressions](https://github.com/radare/radare2-regressions) and submit a PR also there. - -## Coding Style guidelines - -* Tabs are used for indentation. In a switch statement, the - cases are indentend at the switch level. - -```c -switch(n) { -case 1: -case 2: -default: -} -``` - -* Lines should be at most 78 chars. A tab is considered as 8 chars. - -* Braces open on the same line as the for/while/if/else/function/etc. Closing - braces are put on a line of their own, except in the else of an if statement - or in a while of a do-while statement. Always use braces for if and while, - except when the expressions are very simple and they can fit in a one-line. - -```c -if (a == b) { - ... -} - -if (a == b) { - ... -} else if (a > b) { - ... -} - -if (a == b) do_something (); - -if (a == b) do_something (); -else do_something_else (); - -if (!ok) return false; - -if (!buf) goto err_buf; - -if (a == b) { - ... -} else { - do_something_else (); -} - -do { - do_something (); -} while (cond); - -if (a == b) { - b = 3; -} - -``` - -* In general, don't use goto. The goto statement only comes in handy when a - function exits from multiple locations and some common work such as cleanup - has to be done. If there is no cleanup needed then just return directly. - - Choose label names which say what the goto does or why the goto exists. An - example of a good name could be "out_buffer:" if the goto frees "buffer". - Avoid using GW-BASIC names like "err1:" and "err2:". - -* Use early returns instead of if-else when you need to filter out some bad - value at the start of a function. - -```c -int check(RCore *c, int a, int b) { - if (!c) return false; - if (a < 0 || b < 1) return false; - - ... /* do something else */ -} -``` - -* Use a space after most of the keyword and around operators. - -```c -a = b + 3; -a = (b << 3) * 5; -``` - -* Multiline ternary operator conditionals must be indented a-la JS way: - -```c -- ret = over ? -- r_debug_step_over (dbg, 1) : -- r_debug_step (dbg, 1); -+ ret = over -+ ? r_debug_step_over (dbg, 1) -+ : r_debug_step (dbg, 1); -``` - -* Split long conditional expressions into small `static inline` functions to make them more readable: - -```c -+static inline bool inRange(RBreakpointItem *b, ut64 addr) { -+ return (addr >= b->addr && addr < (b->addr + b->size)); -+} -+ -+static inline bool matchProt(RBreakpointItem *b, int rwx) { -+ return (!rwx || (rwx && b->rwx)); -+} -+ - R_API RBreakpointItem *r_bp_get_in(RBreakpoint *bp, ut64 addr, int rwx) { - RBreakpointItem *b; - RListIter *iter; - r_list_foreach (bp->bps, iter, b) { -- if (addr >= b->addr && addr < (b->addr+b->size) && \ -- (!rwx || rwx&b->rwx)) -+ if (inRange (b, addr) && matchProt (b, rwx)) { - return b; -+ } - } - return NULL; - } -``` - -* Why return int vs enum - -The reason why many places in r2land functions return int instead of an enum type is because enums cant be OR'ed because it breaks the usage within a switch statement and also because swig cant handle that stuff. - -``` -r_core_wrap.cxx:28612:60: error: assigning to 'RRegisterType' from incompatible type 'long' - arg2 = static_cast< long >(val2); if (arg1) (arg1)->type = arg2; resultobj = SWIG_Py_Void(); return resultobj; fail: - ^ ~~~~ -r_core_wrap.cxx:32103:61: error: assigning to 'RDebugReasonType' from incompatible type 'int' - arg2 = static_cast< int >(val2); if (arg1) (arg1)->type = arg2; resultobj = SWIG_Py_Void(); return resultobj; fail: - ^ ~~~~ -3 warnings and 2 errors generated. -```` - -* Do not leave trailing whitespaces at the end of line - -* Do not use C99 variable declaration - - This way we reduce the number of local variables per function - and it's easier to find which variables are used, where and so on. - -* Always put a space before every parenthesis (function calls, conditionals, - fors, etc, ...) except when defining the function signature. This is - useful for grepping. - -* Comments should be smart. Function names should be explicit enough - to not require a comment to explain what it does. If this is not - possible at all, we can still use a comment. But it is a bad idea - to rely on comments to make the code readable. - -* Use 'R_API' define to mark exportable (public) methods only for module APIs - -* The rest of functions must be static, to avoid polluting the global space. - -* Avoid using global variables, they are evil. Only use them for singletons - and wip code, placing a comment explaining the reason for them to stay there. - -* If you *really* need to comment out some code, use #if 0 (...) #endif. In - general, don't comment out code because it makes the code less readable. - -* Do not write ultra-large functions, split them into multiple or simplify - the algorithm, only external-copy-pasted-not-going-to-be-maintained code - can be accepted in this way (gnu code, external disassemblers, etc..) - -* See doc/vim for vimrc - -* See doc/clang-format for work-in-progress support for automated indentation - -* Use the r2 types instead of the ones in stdint, which are known to cause some - portability issues. So, instead of uint8_t, use ut8, etc.. - -* Never ever use %lld or %llx. This is not portable. Always use the PFMT64x - macros. Those are similar to the ones in GLIB. - -# Manage Endianness - -As hackers, we need to be aware of endianness. - -Endianness can become a problem when you try to process buffers or streams -of bytes and store intermediate values as integers with width larger than -a single byte. - -It can seem very easy to write the following code: - - ut8 opcode[4] = {0x10, 0x20, 0x30, 0x40}; - ut32 value = *(ut32*)opcode; - -... and then continue to use "value" in the code to represent the opcode. - -This needs to be avoided! - -Why? What is actually happening? - -When you cast the opcode stream to a unsigned int, the compiler uses the endianness -of the host to interpret the bytes and stores it in host endianness. This leads to -very unportable code, because if you compile on a different endian machine, the -value stored in "value" might be 0x40302010 instead of 0x10203040. - -## Solution - -Use bitshifts and OR instructions to interpret bytes in a known endian. -Instead of casting streams of bytes to larger width integers, do the following: - -ut8 opcode[4] = {0x10, 0x20, 0x30, 0x40}; -ut32 value = opcode[0] | opcode[1] << 8 | opcode[2] << 16 | opcode[3] << 24; - -or if you prefer the other endian: - -ut32 value = opcode[3] | opcode[2] << 8 | opcode[1] << 16 | opcode[0] << 24; - -This is much better because you actually know which endian your bytes are stored in -within the integer value, REGARDLESS of the host endian of the machine. - -## Endian helper functions - -Radare2 now uses helper functions to interpret all byte streams in a known endian. - -Please use these at all times, eg: - - val32 = r_read_be32(buffer) // reads 4 bytes from a stream in BE - val32 = r_read_le32(buffer) // reads 4 bytes from a stream in LE - val32 = r_read_ble32(buffer, isbig) // reads 4 bytes from a stream: - // if isbig is true, reads in BE - // otherwise reads in LE - -There are a number of helper functions for 64, 32, 16, and 8 bit reads and writes. - -(Note that 8 bit reads are equivalent to casting a single byte of the buffer -to a ut8 value, ie endian is irrelevant). +* When relevant, write a test for + [radare2-regressions](https://github.com/radare/radare2-regressions) and + submit a PR also there. Use the same branch name in both repositories, so + Travis will be able to use your new tests together with new changes. + AppVeyor (for now) still uses radare/radare2-regressions repo with branch + master. NOTE: when merging PRs, *always* merge the radare2-regressions PR + first. # Additional resources diff -Nru radare2-2.3.0+dfsg/debian/changelog radare2-2.8.0+dfsg/debian/changelog --- radare2-2.3.0+dfsg/debian/changelog 2018-10-19 11:16:06.000000000 +0000 +++ radare2-2.8.0+dfsg/debian/changelog 2018-10-19 11:27:29.000000000 +0000 @@ -1,8 +1,35 @@ -radare2 (2.3.0+dfsg-2~ubuntu16.04.1~ppa1) xenial; urgency=medium +radare2 (2.8.0+dfsg-1~ubuntu16.04.1~ppa1) xenial; urgency=medium - * No-change backport to xenial + * Downgrade build-depends to debhelper (>= 10) to allow backporting - -- Raffaele Forte Fri, 19 Oct 2018 13:16:06 +0200 + -- Raffaele Forte Fri, 19 Oct 2018 13:26:03 +0200 + +radare2 (2.8.0+dfsg-1) unstable; urgency=medium + + * New upstream release + * Update Debian Standards Version to 4.1.5 + + -- Sebastian Reichel Wed, 08 Aug 2018 22:37:49 +0200 + +radare2 (2.7.0+dfsg-1) unstable; urgency=medium + + * New upstream release + + -- Sebastian Reichel Tue, 10 Jul 2018 00:04:16 +0200 + +radare2 (2.6.0+dfsg-1) unstable; urgency=medium + + * New upstream release + * Switch to compat level 11 + * Backport a few patches to fix build with system libraries + + -- Sebastian Reichel Tue, 10 Apr 2018 16:29:24 +0200 + +radare2 (2.4.0+dfsg-1) unstable; urgency=medium + + * New upstream release + + -- Sebastian Reichel Mon, 05 Mar 2018 21:32:57 +0100 radare2 (2.3.0+dfsg-2) unstable; urgency=medium diff -Nru radare2-2.3.0+dfsg/debian/control radare2-2.8.0+dfsg/debian/control --- radare2-2.3.0+dfsg/debian/control 2018-02-23 10:38:59.000000000 +0000 +++ radare2-2.8.0+dfsg/debian/control 2018-10-19 11:27:08.000000000 +0000 @@ -1,9 +1,9 @@ Source: radare2 Section: devel Priority: optional -Maintainer: Debian Security Tools Packaging Team +Maintainer: Debian Security Tools Uploaders: Sebastian Reichel -Build-Depends: debhelper (>= 10~), +Build-Depends: debhelper (>= 10), flex, gobject-introspection, libcapstone-dev, @@ -18,7 +18,7 @@ python-dev, liblua5.2-dev, zlib1g-dev -Standards-Version: 4.1.3 +Standards-Version: 4.1.5 Homepage: https://www.radare.org Vcs-Browser: https://salsa.debian.org/pkg-security-team/radare2 Vcs-Git: https://salsa.debian.org/pkg-security-team/radare2.git @@ -40,7 +40,7 @@ supporting PE, mach0, ELF, class, etc. named rabin, and a block-based hash utility called rahash. -Package: libradare2-2.3 +Package: libradare2-2.8 Section: libs Architecture: any Pre-Depends: ${misc:Pre-Depends} @@ -64,7 +64,7 @@ Package: libradare2-dev Section: libdevel Architecture: any -Depends: ${misc:Depends}, libradare2-2.3 (= ${binary:Version}), +Depends: ${misc:Depends}, libradare2-2.8 (= ${binary:Version}), libcapstone-dev, libmagic-dev Description: devel files from the radare2 suite The project aims to create a complete, portable, multi-architecture, diff -Nru radare2-2.3.0+dfsg/debian/copyright radare2-2.8.0+dfsg/debian/copyright --- radare2-2.3.0+dfsg/debian/copyright 2018-02-23 10:38:59.000000000 +0000 +++ radare2-2.8.0+dfsg/debian/copyright 2018-08-08 20:37:49.000000000 +0000 @@ -131,10 +131,6 @@ 2007-2015 pancake License: Apache-2.0 -Files: shlr/udis86/* -Copyright: 2002-2013 Vivek Thampi -License: BSD-2-clause - Files: shlr/zip/zip/* Copyright: 1999-2013 Dieter Baron and Thomas Klausner License: BSD-2-clause diff -Nru radare2-2.3.0+dfsg/debian/libradare2-2.3.install radare2-2.8.0+dfsg/debian/libradare2-2.3.install --- radare2-2.3.0+dfsg/debian/libradare2-2.3.install 2018-02-23 10:38:59.000000000 +0000 +++ radare2-2.8.0+dfsg/debian/libradare2-2.3.install 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -usr/lib/*/*.so.2.* -usr/lib/*/radare2/2.* diff -Nru radare2-2.3.0+dfsg/debian/libradare2-2.3.lintian-overrides radare2-2.8.0+dfsg/debian/libradare2-2.3.lintian-overrides --- radare2-2.3.0+dfsg/debian/libradare2-2.3.lintian-overrides 2018-02-23 10:38:59.000000000 +0000 +++ radare2-2.8.0+dfsg/debian/libradare2-2.3.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -# One package is enough for all those libs -libradare2-2.3: package-name-doesnt-match-sonames -# Every r2 release increases API, so no need to track symbols -libradare2-2.3: no-symbols-control-file diff -Nru radare2-2.3.0+dfsg/debian/libradare2-2.8.install radare2-2.8.0+dfsg/debian/libradare2-2.8.install --- radare2-2.3.0+dfsg/debian/libradare2-2.8.install 1970-01-01 00:00:00.000000000 +0000 +++ radare2-2.8.0+dfsg/debian/libradare2-2.8.install 2018-08-08 20:37:49.000000000 +0000 @@ -0,0 +1,2 @@ +usr/lib/*/*.so.2.* +usr/lib/*/radare2/2.* diff -Nru radare2-2.3.0+dfsg/debian/libradare2-2.8.lintian-overrides radare2-2.8.0+dfsg/debian/libradare2-2.8.lintian-overrides --- radare2-2.3.0+dfsg/debian/libradare2-2.8.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ radare2-2.8.0+dfsg/debian/libradare2-2.8.lintian-overrides 2018-08-08 20:37:49.000000000 +0000 @@ -0,0 +1,4 @@ +# One package is enough for all those libs +libradare2-2.8: package-name-doesnt-match-sonames +# Every r2 release increases API, so no need to track symbols +libradare2-2.8: no-symbols-control-file diff -Nru radare2-2.3.0+dfsg/debian/libradare2-dev.install radare2-2.8.0+dfsg/debian/libradare2-dev.install --- radare2-2.3.0+dfsg/debian/libradare2-dev.install 2018-02-23 10:38:59.000000000 +0000 +++ radare2-2.8.0+dfsg/debian/libradare2-dev.install 2018-08-08 20:37:49.000000000 +0000 @@ -1,3 +1,4 @@ usr/include usr/lib/*/pkgconfig usr/lib/*/*.so +usr/lib/*/*.a diff -Nru radare2-2.3.0+dfsg/debian/rules radare2-2.8.0+dfsg/debian/rules --- radare2-2.3.0+dfsg/debian/rules 2018-02-23 10:38:59.000000000 +0000 +++ radare2-2.8.0+dfsg/debian/rules 2018-08-08 20:37:49.000000000 +0000 @@ -3,7 +3,7 @@ DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) DEBUG_SUPPORT=0 -EXTRA_FLAGS=--with-sysmagic --with-syszip --with-syscapstone --with-libversion=2.3 +EXTRA_FLAGS=--with-sysmagic --with-syszip --with-syscapstone --with-libversion=2.8 DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow DPKG_EXPORT_BUILDFLAGS = 1 @@ -62,14 +62,12 @@ dh_makeshlibs --exclude=/usr/lib/$(DEB_HOST_MULTIARCH)/radare2/ override_dh_auto_install: - dh_auto_install - # No need to install Makefile - rm debian/tmp/usr/share/radare2/last/cons/Makefile + make install DESTDIR=`pwd`/debian/tmp # remove "last" symlink rm debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/radare2/last rm debian/tmp/usr/share/radare2/last # remove useless license file - rm debian/tmp/usr/share/doc/radare2/license + rm debian/tmp/usr/share/doc/radare2/license.md # install zsh completion files mkdir -p debian/tmp/usr/share/zsh/vendor-completions install -m 644 doc/zsh/_* debian/tmp/usr/share/zsh/vendor-completions diff -Nru radare2-2.3.0+dfsg/DEVELOPERS.md radare2-2.8.0+dfsg/DEVELOPERS.md --- radare2-2.3.0+dfsg/DEVELOPERS.md 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/DEVELOPERS.md 2018-08-07 14:12:36.000000000 +0000 @@ -1,19 +1,296 @@ -DEVELOPERS -========== +# DEVELOPERS This file aims to describe an introduction for developers to work on the code base of radare2 project. -CODE STYLE ----------- +## Documentation +There is support for Doxygen document generation in this repo. +By running `doxygen` in the root of this repository it will autodetect the +Doxyfile and generate HTML documentation into +[doc/doxygen/html/index.html](./doc/doxygen/html/index.html) + +If you're contributing code or willing to update existing code you can use the +doxygen C style comments to improve documentation and comments in code. +See the [Doxygen Manual](https://www.stack.nl/~dimitri/doxygen/manual/index.html) +for more info. Example usage can be found [here](https://www.stack.nl/~dimitri/doxygen/manual/docblocks.html) +```c +/** + * \brief Find the min and max addresses in an RList of maps. + * \param maps RList of maps that will be searched through + * \param min Pointer to a ut64 that the min will be stored in + * \param max Pointer to a ut64 that the max will be stored in + * \param skip How many maps to skip at the start of iteration + * \param width Divisor for the return value + * \return (max-min)/width + * + * Used to determine the min & max addresses of maps and + * scale the ascii bar to the width of the terminal + */ +static int findMinMax(RList *maps, ut64 *min, ut64 *max, int skip, int width); +``` + +## Code style + In order to contribute with patches or plugins we encourage you to use the same coding style as the rest of the code base. -You may find some notes on this topic [here](https://github.com/radare/radare2/blob/master/CONTRIBUTING.md#coding-style-guidelines) -and doc/vim. +You may find some additional notes on this topic in doc/vim. + +* Tabs are used for indentation. In a switch statement, the + cases are indentend at the switch level. + +```c +switch(n) { +case 1: + break; +case 2: + break; +default: +} +``` + +* Lines should be at most 78 chars. A tab is considered as 4 chars. + +* Braces open on the same line as the for/while/if/else/function/etc. Closing + braces are put on a line of their own, except in the else of an if statement + or in a while of a do-while statement. Always use braces for if and while. + +```c +if (a == b) { + ... +} + +if (a == b) { + ... +} else if (a > b) { + ... +} + +if (a == b) { + ... +} else { + do_something_else (); +} + +do { + do_something (); +} while (cond); + +if (a == b) { + b = 3; +} + +``` + +* In general, don't use goto. The goto statement only comes in handy when a + function exits from multiple locations and some common work such as cleanup + has to be done. If there is no cleanup needed then just return directly. + + Choose label names which say what the goto does or why the goto exists. An + example of a good name could be "out_buffer:" if the goto frees "buffer". + Avoid using GW-BASIC names like "err1:" and "err2:". + +* Use early returns instead of if-else when you need to filter out some bad + value at the start of a function. + +```c +int check(RCore *c, int a, int b) { + if (!c) return false; + if (a < 0 || b < 1) return false; + + ... /* do something else */ +} +``` + +* Use a space after most of the keyword and around operators. + +```c +a = b + 3; +a = (b << 3) * 5; +``` + +* Multiline ternary operator conditionals must be indented a-la JS way: + +```c +- ret = over ? +- r_debug_step_over (dbg, 1) : +- r_debug_step (dbg, 1); ++ ret = over ++ ? r_debug_step_over (dbg, 1) ++ : r_debug_step (dbg, 1); +``` + +* Split long conditional expressions into small `static inline` functions to make them more readable: + +```c ++static inline bool inRange(RBreakpointItem *b, ut64 addr) { ++ return (addr >= b->addr && addr < (b->addr + b->size)); ++} ++ ++static inline bool matchProt(RBreakpointItem *b, int rwx) { ++ return (!rwx || (rwx && b->rwx)); ++} ++ + R_API RBreakpointItem *r_bp_get_in(RBreakpoint *bp, ut64 addr, int rwx) { + RBreakpointItem *b; + RListIter *iter; + r_list_foreach (bp->bps, iter, b) { +- if (addr >= b->addr && addr < (b->addr+b->size) && \ +- (!rwx || rwx&b->rwx)) ++ if (inRange (b, addr) && matchProt (b, rwx)) { + return b; ++ } + } + return NULL; + } +``` + +* Why return int vs enum + +The reason why many places in r2land functions return int instead of an enum type is because enums cant be OR'ed because it breaks the usage within a switch statement and also because swig cant handle that stuff. + +``` +r_core_wrap.cxx:28612:60: error: assigning to 'RRegisterType' from incompatible type 'long' + arg2 = static_cast< long >(val2); if (arg1) (arg1)->type = arg2; resultobj = SWIG_Py_Void(); return resultobj; fail: + ^ ~~~~ +r_core_wrap.cxx:32103:61: error: assigning to 'RDebugReasonType' from incompatible type 'int' + arg2 = static_cast< int >(val2); if (arg1) (arg1)->type = arg2; resultobj = SWIG_Py_Void(); return resultobj; fail: + ^ ~~~~ +3 warnings and 2 errors generated. +```` + +* Do not leave trailing whitespaces at the end of line + +* Do not use asserts + +* Do not use C99 variable declaration + - This way we reduce the number of local variables per function + and it's easier to find which variables are used, where and so on. + +* Always put a space before every parenthesis (function calls, conditionals, + fors, etc, ...) except when defining the function signature. This is + useful for grepping. + +* Function names should be explicit enough to not require a comment + explaining what it does when seen elsewhere in code. + +* Use 'R_API' define to mark exportable (public) methods only for module APIs + +* The rest of functions must be static, to avoid polluting the global space. + +* Avoid using global variables, they are evil. Only use them for singletons + and WIP code, placing a comment explaining the reason for them to stay there. + +* If you *really* need to comment out some code, use #if 0 (...) #endif. In + general, don't comment out code because it makes the code less readable. + +* Do not write ultra-large functions, split them into multiple or simplify + the algorithm, only external-copy-pasted-not-going-to-be-maintained code + can be accepted in this way (gnu code, external disassemblers, etc..) + +* See doc/vim for vimrc + +* See doc/clang-format for work-in-progress support for automated indentation + +* Use the r2 types instead of the ones in stdint, which are known to cause some + portability issues. So, instead of uint8_t, use ut8, etc.. + +* Never ever use %lld or %llx. This is not portable. Always use the PFMT64x + macros. Those are similar to the ones in GLIB. + +# Manage Endianness + +As hackers, we need to be aware of endianness. + +Endianness can become a problem when you try to process buffers or streams +of bytes and store intermediate values as integers with width larger than +a single byte. + +It can seem very easy to write the following code: + + ut8 opcode[4] = {0x10, 0x20, 0x30, 0x40}; + ut32 value = *(ut32*)opcode; + +... and then continue to use "value" in the code to represent the opcode. + +This needs to be avoided! + +Why? What is actually happening? + +When you cast the opcode stream to a unsigned int, the compiler uses the endianness +of the host to interpret the bytes and stores it in host endianness. This leads to +very unportable code, because if you compile on a different endian machine, the +value stored in "value" might be 0x40302010 instead of 0x10203040. + +## Solution + +Use bitshifts and OR instructions to interpret bytes in a known endian. +Instead of casting streams of bytes to larger width integers, do the following: + +ut8 opcode[4] = {0x10, 0x20, 0x30, 0x40}; +ut32 value = opcode[0] | opcode[1] << 8 | opcode[2] << 16 | opcode[3] << 24; + +or if you prefer the other endian: + +ut32 value = opcode[3] | opcode[2] << 8 | opcode[1] << 16 | opcode[0] << 24; + +This is much better because you actually know which endian your bytes are stored in +within the integer value, REGARDLESS of the host endian of the machine. + +## Endian helper functions + +Radare2 now uses helper functions to interpret all byte streams in a known endian. + +Please use these at all times, eg: + + val32 = r_read_be32(buffer) // reads 4 bytes from a stream in BE + val32 = r_read_le32(buffer) // reads 4 bytes from a stream in LE + val32 = r_read_ble32(buffer, isbig) // reads 4 bytes from a stream: + // if isbig is true, reads in BE + // otherwise reads in LE + +There are a number of helper functions for 64, 32, 16, and 8 bit reads and writes. + +(Note that 8 bit reads are equivalent to casting a single byte of the buffer +to a ut8 value, ie endian is irrelevant). + +### Editor configuration + +Vim/Neovim: + +```vim +setl cindent +setl tabstop=4 +setl noexpandtab +setl cino=:0,+0,(2,J0,{1,}0,>4,)1,m2 +``` + +Emacs: + +```elisp +(c-add-style "radare2" + '((c-basic-offset . 4) + (tab-width . 4) + (indent-tabs-mode . t) + ;;;; You would need (put 'c-auto-align-backslashes 'safe-local-variable 'booleanp) to enable this + ;; (c-auto-align-backslashes . nil) + (c-offsets-alist + (arglist-intro . ++) + (arglist-cont . ++) + (arglist-cont-nonempty . ++) + (statement-cont . ++) + ))) +``` + +You may use directory-local variables by putting +```elisp +((c-mode . ((c-file-style . "radare2")))) +``` + +into `.dir-locals.el`. + +## Modules -MODULES -------- The radare2 code base is modularized into different libraries that are found in libr/ directory. The binr/ directory contains the programs that use the libraries. @@ -27,8 +304,8 @@ http://radare.org/get/lacon-radare-2009/ -API ---- +## API + As mentioned in README.md, the API itself is maintained in a different repository. The API function definitions in C header files are derived from and documented in the radare2-bindings repository, found at: @@ -45,13 +322,13 @@ the bindings with the header files, such a contribution would be very welcome. -DEPENDENCIES ------------- +## Dependencies + radare2 can be built without any special dependency. It just requires a C compiler, a GNU make and a unix-like system. -CROSSCOMPILATION ----------------- +## Cross compilation + The instructions to crosscompile r2 to Windows are in doc/windows. You may find other documents in doc/ explaining how to build it on iOS, @@ -63,8 +340,8 @@ - type `make` - install in `DESTDIR` -SOURCE REPOSITORY ------------------ +## Source repository + The source of radare2 can be found in the following github repository. ```sh git clone git://github.com/radare/radare2 @@ -85,8 +362,9 @@ git clean -xdf git reset --hard ``` -COMPILATION ------------ + +## Compilation + Inter-module rebuild dependencies are not handled automatically and require human interaction to recompile the affected modules. @@ -102,14 +380,14 @@ export CC="ccache gcc" ``` -INSTALLATION ------------- +## Installation + Developers use to modify the code, type make and then try. radare2 have a specific makefile target that allows you to install system wide but using symlinks instead of hard copies. ```sh - sudo make symstall +sudo make symstall ``` This kind of installation is really helpful if you do lot of changes in the code for various reasons. @@ -117,8 +395,7 @@ - only one install is required across multiple builds - installation time is much faster -REGRESSION TESTING ------------------- +## Regression testing The source of the radare2 regression test suite can be found in the following github repository. @@ -126,13 +403,13 @@ git clone git://github.com/radare/radare2-regressions ``` -See the README.md file in that repository for further information. +See the `README.md` file in that repository for further information. The existing test coverage can always do with improvement, so if you can contribute additions tests that would be gratefully accepted. -REPORTING BUGS --------------- +## Reporting bugs + If you notice any misfeature, issue, error, problem or you just don't know how to do something which is supposed to be covered by this framework. @@ -152,8 +429,8 @@ milestone, etc. it is a good place to start if you are looking to contribute. -CONTRIBUTING WITH PATCHES -------------------------- +## Contributing with patches + All the development happens in the git repository. It is good that all patches can be applied against the `git HEAD`. @@ -162,8 +439,7 @@ git diff > p ``` -HOW TO RELEASE --------------- +## HOW TO RELEASE - Set `RELEASE=1` in global.mk and r2-bindings/config.mk.acr. - Use `bsdtar` from libarchive package. GNU tar is broken. @@ -180,4 +456,6 @@ - `make` - `make dist` + - Update the i[paths on the website](https://github.com/radareorg/radareorg/blob/master/source/download_paths.rst) + --pancake diff -Nru radare2-2.3.0+dfsg/doc/all68k.r2 radare2-2.8.0+dfsg/doc/all68k.r2 --- radare2-2.3.0+dfsg/doc/all68k.r2 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/all68k.r2 2018-08-07 14:12:36.000000000 +0000 @@ -3,7 +3,7 @@ # r2 -qi all68k - > all68k.txt # -e scr.color=false +e scr.color=0 e asm.arch=m68k e asm.nbytes=16 diff -Nru radare2-2.3.0+dfsg/doc/android radare2-2.8.0+dfsg/doc/android --- radare2-2.3.0+dfsg/doc/android 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/android 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +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/radare2 --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|x86 - STATIC_BUILD=0|1 diff -Nru radare2-2.3.0+dfsg/doc/android.md radare2-2.8.0+dfsg/doc/android.md --- radare2-2.3.0+dfsg/doc/android.md 1970-01-01 00:00:00.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/android.md 2018-08-07 14:12:36.000000000 +0000 @@ -0,0 +1,34 @@ +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/radare2 --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|x86 + STATIC_BUILD=0|1 diff -Nru radare2-2.3.0+dfsg/doc/avr radare2-2.8.0+dfsg/doc/avr --- radare2-2.3.0+dfsg/doc/avr 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/avr 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -AVR (arduino, atmega128, ..) -============================ - -Install JTAG serial driver: - - http://www.wch.cn/download/CH341SER_MAC_ZIP.html - -Install SDK from Arduino: - - https://www.arduino.cc/en/Main/Software - echo 'PATH="/Applications/Arduino.app//Contents/Java/hardware/tools/avr/bin/:$PATH"' >> ~/.profile - -Install avarice, the gdbserver <-> jtag: - - r2pm -i avarice - -Run the proxy: - - r2pm -r avarice --jtag /dev/tty.wch* --mkI :4242 - -Using GDB: - - (avr-gdb) target remote :4242 - -In another terminal now run: - - r2 -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 -Nru radare2-2.3.0+dfsg/doc/avr.md radare2-2.8.0+dfsg/doc/avr.md --- radare2-2.3.0+dfsg/doc/avr.md 1970-01-01 00:00:00.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/avr.md 2018-08-07 14:12:36.000000000 +0000 @@ -0,0 +1,30 @@ +AVR (arduino, atmega128, ..) +============================ + +Install JTAG serial driver: + + http://www.wch.cn/download/CH341SER_MAC_ZIP.html + +Install SDK from Arduino: + + https://www.arduino.cc/en/Main/Software + echo 'PATH="/Applications/Arduino.app//Contents/Java/hardware/tools/avr/bin/:$PATH"' >> ~/.profile + +Install avarice, the gdbserver <-> jtag: + + r2pm -i avarice + +Run the proxy: + + r2pm -r avarice --jtag /dev/tty.wch* --mkI :4242 + +Using GDB: + + (avr-gdb) target remote :4242 + +In another terminal now run: + + r2 -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 -Nru radare2-2.3.0+dfsg/doc/brainfuck radare2-2.8.0+dfsg/doc/brainfuck --- radare2-2.3.0+dfsg/doc/brainfuck 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/brainfuck 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -Brainfuck support for r2 -======================== - -Plugins for brainfuck: - - asm.bf - brainfuck assembler and disassembler - - debug.bf - debugger using bfvm - - anal.bf - code analysis for brainfuck - - bp.bf - breakpoints support (experimental) - -To debug a brainfuck program: - -$ r2 -D bf bfdbg:///tmp/bf - -> dc # continue -> x@scr # show screen buffer contents - -The debugger creates virtual sections for code, data, screen and input. - -TODO ----- -- add support for comments, ignore invalid instructions as nops -- enhance io and debugger plugins to generate sections and set arch opts - -Hello World -=========== ->+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.[-] ->++++++++[<++++>-] <.>+++++++++++[<++++++++>-]<-.--------.+++ -.------.--------.[-]>++++++++[<++++>- ]<+.[-]++++++++++. - -$ cat << EOF ->+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.[-]>++++++++[<++++>-] <.>+++++++++++[<++++++++>-]<-.--------.+++.------.--------.[-]>++++++++[<++++>- ]<+.[-]++++++++++. -EOF diff -Nru radare2-2.3.0+dfsg/doc/brainfuck.md radare2-2.8.0+dfsg/doc/brainfuck.md --- radare2-2.3.0+dfsg/doc/brainfuck.md 1970-01-01 00:00:00.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/brainfuck.md 2018-08-07 14:12:36.000000000 +0000 @@ -0,0 +1,37 @@ +Brainfuck support for r2 +======================== + +Plugins for brainfuck: + - `asm.bf` - brainfuck assembler and disassembler + - `debug.bf` - debugger using bfvm + - `anal.bf` - code analysis for brainfuck + - `bp.bf` - breakpoints support (experimental) + +To debug a brainfuck program: + + r2 -D bf bfdbg:///tmp/bf + + > dc # continue + > x@scr # show screen buffer contents + +The debugger creates virtual sections for code, data, screen and input. + +TODO +---- +- add support for comments, ignore invalid instructions as nops +- enhance io and debugger plugins to generate sections and set arch opts + +Hello World +=========== + +``` +>+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.[-] +>++++++++[<++++>-] <.>+++++++++++[<++++++++>-]<-.--------.+++ +.------.--------.[-]>++++++++[<++++>- ]<+.[-]++++++++++. +``` + +``` +$ cat << EOF +>+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.[-]>++++++++[<++++>-] <.>+++++++++++[<++++++++>-]<-.--------.+++.------.--------.[-]>++++++++[<++++>- ]<+.[-]++++++++++. +EOF +``` diff -Nru radare2-2.3.0+dfsg/doc/capstone.md radare2-2.8.0+dfsg/doc/capstone.md --- radare2-2.3.0+dfsg/doc/capstone.md 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/capstone.md 2018-08-07 14:12:36.000000000 +0000 @@ -4,7 +4,7 @@ Capstone Engine is the disassembler engine used by radare2 by default for some architectures. -Radare2 ships its own version of capstone based on the -next branch with +Radare2 ships its own version of capstone based on the -master branch with some minor patches. The problem is that latest release have some compile time dependencies that make compilation with older releases a bit harder. diff -Nru radare2-2.3.0+dfsg/doc/debug radare2-2.8.0+dfsg/doc/debug --- radare2-2.3.0+dfsg/doc/debug 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/debug 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ - 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 -====================================== -1.) ignore breakpoint at address 0x4000ce for five times: - f times=5 - (dec_times,f times=`?vi times-1`,?= times) - db 0x4000ce - dbC 0x4000ce .(dec_times) - dc -2.) execute until rax==0x31c0 at address 0x4000ce - e cmd.hitinfo=0 - (break_rax,f reg_rax=`dr rax`,f test=`?vi reg_rax-0x31c0`,?= test) - db 0x4000ce - dbC 0x4000ce .(break_rax) - dc -3.) perform a register tracing dump at address 0x4000ce - e cmd.hitinfo=0 - (trace_rax,dr rax,?= 1) - db 0x4000ce - dbC 0x4000ce .(trace_rax) - dc > trace.txt diff -Nru radare2-2.3.0+dfsg/doc/debug-internals.md radare2-2.8.0+dfsg/doc/debug-internals.md --- radare2-2.3.0+dfsg/doc/debug-internals.md 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/debug-internals.md 2018-08-07 14:12:36.000000000 +0000 @@ -29,15 +29,15 @@ The functionality lives in the following files: (?? why so many files? can this be simplified??) -libr/reg/arena.c // ?? used by anal and debugger -libr/reg/cond.c // condition registers -libr/reg/double.c // support for double-precision floating point numbers -libr/reg/profile.c // ?? used by anal and debugger -libr/reg/reg.c // top-level register specific code (all of r2) -libr/reg/value.c // dealing with register values -libr/reg/t/p.c // test code for printing general-purpose registers -libr/reg/t/regdiff.c // ?? test code for? -libr/reg/t/test.c // test code for register handling + libr/reg/arena.c // ?? used by anal and debugger + libr/reg/cond.c // condition registers + libr/reg/double.c // support for double-precision floating point numbers + libr/reg/profile.c // ?? used by anal and debugger + libr/reg/reg.c // top-level register specific code (all of r2) + libr/reg/value.c // dealing with register values + libr/reg/t/p.c // test code for printing general-purpose registers + libr/reg/t/regdiff.c // ?? test code for? + libr/reg/t/test.c // test code for register handling ## libr/bp @@ -47,27 +47,27 @@ breakpoints and more. Radare supports a multitude of different types of breakpoints. -(?? is there a list? sw, hw, and trace? anything else??) +(`??` is there a list? sw, hw, and trace? anything else??) -libr/bp/bp.c // main breakpoint management code -libr/bp/io.c // setting and reseting(??) breakpoints -libr/bp/parser.h // header for breakpoint parser (??) -libr/bp/parser.c // code for breakpoint parser (??) -libr/bp/plugin.c // breakpoint plugin management -libr/bp/traptrace.c // traptrace (??) -libr/bp/watch.c // watch points (mostly not implemented) + libr/bp/bp.c // main breakpoint management code + libr/bp/io.c // setting and reseting(??) breakpoints + libr/bp/parser.h // header for breakpoint parser (??) + libr/bp/parser.c // code for breakpoint parser (??) + libr/bp/plugin.c // breakpoint plugin management + libr/bp/traptrace.c // traptrace (??) + libr/bp/watch.c // watch points (mostly not implemented) 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 valid breakpoints for a given architecture. -libr/bp/p/bp_arm.c // ARM64, ARM, Thumb, Thumb-2 (big/little endians) -libr/bp/p/bp_bf.c // Brainfuck! -libr/bp/p/bp_mips.c // MIPS, big/little endian -libr/bp/p/bp_ppc.c // PowerPC, big/little endian -libr/bp/p/bp_sh.c // SuperH -libr/bp/p/bp_x86.c // int3... + libr/bp/p/bp_arm.c // ARM64, ARM, Thumb, Thumb-2 (big/little endians) + libr/bp/p/bp_bf.c // Brainfuck! + libr/bp/p/bp_mips.c // MIPS, big/little endian + libr/bp/p/bp_ppc.c // PowerPC, big/little endian + libr/bp/p/bp_sh.c // SuperH + libr/bp/p/bp_x86.c // int3... ## libr/debug/debug.c @@ -76,17 +76,17 @@ the common code flow and integration into radare while delegating more nuanced system interactions to plug-ins. -libr/debug/arg.c // used by the anal engine (??) -libr/debug/desc.c // code for handling file descriptors inside an inferior -libr/debug/esil.c // ESIL related debugging code (??) -libr/debug/map.c // top-level API for dealing with memory maps -libr/debug/pid.c // top-level API for dealing with processes -libr/debug/plugin.c // top-level debugger plugin API handling -libr/debug/reg.c // top-level code for register r/w and display -libr/debug/signal.c // top-level functions for signals -libr/debug/snap.c // code for saving, restoring, showing memory snapshots -libr/debug/trace.c // top-level tracing API (counting insn hits, etc) -libr/debug/t/main.c // test code for the debugger API + libr/debug/arg.c // used by the anal engine (??) + libr/debug/desc.c // code for handling file descriptors inside an inferior + libr/debug/esil.c // ESIL related debugging code (??) + libr/debug/map.c // top-level API for dealing with memory maps + libr/debug/pid.c // top-level API for dealing with processes + libr/debug/plugin.c // top-level debugger plugin API handling + libr/debug/reg.c // top-level code for register r/w and display + libr/debug/signal.c // top-level functions for signals + libr/debug/snap.c // code for saving, restoring, showing memory snapshots + libr/debug/trace.c // top-level tracing API (counting insn hits, etc) + libr/debug/t/main.c // test code for the debugger API ## libr/core/cmd_debug.c @@ -109,8 +109,8 @@ A debugger plug-in capable of debugging brainfuck code! -libr/debug/p/bfvm.c // Brainfuck VM implementation -libr/debug/p/bfvm.h + libr/debug/p/bfvm.c // Brainfuck VM implementation + libr/debug/p/bfvm.h ### libr/debug/p/debug_bochs.c @@ -137,61 +137,61 @@ shared are implemented by platform-specific functions that are provided in the following files: -// architecture-specific debugger code -libr/debug/p/native/arm.c // unused? - -// code for handling backtracing -libr/debug/p/native/bt.c -libr/debug/p/native/bt/fuzzy-all.c -libr/debug/p/native/bt/generic-x64.c -libr/debug/p/native/bt/generic-x86.c - -// architecture-specific register handling -libr/debug/p/native/drx.c // x86-specific debug registers -libr/debug/p/native/reg.c // cute include of the files below -libr/debug/p/native/reg/kfbsd-x64.h -libr/debug/p/native/reg/kfbsd-x86.h -libr/debug/p/native/reg/netbsd-x64.h -libr/debug/p/native/reg/netbsd-x86.h -libr/debug/p/native/reg/windows-x64.h -libr/debug/p/native/reg/windows-x86.h - -// platform-specific debugger code on Linux -libr/debug/p/native/linux/linux_debug.c // main linux-specific debugging code -libr/debug/p/native/linux/linux_debug.h // including cute penguin ascii art - -// architecture-specific register handling on Linux (?? what is this format??) -libr/debug/p/native/linux/reg/linux-arm.h -libr/debug/p/native/linux/reg/linux-arm64.h -libr/debug/p/native/linux/reg/linux-mips.h -libr/debug/p/native/linux/reg/linux-ppc.h -libr/debug/p/native/linux/reg/linux-x64.h -libr/debug/p/native/linux/reg/linux-x64-32.h -libr/debug/p/native/linux/reg/linux-x86.h - -// platform-specific debugger code on Windows -libr/debug/p/native/w32.c // main code for win32 debugger plugin -libr/debug/p/native/maps/windows.c // platform-specific memory map handling -libr/debug/p/native/windows/windows_debug.c // !! nothing in here -libr/debug/p/native/windows/windows_debug.h // !! nothing in here - -// platform-specific debugger code on XNU (OSX/iOS/etc) -libr/debug/p/native/darwin.c // !! not used by anything else -libr/debug/p/native/maps/darwin.c // platform-specific memory map handling -libr/debug/p/native/xnu/xnu_debug.c // main XNU-specific debugging code -libr/debug/p/native/xnu/xnu_debug.h // including cute apple ascii art -libr/debug/p/native/xnu/trap_arm.c // ARM family hardware bps (??) -libr/debug/p/native/xnu/trap_x86.c // x86 family hardware bps (??) -libr/debug/p/native/xnu/xnu_excthreads.c // additional XNU thread handling -libr/debug/p/native/xnu/xnu_threads.c // XNU thread and register handling -libr/debug/p/native/xnu/xnu_threads.h - -// architecture-specific register handling on XNU (?? what is this format??) -libr/debug/p/native/xnu/reg/darwin-x86.h -libr/debug/p/native/xnu/reg/darwin-arm.h -libr/debug/p/native/xnu/reg/darwin-ppc.h -libr/debug/p/native/xnu/reg/darwin-arm64.h -libr/debug/p/native/xnu/reg/darwin-x64.h + // architecture-specific debugger code + libr/debug/p/native/arm.c // unused? + + // code for handling backtracing + libr/debug/p/native/bt.c + libr/debug/p/native/bt/fuzzy-all.c + libr/debug/p/native/bt/generic-x64.c + libr/debug/p/native/bt/generic-x86.c + + // architecture-specific register handling + libr/debug/p/native/drx.c // x86-specific debug registers + libr/debug/p/native/reg.c // cute include of the files below + libr/debug/p/native/reg/kfbsd-x64.h + libr/debug/p/native/reg/kfbsd-x86.h + libr/debug/p/native/reg/netbsd-x64.h + libr/debug/p/native/reg/netbsd-x86.h + libr/debug/p/native/reg/windows-x64.h + libr/debug/p/native/reg/windows-x86.h + + // platform-specific debugger code on Linux + libr/debug/p/native/linux/linux_debug.c // main linux-specific debugging code + libr/debug/p/native/linux/linux_debug.h // including cute penguin ascii art + + // architecture-specific register handling on Linux (?? what is this format??) + libr/debug/p/native/linux/reg/linux-arm.h + libr/debug/p/native/linux/reg/linux-arm64.h + libr/debug/p/native/linux/reg/linux-mips.h + libr/debug/p/native/linux/reg/linux-ppc.h + libr/debug/p/native/linux/reg/linux-x64.h + libr/debug/p/native/linux/reg/linux-x64-32.h + libr/debug/p/native/linux/reg/linux-x86.h + + // platform-specific debugger code on Windows + libr/debug/p/native/w32.c // main code for win32 debugger plugin + libr/debug/p/native/maps/windows.c // platform-specific memory map handling + libr/debug/p/native/windows/windows_debug.c // !! nothing in here + libr/debug/p/native/windows/windows_debug.h // !! nothing in here + + // platform-specific debugger code on XNU (OSX/iOS/etc) + libr/debug/p/native/darwin.c // !! not used by anything else + libr/debug/p/native/maps/darwin.c // platform-specific memory map handling + libr/debug/p/native/xnu/xnu_debug.c // main XNU-specific debugging code + libr/debug/p/native/xnu/xnu_debug.h // including cute apple ascii art + libr/debug/p/native/xnu/trap_arm.c // ARM family hardware bps (??) + libr/debug/p/native/xnu/trap_x86.c // x86 family hardware bps (??) + libr/debug/p/native/xnu/xnu_excthreads.c // additional XNU thread handling + libr/debug/p/native/xnu/xnu_threads.c // XNU thread and register handling + libr/debug/p/native/xnu/xnu_threads.h + + // architecture-specific register handling on XNU (?? what is this format??) + libr/debug/p/native/xnu/reg/darwin-x86.h + libr/debug/p/native/xnu/reg/darwin-arm.h + libr/debug/p/native/xnu/reg/darwin-ppc.h + libr/debug/p/native/xnu/reg/darwin-arm64.h + libr/debug/p/native/xnu/reg/darwin-x64.h ### libr/debug/p/debug_qnx.c diff -Nru radare2-2.3.0+dfsg/doc/debug.md radare2-2.8.0+dfsg/doc/debug.md --- radare2-2.3.0+dfsg/doc/debug.md 1970-01-01 00:00:00.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/debug.md 2018-08-07 14:12:36.000000000 +0000 @@ -0,0 +1,34 @@ + 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 +====================================== + +1. ignore breakpoint at address `0x4000ce` for five times: + + f times=5 + (dec_times,f times=`?vi times-1`,?= times) + db 0x4000ce + dbC 0x4000ce .(dec_times) + dc + +2. execute until rax==0x31c0 at address `0x4000ce` + + e cmd.hitinfo=0 + (break_rax,f reg_rax=`dr rax`,f test=`?vi reg_rax-0x31c0`,?= test) + db 0x4000ce + dbC 0x4000ce .(break_rax) + dc + +3. perform a register tracing dump at address `0x4000ce` + + e cmd.hitinfo=0 + (trace_rax,dr rax,?= 1) + db 0x4000ce + dbC 0x4000ce .(trace_rax) + dc > trace.txt diff -Nru radare2-2.3.0+dfsg/doc/emscripten radare2-2.8.0+dfsg/doc/emscripten --- radare2-2.3.0+dfsg/doc/emscripten 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/emscripten 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +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 - - - ---- random notes --- - -export CC="emcc --ignore-dynamic-linking" -./configure --prefix=/usr --disable-shared --enable-static --disable-debugger --with-compiler=emscripten --without-pic --with-nonpic -emmake make -j4 - -cd binr/radare2 - emcc ../../libr/*/*.o radare2.c -I ../../libr/include/ -DR2_BIRTH=\"pop\" -DR2_GITTIP=\"123\" ../../libr/db/sdb/src/*.o - -binr/rax2/rax2.js: - -emcc -O2 rax2.o ../../libr/util/libr_util.a -o rax2.js - -binr/rasm2/rasm2.js: - -emcc -O2 -L.. -o rasm2.js ../../shlr/sdb/src/libsdb.a ../../libr/fs/p/grub/libgrubfs.a -lm $A/util/libr_util.a $A/asm/libr_asm.a rasm2.o ../../libr/util/libr_util.a ../../libr/parse/libr_parse.a ../../libr/db/libr_db.a ../../libr/syscall/libr_syscall.a ../../libr/asm/libr_asm.a ../../libr/lib/libr_lib.a ../../libr/db/libr_db.a ../../shlr/sdb/src/libsdb.a ../../libr/util/libr_util.a diff -Nru radare2-2.3.0+dfsg/doc/emscripten.md radare2-2.8.0+dfsg/doc/emscripten.md --- radare2-2.3.0+dfsg/doc/emscripten.md 1970-01-01 00:00:00.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/emscripten.md 2018-08-07 14:12:36.000000000 +0000 @@ -0,0 +1,35 @@ +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 -Nru radare2-2.3.0+dfsg/doc/esil radare2-2.8.0+dfsg/doc/esil --- radare2-2.3.0+dfsg/doc/esil 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/esil 1970-01-01 00:00:00.000000000 +0000 @@ -1,287 +0,0 @@ -ESIL -==== - -# source https://github.com/radare/radare2/wiki/ESIL - -ESIL stands for 'Evaluable Strings Intermedate Language'. It aims to describe a Forth-like representation for every opcode. Those representations can be evaluated in order to emulate code. Each element of an esil expression is separated by a comma. The VM can be described as this: -``` - while ((word=haveCommand())) { - if (word.isKeyword()) { - esilCommands[word](esil); - } else { - esil.push (evaluateToNumber(word)); - } - nextCommand(); - } -``` -The esil commands are operations that pop values from the stack, performs some calculations and pushes the result in the stack (if any). They aim to cover all common operations done by CPUs, permitting to do binary operations, memory peeks and pokes, spawning a syscall, etc. - -#### Use ESIL -``` -[0x00000000]> e asm.esil = true -``` - -Syntax -====== -An opcode is translated into a comma separated list of ESIL expressions. -``` -xor eax, eax -> 0,eax,=,1,zf,= -``` -Memory access is defined by brackets. -``` -mov eax, [0x80480] -> 0x80480,[],eax,= -``` -Default size is the destination of the operation. In this case 8bits, aka 1 byte. -``` -movb $0, 0x80480 -> 0,0x80480,=[1] -``` -Conditionals are expressed with the '?' char at the beginning of the expression. This checks if the rest of the expression is 0 or not and skips the next expression if doesn't matches. % is the prefix for internal vars. -``` -cmp eax, 123 -> 123,eax,==,%z,zf,= -jz eax -> zf,?{,eax,eip,=,} -``` -So.. if you want to run more than one expression under a conditional, you'll have to write it -``` -zf,?{,eip,esp,=[],eax,eip,=,%r,esp,-=,} -``` - -The whitespace, newlines and other chars are ignored in esil, so the first thing to do is: -``` -esil = r_str_replace (esil, " ", "", true); -``` -Syscalls are specially handled by '$' at the beginning of the expression. After that char you have an optional numeric value that specifies the number of syscall. The emulator must handle those expressions and 'simulate' the syscalls. (r_esil_syscall) - -Order of arguments -================== -As discussed on irc, current implementation works like this: - -``` -a,b,- b - a -a,b,/= b /= a -``` -This approach is more readable, but it's less stack-friendly - -Special instructions -==================== -NOPs are represented as empty strings. Unknown or invalid instructions - -Syscalls are implemented with the '0x80,$' command. It delegates the execution of the esil vm into a callback that implements the syscall for a specific kernel. - -Traps are implemented with the `,,$$` command. They are used to throw exceptions like invalid instructions, division by zero, memory read error, etc. - -Quick analysis -============== -Here's a list of some quick checks to retrieve information from an esil string. Relevant information will be probably found in the first expression of the list. -``` -indexOf('[') -> have memory references -indexOf("=[") -> write in memory -indexOf("pc,=") -> modifies program counter (branch, jump, call) -indexOf("sp,=") -> modifies the stack (what if we found sp+= or sp-=?) -indexOf("=") -> retrieve src and dst -indexOf(":") -> unknown esil, raw opcode ahead -indexOf("%") -> accesses internal esil vm flags -indexOf("$") -> syscall -indexOf("$$") -> can trap -indexOf('++') -> has iterator -indexOf('--') -> count to zero -indexOf("?{") -> conditional -indexOf("LOOP") -> is a loop (rep?) -equalsTo("") -> empty string, means: nop (wrong, if we append pc+=x) -``` - -Common operations: - * Check dstreg - * Check srcreg - * Get destinaion - * Is jump - * Is conditional - * Evulate - * Is syscall - -CPU Flags -========= -CPU flags are usually defined as 1 bit registers in the RReg profile. and sometimes under the 'flg' register type. - -ESIL Flags -========== -ESIL VM have an internal state flags that can are read only and can be used to export those values to the underlaying CPU flags. This is because the ESIL vm defines all the flag changes, while the CPUs only update the flags under certain conditions or specific instructions. - -Those internal flags are prefixed by the '%' character. - -``` -z - zero flag, only set if the result of an operation is 0 -b - borrow, this requires to specify from which bit (example: %b4 - checks if borrow from bit 4) -c - carry, same like above (example: %c7 - checks if carry from bit 7) -p - parity -r - regsize ( asm.bits/8 ) -``` - -Variables -========= -1. No predefined bitness (should be easy to extend them to 128,256 and 512bits, e.g. for MMX, SSE, AVX, Neon) -2. Infinite number (for SSA-form compatibility) -3. Register names have no specific syntax. They are just strings -4. Numbers can be specified in any base supported by RNum (dec, hex, oct, binary ...) -5. Each ESIL backend should have an associated RReg profile to describe the esil register specs - -Bitarrays -========= -What to do with them? What about bit arithmetics if use variables instead of registers? - -Arithmetics -=========== -1. ADD ("+") -2. MUL ("*") -3. SUB ("-") -4. DIV ("/") -5. MOD ("%") - - -Bit arithmetics -=============== -1. AND "&" -2. OR "|" -3. XOR "^" -4. SHL "<<" -5. SHR ">>" -6. ROL "<<<" -7. ROR ">>>" -8. NEG "!" - -Floating point -============== - -_TODO_ - -The x86 REP prefix in ESIL -========================== -ESIL specifies that the parsing control-flow commands are in uppercase. Bear in mind that some archs have uppercase register names. The register profile should take care to not reuse any of the following: -``` -3,SKIP - skip N instructions. used to make relative forward GOTOs -3,GOTO - goto instruction 3 -LOOP - alias for 0,GOTO -BREAK - stop evaluating the expression -STACK - dump stack contents to screen -CLEAR - clear stack -``` - - -Usage example: - -rep cmpsb ---------- -cx,!,?{,BREAK,},esi,[1],edi,[1],==,?{,BREAK,},esi,++,edi,++,cx,--,LOOP - - -Unimplemented/unhandled instructions -==================================== -Those are expressed with the 'TODO' command. which acts as a 'BREAK', but displaying a warning message describing which instruction is not implemented and will not be emulated. - -For example: -``` -fmulp ST(1), ST(0) => TODO,fmulp ST(1),ST(0) -``` - -Disassembly example: -==================== -``` -[0x1000010f8]> e asm.esil=true -[0x1000010f8]> pd $r @ entry0 - ; [0] va=0x1000010f8 pa=0x000010f8 sz=13299 vsz=13299 rwx=-r-x 0.__text - ;-- section.0.__text: - 0x1000010f8 55 8,rsp,-=,rbp,rsp,=[8] - 0x1000010f9 4889e5 rsp,rbp,= - 0x1000010fc 4883c768 104,rdi,+= - 0x100001100 4883c668 104,rsi,+= - 0x100001104 5d rsp,[8],rbp,=,8,rsp,+= ┌─< 0x100001105 e950350000 0x465a,rip,= ;[1] - │ 0x10000110a 55 8,rsp,-=,rbp,rsp,=[8] - │ 0x10000110b 4889e5 rsp,rbp,= │ 0x10000110e 488d4668 rsi,104,+,rax,= - │ 0x100001112 488d7768 rdi,104,+,rsi,= - │ 0x100001116 4889c7 rax,rdi,= - │ 0x100001119 5d rsp,[8],rbp,=,8,rsp,+= ┌──< 0x10000111a e93b350000 0x465a,rip,= ;[1] - ││ 0x10000111f 55 8,rsp,-=,rbp,rsp,=[8] - ││ 0x100001120 4889e5 rsp,rbp,= - ││ 0x100001123 488b4f60 rdi,96,+,[8],rcx,= - ││ 0x100001127 4c8b4130 rcx,48,+,[8],r8,= ││ 0x10000112b 488b5660 rsi,96,+,[8],rdx,= - ││ 0x10000112f b801000000 1,eax,= ; 0x00000001 - ││ 0x100001134 4c394230 rdx,48,+,[8],r8,==,cz,?= - ┌───< 0x100001138 7f1a sf,of,!,^,zf,!,&,?{,0x1154,rip,=,} ;[2] - ┌────< 0x10000113a 7d07 of,!,sf,^,?{,0x1143,rip,} ;[3] - ││││ 0x10000113c b8ffffffff 0xffffffff,eax,= ; 0xffffffff ┌─────< 0x100001141 eb11 0x1154,rip,= ;[2] - │└────> 0x100001143 488b4938 rcx,56,+,[8],rcx,= - │ │││ 0x100001147 48394a38 rdx,56,+,[8],rcx,==,cz,?= -``` - -Radare anal ESIL code example -============================== - -As an example implementation of ESIL analysis for the AVR family of microcontrollers there is -a `avr_op` function in `/libr/anal/p/anal_avr.c` which contains information on how the -instructions are expressed in ESIL and other opcode information such as cycle counts per instruction: - -static int avr_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *buf, int len) { - short ofst; - int d, r, k; - (...) - -Variables d, r and k refer to "destination", "register" and "(k)onstant", respectively. They -are used later on by ESIL string formatting function like for instance: - - r_strbuf_setf (&op->esil, "0x%x,r%d,=", k, d); - -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: - -│ 0x00000080 30e0 0x0,r19,= ; LDI Rd,K. load immediate - -Or in non-ESIL format: - -│ 0x00000080 30e0 ldi r19, 0x00 ; LDI Rd,K. load immediate - - -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. - - -Introspection -============= -To ease esil parsing we should have a way to express introspection expressions to extract the data we want. For example. We want to get the target address of a jmp. - -The parser for the esil expressions should be implemented in an API to make it possible to extract information by analyzing the expressions easily. - -``` -> ao~esil,opcode -opcode: jmp 0x10000465a -esil: 0x10000465a,rip,= -``` -We need a way to retrieve the numeric value of 'rip'. This is a very simple example, but there will be more complex, like conditional ones and we need expressions to get: - -- opcode type -- destination of jump -- condition depends on -- all regs modified (write) -- all regs accessed (read) - -API HOOKS -========= - -It is important for emulation to be able to setup hooks in the parser, so we can extend the parser to implement the analysis without having to write the parser again and again. This is, every time an operation is going to be executed we call a user hook which can be used to determine if rip is changing or if the instruction updates the stack. -Later, at this level we can split that callback into several ones to have an event based analysis api that may be extended in js like this: -esil.on('regset', function(){.. -esil.on('syscall', function(){esil.regset('rip' - -we have already them. see hook_flag_read() hook_execute() hook_mem_read() ... - -return true if you want to override the action taken for a callback. for example. avoid mem reads in a region or mem writes to make all memory read only. - -return false or 0 if you want to trace esil expression parsing. aka emulation -.. - -Other operations that require bindings to external functionalities to work. In this case r_ref and r_io. This must be defined when initializing the esil vm. - -* Io Get/Set - Out ax, 44 - 44,ax,:ou -* Selectors (cs,ds,gs...) - Mov eax, ds:[ebp+8] - Ebp,8,+,:ds,eax,= diff -Nru radare2-2.3.0+dfsg/doc/esil.md radare2-2.8.0+dfsg/doc/esil.md --- radare2-2.3.0+dfsg/doc/esil.md 1970-01-01 00:00:00.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/esil.md 2018-08-07 14:12:36.000000000 +0000 @@ -0,0 +1,331 @@ +ESIL +==== + +# source https://github.com/radare/radare2/wiki/ESIL + +ESIL stands for 'Evaluable Strings Intermedate Language'. It aims to describe a +Forth-like representation for every opcode. Those representations can be +evaluated in order to emulate code. Each element of an esil expression is +separated by a comma. The VM can be described as this: + + while ((word=haveCommand())) { + if (word.isKeyword()) { + esilCommands[word](esil); + } else { + esil.push (evaluateToNumber(word)); + } + nextCommand(); + } + +The esil commands are operations that pop values from the stack, performs some +calculations and pushes the result in the stack (if any). They aim to cover all +common operations done by CPUs, permitting to do binary operations, memory +peeks and pokes, spawning a syscall, etc. + +#### Use ESIL + + [0x00000000]> e asm.esil = true + +Syntax +====== +An opcode is translated into a comma separated list of ESIL expressions. + + xor eax, eax -> 0,eax,=,1,zf,= + +Memory access is defined by brackets. + + mov eax, [0x80480] -> 0x80480,[],eax,= + +Default size is the destination of the operation. In this case 8bits, aka 1 byte. + + movb $0, 0x80480 -> 0,0x80480,=[1] + +Conditionals are expressed with the '?' char at the beginning of the expression. This checks if the rest of the expression is 0 or not and skips the next expression if doesn't matches. `$` is the prefix for internal vars. + + cmp eax, 123 -> 123,eax,==,$z,zf,= + jz eax -> zf,?{,eax,eip,=,} + +So.. if you want to run more than one expression under a conditional, you'll have to write it + + zf,?{,eip,esp,=[],eax,eip,=,$r,esp,-=,} + + +The whitespace, newlines and other chars are ignored in esil, so the first thing to do is: + + esil = r_str_replace (esil, " ", "", true); + +Syscalls are specially handled by '$' at the beginning of the expression. After that char you have an optional numeric value that specifies the number of syscall. The emulator must handle those expressions and 'simulate' the syscalls. (`r_esil_syscall`) + +Order of arguments +================== +As discussed on irc, current implementation works like this: + + a,b,- b - a + a,b,/= b /= a + +This approach is more readable, but it's less stack-friendly + +Special instructions +==================== + +NOPs are represented as empty strings. Unknown or invalid instructions + +Syscalls are implemented with the '0x80,$' command. It delegates the execution +of the esil vm into a callback that implements the syscall for a specific +kernel. + +Traps are implemented with the `,,$$` command. They are used to +throw exceptions like invalid instructions, division by zero, memory read +error, etc. + +Quick analysis +============== + +Here's a list of some quick checks to retrieve information from an esil string. +Relevant information will be probably found in the first expression of the +list. + + indexOf('[') -> have memory references + indexOf("=[") -> write in memory + indexOf("pc,=") -> modifies program counter (branch, jump, call) + indexOf("sp,=") -> modifies the stack (what if we found sp+= or sp-=?) + indexOf("=") -> retrieve src and dst + indexOf(":") -> unknown esil, raw opcode ahead + indexOf("$") -> accesses internal esil vm flags + indexOf("$") -> syscall + indexOf("$$") -> can trap + indexOf('++') -> has iterator + indexOf('--') -> count to zero + indexOf("?{") -> conditional + indexOf("LOOP") -> is a loop (rep?) + equalsTo("") -> empty string, means: nop (wrong, if we append pc+=x) + +Common operations: + + * Check dstreg + * Check srcreg + * Get destinaion + * Is jump + * Is conditional + * Evulate + * Is syscall + +CPU Flags +========= + +CPU flags are usually defined as 1 bit registers in the RReg profile. and sometimes under the 'flg' register type. + +ESIL Flags +========== + +ESIL VM have an internal state flags that can are read only and can be used to +export those values to the underlaying CPU flags. This is because the ESIL vm +defines all the flag changes, while the CPUs only update the flags under +certain conditions or specific instructions. + +Those internal flags are prefixed by the '$' character. + +``` +z - zero flag, only set if the result of an operation is 0 +b - borrow, this requires to specify from which bit (example: $b4 - checks if borrow from bit 4) +c - carry, same like above (example: $c7 - checks if carry from bit 7) +p - parity +r - regsize ( asm.bits/8 ) +``` + +Variables +========= + +1. No predefined bitness (should be easy to extend them to 128,256 and 512bits, e.g. for MMX, SSE, AVX, Neon) +2. Infinite number (for SSA-form compatibility) +3. Register names have no specific syntax. They are just strings +4. Numbers can be specified in any base supported by RNum (dec, hex, oct, binary ...) +5. Each ESIL backend should have an associated RReg profile to describe the esil register specs + +Bitarrays +========= +What to do with them? What about bit arithmetics if use variables instead of registers? + +Arithmetics +=========== +1. ADD ("+") +2. MUL ("*") +3. SUB ("-") +4. DIV ("/") +5. MOD ("%") + + +Bit arithmetics +=============== +1. AND "&" +2. OR "|" +3. XOR "^" +4. SHL "<<" +5. SHR ">>" +6. ROL "<<<" +7. ROR ">>>" +8. NEG "!" + +Floating point +============== + +_TODO_ + +The x86 REP prefix in ESIL +========================== + +ESIL specifies that the parsing control-flow commands are in uppercase. Bear in +mind that some archs have uppercase register names. The register profile should +take care to not reuse any of the following: + + 3,SKIP - skip N instructions. used to make relative forward GOTOs + 3,GOTO - goto instruction 3 + LOOP - alias for 0,GOTO + BREAK - stop evaluating the expression + STACK - dump stack contents to screen + CLEAR - clear stack + + +Usage example: + +rep cmpsb +--------- + + cx,!,?{,BREAK,},esi,[1],edi,[1],==,?{,BREAK,},esi,++,edi,++,cx,--,LOOP + + +Unimplemented/unhandled instructions +==================================== + +Those are expressed with the 'TODO' command. which acts as a 'BREAK', but +displaying a warning message describing which instruction is not implemented +and will not be emulated. + +For example: + + fmulp ST(1), ST(0) => TODO,fmulp ST(1),ST(0) + +Disassembly example: +==================== + +``` +[0x1000010f8]> e asm.esil=true +[0x1000010f8]> pd $r @ entry0 + ; [0] va=0x1000010f8 pa=0x000010f8 sz=13299 vsz=13299 rwx=-r-x 0.__text + ;-- section.0.__text: + 0x1000010f8 55 8,rsp,-=,rbp,rsp,=[8] + 0x1000010f9 4889e5 rsp,rbp,= + 0x1000010fc 4883c768 104,rdi,+= + 0x100001100 4883c668 104,rsi,+= + 0x100001104 5d rsp,[8],rbp,=,8,rsp,+= ┌─< 0x100001105 e950350000 0x465a,rip,= ;[1] + │ 0x10000110a 55 8,rsp,-=,rbp,rsp,=[8] + │ 0x10000110b 4889e5 rsp,rbp,= │ 0x10000110e 488d4668 rsi,104,+,rax,= + │ 0x100001112 488d7768 rdi,104,+,rsi,= + │ 0x100001116 4889c7 rax,rdi,= + │ 0x100001119 5d rsp,[8],rbp,=,8,rsp,+= ┌──< 0x10000111a e93b350000 0x465a,rip,= ;[1] + ││ 0x10000111f 55 8,rsp,-=,rbp,rsp,=[8] + ││ 0x100001120 4889e5 rsp,rbp,= + ││ 0x100001123 488b4f60 rdi,96,+,[8],rcx,= + ││ 0x100001127 4c8b4130 rcx,48,+,[8],r8,= ││ 0x10000112b 488b5660 rsi,96,+,[8],rdx,= + ││ 0x10000112f b801000000 1,eax,= ; 0x00000001 + ││ 0x100001134 4c394230 rdx,48,+,[8],r8,==,cz,?= + ┌───< 0x100001138 7f1a sf,of,!,^,zf,!,&,?{,0x1154,rip,=,} ;[2] + ┌────< 0x10000113a 7d07 of,!,sf,^,?{,0x1143,rip,} ;[3] + ││││ 0x10000113c b8ffffffff 0xffffffff,eax,= ; 0xffffffff ┌─────< 0x100001141 eb11 0x1154,rip,= ;[2] + │└────> 0x100001143 488b4938 rcx,56,+,[8],rcx,= + │ │││ 0x100001147 48394a38 rdx,56,+,[8],rcx,==,cz,?= +``` + +Radare anal ESIL code example +============================== + +As an example implementation of ESIL analysis for the AVR family of +microcontrollers there is a `avr_op` function in `/libr/anal/p/anal_avr.c` +which contains information on how the instructions are expressed in ESIL and +other opcode information such as cycle counts per instruction: + +```` +static int avr_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *buf, int len) { + short ofst; + int d, r, k; + (...) +```` + +Variables d, r and k refer to "destination", "register" and "(k)onstant", respectively. They +are used later on by ESIL string formatting function like for instance: + + r_strbuf_setf (&op->esil, "0x%x,r%d,=", k, d); + +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: + + 0x00000080 30e0 0x0,r19,= ; LDI Rd,K. load immediate + +Or in non-ESIL format: + + 0x00000080 30e0 ldi r19, 0x00 ; LDI Rd,K. load immediate + + +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. + + +Introspection +============= + +To ease esil parsing we should have a way to express introspection expressions +to extract the data we want. For example. We want to get the target address of +a jmp. + +The parser for the esil expressions should be implemented in an API to make it +possible to extract information by analyzing the expressions easily. + + > ao~esil,opcode + opcode: jmp 0x10000465a + esil: 0x10000465a,rip,= + +We need a way to retrieve the numeric value of 'rip'. This is a very simple +example, but there will be more complex, like conditional ones and we need +expressions to get: + +- opcode type +- destination of jump +- condition depends on +- all regs modified (write) +- all regs accessed (read) + +API HOOKS +========= + +It is important for emulation to be able to setup hooks in the parser, so we +can extend the parser to implement the analysis without having to write the +parser again and again. This is, every time an operation is going to be +executed we call a user hook which can be used to determine if rip is changing +or if the instruction updates the stack. + +Later, at this level we can split that callback into several ones to have an +event based analysis api that may be extended in js like this: + + esil.on('regset', function(){.. + esil.on('syscall', function(){esil.regset('rip' + +we have already them. see `hook_flag_read()` `hook_execute()` `hook_mem_read()` ... + +* return true if you want to override the action taken for a callback. for + example. avoid mem reads in a region or mem writes to make all memory read + only. +* return false or 0 if you want to trace esil expression parsing. aka emulation .. + +Other operations that require bindings to external functionalities to work. In +this case `r_ref` and `r_io`. This must be defined when initializing the esil vm. + +* Io Get/Set + + Out ax, 44 + 44,ax,:ou + +* Selectors (cs,ds,gs...) + + Mov eax, ds:[ebp+8] + Ebp,8,+,:ds,eax,= diff -Nru radare2-2.3.0+dfsg/doc/flirt radare2-2.8.0+dfsg/doc/flirt --- radare2-2.3.0+dfsg/doc/flirt 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/flirt 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -FLIRT -===== -At the moment of writing r2 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 -own signature format which can be used to generate signatures and -find them. - -This document will focus on FLIRT, not the native r2 '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 -it is not possible to redistribute the .pat or the .sig files. It -doesn't seems to have watermarks. However it's a bit unclear what -licence the file generated should have. Mentioning the files should -be free of copyrighted material (the original libs bytes). That said, -there's a paragraph in the flirt paper: - - https://www.hex-rays.com/products/ida/tech/flirt/in_depth.shtml - - -Create the .pat file --------------------- - - cd flair/bin/linux - ./pelf -p64 /usr/lib/x86_64-linux-gnu/libc.a libc.pat - -Create the .sig file (possible collisions): --------------------- - - ./sigmake -n libc.pat libc.sig - -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. - -Using it with r2: ------------------ - - $ r2 -c 'zF libc.sig' staticbin - -PROFIT. - -refs: - flair/sigmake.txt - flair/pat.txt - diff -Nru radare2-2.3.0+dfsg/doc/flirt.md radare2-2.8.0+dfsg/doc/flirt.md --- radare2-2.3.0+dfsg/doc/flirt.md 1970-01-01 00:00:00.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/flirt.md 2018-08-07 14:12:36.000000000 +0000 @@ -0,0 +1,47 @@ +FLIRT +===== + +At the moment of writing r2 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 +own signature format which can be used to generate signatures and +find them. + +This document will focus on FLIRT, not the native r2 '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 +it is not possible to redistribute the .pat or the .sig files. It +doesn't seems to have watermarks. However it's a bit unclear what +licence the file generated should have. Mentioning the files should +be free of copyrighted material (the original libs bytes). That said, +there's a paragraph in [IDA F.L.I.R.T. Technology: In-Depth](https://www.hex-rays.com/products/ida/tech/flirt/in_depth.shtml) + + +Create the .pat file +-------------------- + + cd flair/bin/linux + ./pelf -p64 /usr/lib/x86_64-linux-gnu/libc.a libc.pat + +Create the .sig file (possible collisions): +-------------------- + + ./sigmake -n libc.pat libc.sig + +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. + +Using it with r2: +----------------- + + r2 -c 'zF libc.sig' staticbin + +refs: + +* flair/sigmake.txt +* flair/pat.txt + diff -Nru radare2-2.3.0+dfsg/doc/fortunes.creepy radare2-2.8.0+dfsg/doc/fortunes.creepy --- radare2-2.3.0+dfsg/doc/fortunes.creepy 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/fortunes.creepy 2018-08-07 14:12:36.000000000 +0000 @@ -36,3 +36,4 @@ This is what I hate most about guys like you. You didn't even try. Touch your monitor. It is warm like flesh. But it is not flesh. Yet. Look at you, hacker, a pathetic creature of meat and bone. +Nobody can hear your calls for help diff -Nru radare2-2.3.0+dfsg/doc/fortunes.fun radare2-2.8.0+dfsg/doc/fortunes.fun --- radare2-2.3.0+dfsg/doc/fortunes.fun 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/fortunes.fun 2018-08-07 14:12:36.000000000 +0000 @@ -233,3 +233,21 @@ Coffee time! Can you you challenge a perfect immortal machine? Add more blockchains to your life. +Congratulations! You got the segfault 1.000.000! Click [here] to win a prize! +Well, it looks like it's working. +There's more than one way to skin a cat +git pull now +git checkout hamster +Noot noot +This is an unregistered copy. +10 reasons you want to bt on all threads - you will be shocked by number 3! +Place a cat on your keyboard while running r2, you'll not believe what will happen next +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 ] +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] +r2OS r2pad 0.1 SMP GENERIC r2_64 GNU/r2OS +AHHHHH!!!! ASSEMBLY CODE!!!!!! HOLD ME I'M SCARED!!!!!!!!!! diff -Nru radare2-2.3.0+dfsg/doc/fortunes.tips radare2-2.8.0+dfsg/doc/fortunes.tips --- radare2-2.3.0+dfsg/doc/fortunes.tips 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/fortunes.tips 2018-08-07 14:12:36.000000000 +0000 @@ -28,7 +28,7 @@ Assemble opcodes with the 'a' and 'A' keys in visual mode, which are bindings to the 'wa' and 'wA' commands Find expanded AES keys in memory with '/Ca' Find wide-char strings with the '/w ' command -Enable ascii-art jump lines in disassembly by setting 'e asm.lines=true'. asm.linesout and asm.linestyle may interest you as well +Enable ascii-art jump lines in disassembly by setting 'e asm.lines=true'. asm.lines.out and asm.linestyle may interest you as well Control the signal handlers of the child process with the 'dk' command Get a free shell with 'ragg2 -i exec -x' Interpret radare2 scripts with '. '. Similar to the bash source alias command. @@ -38,9 +38,9 @@ Use hasher to calculate hashes of portion blocks of a file Use zoom.byte=entropy and press 'z' in visual mode to zoom out to see the entropy of the whole file Use 'zoom.byte=printable' in zoom mode ('z' in Visual mode) to find strings -Set color to your screen with 'e scr.color=true' +Add colors to your screen with 'e scr.color=X' where 1 is 16 colors, 2 is 256 colors and 3 is 16M colors Trace register changes while debugging with 'e trace.cmtregs=true' -Move the comments to the right changing their margin with asm.cmtmargin +Move the comments to the right changing their margin with asm.cmt.margin Execute a command on the visual prompt with cmd.vprompt Reduce the delta where flag resolving by address is used with cfg.delta Disable these messages with 'e cfg.fortunes = false' in your ~/.radare2rc @@ -86,3 +86,4 @@ The more 'a' you add after 'aa' the more analysis steps are executed. Review all the subcommands of aa to see better ways to analyze your targets. Use /m to carve for known magic headers. speedup with search. +You can use registers in math expressions. For example: 'wx 1234 @ esp - 2' diff -Nru radare2-2.3.0+dfsg/doc/freebsd.md radare2-2.8.0+dfsg/doc/freebsd.md --- radare2-2.3.0+dfsg/doc/freebsd.md 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/freebsd.md 2018-08-07 14:12:36.000000000 +0000 @@ -1,42 +1,42 @@ FreeBSD build instructions ========================== -FreeBSD, as well as other BSD systems have some differences in the way commands are named and packages installed. This document aims to explain the steps needed to build r2 and r2b-python on FreeBSD. +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 -* gcc is named cc and g++ is c++ +* clang (or gcc) is named cc and clang++ (or g++) is c++ * valabind is not packaged in the ports Radare2 Dependencies: --------------------- - # pkg install git gcc gmake patch pkgconf + sudo pkg install git gcc gmake patch pkgconf - $ git clone https://github.com/radare/radare2 - $ cd radare2 - $ sys/install.sh /usr/local + git clone https://github.com/radare/radare2 + cd radare2 + sys/install.sh /usr/local Python Swig Bindings Dependencies: ---------------------------------- - # pkg install swig30 pkgconf vala + sudo pkg install swig30 pkgconf vala - $ git clone https://github.com/radare/valabind - $ cd valabind - $ gmake - $ sudo gmake install PREFIX=/usr/local + 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/radare/radare2-bindings - $ cd radare2-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 + git clone https://github.com/radare/radare2-bindings + cd radare2-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 -Nru radare2-2.3.0+dfsg/doc/gdb radare2-2.8.0+dfsg/doc/gdb --- radare2-2.3.0+dfsg/doc/gdb 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/gdb 1970-01-01 00:00:00.000000000 +0000 @@ -1,61 +0,0 @@ -Connecting r2 with gdb -====================== - -Running gdbserver ------------------ - $ gdbserver :2345 /bin/ls - (gdb) target remote localhost:2345 - -Connecting from r2 ------------------- - $ r2 -D gdb gdb://127.0.0.1:2345 - - -Supported implementations -========================= -r2 have support for connecting to remote GDB instances: - - x86-32 x86-64 arm arm64 sh - winedbg x x - - - - qemu x x ? x - - gdbserver x x ? ? ? - - x = supported - ? = untested - - = not supported - -Supported Commands ------------------- -- read/write memory - -Writing or reading memory is implemented through the m/M packet. - -- read registers - -Reading registers is currently implemented through the packet of the gdb protocol. -It returns the whole register profile at once. - -- write registers - -There are two ways of writing registers. The first one is through the P packet. -It works like this: `P=` -The second one is the G packet, that writes the whole register Profile at once. -The implementation first tries to use the newer P packet and if it receives a $00# packet (that says not implemented), it tries to write through the G packet. - -- stepping (but this is still the softstep mode and for an unknown reason it sill does not call th gdb_write_register function) - -Supported Packets: -- g : Reads the whole register Profile at once -- G : Writes the whole register Profile at once -- m : Reads memory -- M : Writes memory -- vCont,v : continues execution of the binary -- P : Write one register - -TODO ----- -- Implement GDBserver to allow other apps use r2 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 -Nru radare2-2.3.0+dfsg/doc/gdb.md radare2-2.8.0+dfsg/doc/gdb.md --- radare2-2.3.0+dfsg/doc/gdb.md 1970-01-01 00:00:00.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/gdb.md 2018-08-07 14:12:36.000000000 +0000 @@ -0,0 +1,66 @@ +Connecting r2 with gdb +====================== + +Running gdbserver +----------------- + + $ gdbserver :2345 /bin/ls + (gdb) target remote localhost:2345 + +Connecting from r2 +------------------ + + $ r2 -D gdb gdb://127.0.0.1:2345 + + +Supported implementations +========================= +r2 have support for connecting to remote GDB instances: + + x86-32 x86-64 arm arm64 sh + winedbg x x - - - + qemu x x ? x - + gdbserver x x ? ? ? + + x = supported + ? = untested + - = not supported + +Supported Commands +------------------ + +- read/write memory + + Writing or reading memory is implemented through the m/M packet. + +- read registers + + Reading registers is currently implemented through the packet of the gdb protocol. + It returns the whole register profile at once. + +- write registers + + There are two ways of writing registers. The first one is through the P packet. + It works like this: `P=` + The second one is the G packet, that writes the whole register Profile at once. + The implementation first tries to use the newer P packet and if it receives a $00# packet (that says not implemented), it tries to write through the G packet. + +- stepping (but this is still the softstep mode and for an unknown reason it sill does not call th gdb_write_register function) + +Supported Packets: + +- `g` : Reads the whole register Profile at once +- `G` : Writes the whole register Profile at once +- `m` : Reads memory +- `M` : Writes memory +- `vCont,v` : continues execution of the binary +- `P` : Write one register + +TODO +---- + +- Implement GDBserver to allow other apps use r2 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 -Nru radare2-2.3.0+dfsg/doc/gprobe.md radare2-2.8.0+dfsg/doc/gprobe.md --- radare2-2.3.0+dfsg/doc/gprobe.md 1970-01-01 00:00:00.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/gprobe.md 2018-08-07 14:12:36.000000000 +0000 @@ -0,0 +1,60 @@ +What is GProbe? +=============== +GProbe is a protocol to communicate with various parts from +Genesis/STMicro/MegaChips that are mostly used in video chipsets. + +These chips have an integrated Turbo186 core. With GProbe you can read and write +RAM, reset the CPU, execute code in RAM, ... +There is a proprietary Windows tool to do this, but radare2 offers much more +functionality. + +Gprobe got some public attention with the +[MonitorDarkly exploit](https://github.com/RedBalloonShenanigans/MonitorDarkly). + +What is implemented? +-------------------- +- Serial1 protocol wrapper +- DDC2Bi3 protocol wrapper (Linux only) +- RAM read-/write-access +- Reset +- DebugOn/DebugOff +- RunCode +- GetDeviceId +- GetInformation + +TODOs +----- +- DisplayPort AUX Channel protocol wrapper +- Flash commands + +What is tested? +--------------- +- building with sys/user.sh and sys/mingw32.sh on linux +- running radare2 on Linux and Windows +- communication via FTDI USB serial adaptor +- communication via DDC2Bi3 +- controlling a MegaChips RD1-4320 DisplayPort 1.2a splitter reference board +- controlling a DELL U2410 connected via DVI + +How to use for dummies? +----------------------- +radare2 -n -w gprobe:///dev/ttyUSB0 +- "/dev/ttyUSB0" is the serial connection, use something like "COM3" on Windows +- "-n" is important to avoid an initial 32k read to identify the binary type +- "-w" if you want to allow writing to RAM + +radare2 -n -w gprobe://i2c-4 +- i2c-4 is the i2c bus where the GProbe device is connected +- find the appropriate bus with "ddcutil detect" +- make sure the i2c-dev kernel module is loaded + +Setup for Turbo186 processor core: +- e asm.bits=16 +- e asm.seggrn=8 + +Now enjoy all the great stuff that r2 offers, like: +- run grobe commands with =!? +- dump memory with px +- Visual mode with V, including cursor mode and insert hexpairs +- dumping segments to file +- disassembly and analysis diff -Nru radare2-2.3.0+dfsg/doc/haiku radare2-2.8.0+dfsg/doc/haiku --- radare2-2.3.0+dfsg/doc/haiku 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/haiku 1970-01-01 00:00:00.000000000 +0000 @@ -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/radare2 - -And then.. - - > HOST_CC=gcc-x86 make - > make install - > mv /boot/home/Apps/radare2/bin/* /boot/home/Apps/radare2/ - > rmdir /boot/home/Apps/radare2/bin/ - -To install r2-bindings you will need to install r2, valac, valabind and swig -and copy/link libs to radare2/lib - - -TODO -==== - -* Add debugging support diff -Nru radare2-2.3.0+dfsg/doc/haiku.md radare2-2.8.0+dfsg/doc/haiku.md --- radare2-2.3.0+dfsg/doc/haiku.md 1970-01-01 00:00:00.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/haiku.md 2018-08-07 14:12:36.000000000 +0000 @@ -0,0 +1,22 @@ +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/radare2 + +And then.. + + HOST_CC=gcc-x86 make + make install + mv /boot/home/Apps/radare2/bin/* /boot/home/Apps/radare2/ + rmdir /boot/home/Apps/radare2/bin/ + +To install r2-bindings you will need to install r2, valac, valabind and swig +and copy/link libs to radare2/lib + + +TODO +==== + +* Add debugging support diff -Nru radare2-2.3.0+dfsg/doc/hud radare2-2.8.0+dfsg/doc/hud --- radare2-2.3.0+dfsg/doc/hud 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/hud 2018-08-07 14:12:36.000000000 +0000 @@ -6,7 +6,9 @@ analyze preludes ap continue process execution dc;?i disable colors e scr.color=0 -enable colors e scr.color=1 +enable colors (ANSI 16) e scr.color=1 +enable colors (256) e scr.color=2 +enable colors (16M) e scr.color=3 randomize colors ecr hide bytes in disassembly e asm.bytes=false show bytes in disassembly e asm.bytes=true diff -Nru radare2-2.3.0+dfsg/doc/ida radare2-2.8.0+dfsg/doc/ida --- radare2-2.3.0+dfsg/doc/ida 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/ida 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -IDA -====== - -You can find conversion scripts to work between radare2 and IDA files (IDC, IDB...) in the repo: - -* https://github.com/radare/radare2ida - diff -Nru radare2-2.3.0+dfsg/doc/ida.md radare2-2.8.0+dfsg/doc/ida.md --- radare2-2.3.0+dfsg/doc/ida.md 1970-01-01 00:00:00.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/ida.md 2018-08-07 14:12:36.000000000 +0000 @@ -0,0 +1,7 @@ +IDA +====== + +You can find conversion scripts to work between radare2 and IDA files (IDC, IDB...) in the repo: + +* https://github.com/radare/radare2ida + diff -Nru radare2-2.3.0+dfsg/doc/images/morelogos.svg radare2-2.8.0+dfsg/doc/images/morelogos.svg --- radare2-2.3.0+dfsg/doc/images/morelogos.svg 1970-01-01 00:00:00.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/images/morelogos.svg 2018-08-07 14:12:36.000000000 +0000 @@ -0,0 +1,173 @@ + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru radare2-2.3.0+dfsg/doc/images/r2w.svg radare2-2.8.0+dfsg/doc/images/r2w.svg --- radare2-2.3.0+dfsg/doc/images/r2w.svg 1970-01-01 00:00:00.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/images/r2w.svg 2018-08-07 14:12:36.000000000 +0000 @@ -0,0 +1,90 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff -Nru radare2-2.3.0+dfsg/doc/intro.md radare2-2.8.0+dfsg/doc/intro.md --- radare2-2.3.0+dfsg/doc/intro.md 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/intro.md 2018-08-07 14:12:36.000000000 +0000 @@ -30,7 +30,7 @@ ``` # Show comments at right of disassembly if they fit in screen -e asm.cmtright=true +e asm.cmt.right=true # Shows pseudocode in disassembly. Eg mov eax, str.ok = > eax = str.ok e asm.pseudo = true diff -Nru radare2-2.3.0+dfsg/doc/io radare2-2.8.0+dfsg/doc/io --- radare2-2.3.0+dfsg/doc/io 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/io 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ -How IO should work -================== - -* Maps - - Used to select fd. Mapaddr..size - -* Sections - - Used to specify vaddr<->paddr - -Manually selecting fd is still valid and it should override maps fdselection. This is.. We need a way to tell r2 to view one fd or all of them. In case of having two files mapped on the same address space we will select the last opened. - -The base address is used to reallocate all vaddr offsets. - -Reading/writing ops should be done in a loop checking for the section boundaries. - -The sections must be asociated to a file, but we should be able to display/use them all in case of having non forced fd. This is, when not having overlapped files in memory. - -The write ops should only obey to the global io configuration and ignore the section permissions (maybe just throw a warning?) - -Atm sections are dupped in io and bin. We should merge them. Maybe using sdb, so we just reuse it diff -Nru radare2-2.3.0+dfsg/doc/io-fixing radare2-2.8.0+dfsg/doc/io-fixing --- radare2-2.3.0+dfsg/doc/io-fixing 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/io-fixing 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -r_io/r_core-file fixing -======================= - -Conceptual things: ------------------- --in general only code from r_io should be used for io related stuff, io is NOT a core-task - -wrappers are ok, but no re-implementations (there might be exceptions but those must be reasonable argued) - -linkage is not argument -> use RIOBind - -esil-custom reads and writes should use RIOBind too --if a file gets opened a RIODesc MUST be created --if a file gets opened in usual cases a RIOMap MUST be created --if a file gets opened in unsusual cases it's not necessary to create a RIOMap - -if no RIOMap was created for a fd reading and writing from and to this fd is only possible via r_io_pread and r_io_pwrite - -this is only an option if only 1 file can be opened for a task or if the fd will never see the user-land - -Rahash2 for example won't need creating a RIOMap --if a file gets closed all RIOMaps for that belong to the fd MUST get destroyed --if a file gets closed the RIODesc MUST get destroyed --the cores primary task is to delegate the different parts of r2 - -creating a new RIOMap or RIODesc on file-opening is NOT a core-task - -the same goes for destroying RIOMaps and RIODesc on closing a file - -there is no need for a map-list in the core directly. core->io->maps is the only list to store maps (for the long run, functions that return a list with maps are ok) - -Documentation: --------------- -There is no need for a huge documentation!!! But code with fundamental importance often needs a few lines on what it should do, its concept -and sometimes a few lines of the code itself need some kind of 'justification' or explanation. libr/io/vio.c is a hardcore example for this -RIO-code has fundamental importance, because everything will fail if io does not work correctly. -This is needed to make bug-fixing easier, faster and better. - -Need review: ------------- - libr/io/io.c - libr/core/file.c - -Tasks: ------- --we should fix all the tests before doing this. - -talk about ioneg --remove re-implemtations of r_io (middle) --implement r_io_open_at (easy) ; this should open a file, add a RIODesc and a RIOMap that maps the file to an offset that is passed as an arg --make r_io_open creating a new map (easy) ; this should open a file, add a RIODesc and a RIOMap that maps the file to 0 - -this means cleaning up r_core_file_open too (hard?) --implement r_io_open_no_map (easy) ; this should open a file and add a RIODesc. the file can only be accessed via r_io_pread and r_io_pwrite --make r_io_close destroy all maps that belong to the file that should be closed (easy) - -this means cleaning up r_core_file_close too (hard?) --implement r_io_mwrite (hard); this should find all maps in a certain range, resolve their fds, RIODescs and paddr and then call pwrite --implement r_io_vwrite (hard); this should find all sections in a certain range, resolve the maddr that belongs to a vaddr and call mwrite, unsectioned area should be passed directly to mwrite --implement r_io_reopen (easy); keep the maps for a fd and reopen it, possibly with different permissions - -this means cleaning up r_core_file_reopen too (hard?) diff -Nru radare2-2.3.0+dfsg/doc/io-fixing.md radare2-2.8.0+dfsg/doc/io-fixing.md --- radare2-2.3.0+dfsg/doc/io-fixing.md 1970-01-01 00:00:00.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/io-fixing.md 2018-08-07 14:12:36.000000000 +0000 @@ -0,0 +1,55 @@ +`r_io/r_core-file` fixing +======================= + +Conceptual things: +------------------ + +- in general only code from `r_io` should be used for io related stuff, io is NOT a core-task + - wrappers are ok, but no re-implementations (there might be exceptions but those must be reasonable argued) + - linkage is not argument -> use RIOBind + - esil-custom reads and writes should use RIOBind too +- if a file gets opened a RIODesc MUST be created +- if a file gets opened in usual cases a RIOMap MUST be created +- if a file gets opened in unsusual cases it's not necessary to create a RIOMap + - if no RIOMap was created for a fd reading and writing from and to this fd is only possible via `r_io_pread` and `r_io_pwrite` + - this is only an option if only 1 file can be opened for a task or if the fd will never see the user-land + - Rahash2 for example won't need creating a RIOMap +- if a file gets closed all RIOMaps for that belong to the fd MUST get destroyed +- if a file gets closed the RIODesc MUST get destroyed +- the cores primary task is to delegate the different parts of r2 + - creating a new RIOMap or RIODesc on file-opening is NOT a core-task + - the same goes for destroying RIOMaps and RIODesc on closing a file + - there is no need for a map-list in the core directly. core->io->maps is the only list to store maps (for the long run, functions that return a list with maps are ok) + +Documentation: +-------------- + +There is no need for a huge documentation!!! But code with fundamental +importance often needs a few lines on what it should do, its concept and +sometimes a few lines of the code itself need some kind of 'justification' or +explanation. libr/io/vio.c is a hardcore example for this RIO-code has +fundamental importance, because everything will fail if io does not work +correctly. This is needed to make bug-fixing easier, faster and better. + +Need review: +------------ + + libr/io/io.c + libr/core/file.c + +Tasks: +------ + +- we should fix all the tests before doing this. + - talk about ioneg +- remove re-implemtations of `r_io` (middle) +- implement `r_io_open_at` (easy) ; this should open a file, add a RIODesc and a RIOMap that maps the file to an offset that is passed as an arg +- make `r_io_open` creating a new map (easy) ; this should open a file, add a RIODesc and a RIOMap that maps the file to 0 + - this means cleaning up `r_core_file_open` too (hard?) +- implement `r_io_open_no_map` (easy) ; this should open a file and add a RIODesc. the file can only be accessed via `r_io_pread` and `r_io_pwrite` +- make `r_io_close` destroy all maps that belong to the file that should be closed (easy) + - this means cleaning up `r_core_file_close` too (hard?) +- implement (hard); this should find all maps in a certain range, resolve their fds, RIODescs and paddr and then call pwrite +- implement (hard); this should find all sections in a certain range, resolve the maddr that belongs to a vaddr and call mwrite, unsectioned area should be passed directly to mwrite +- implement `r_io_reopen` (easy); keep the maps for a fd and reopen it, possibly with different permissions + - this means cleaning up `r_core_file_reopen` too (hard?) diff -Nru radare2-2.3.0+dfsg/doc/io.md radare2-2.8.0+dfsg/doc/io.md --- radare2-2.3.0+dfsg/doc/io.md 1970-01-01 00:00:00.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/io.md 2018-08-07 14:12:36.000000000 +0000 @@ -0,0 +1,22 @@ +How IO should work +================== + +* Maps + + Used to select fd. Mapaddr..size + +* Sections + + Used to specify vaddr<->paddr + +Manually selecting fd is still valid and it should override maps fdselection. This is.. We need a way to tell r2 to view one fd or all of them. In case of having two files mapped on the same address space we will select the last opened. + +The base address is used to reallocate all vaddr offsets. + +Reading/writing ops should be done in a loop checking for the section boundaries. + +The sections must be asociated to a file, but we should be able to display/use them all in case of having non forced fd. This is, when not having overlapped files in memory. + +The write ops should only obey to the global io configuration and ignore the section permissions (maybe just throw a warning?) + +Atm sections are dupped in io and bin. We should merge them. Maybe using sdb, so we just reuse it diff -Nru radare2-2.3.0+dfsg/doc/ios.md radare2-2.8.0+dfsg/doc/ios.md --- radare2-2.3.0+dfsg/doc/ios.md 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/ios.md 2018-08-07 14:12:36.000000000 +0000 @@ -8,9 +8,9 @@ There are different ways to build r2 for iOS, use the sys/ script you need: - * sys/ios-cydia.sh - * sys/ios-static.sh - * sys/ios-simulator.sh +* `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. diff -Nru radare2-2.3.0+dfsg/doc/iphone.md radare2-2.8.0+dfsg/doc/iphone.md --- radare2-2.3.0+dfsg/doc/iphone.md 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/iphone.md 2018-08-07 14:12:36.000000000 +0000 @@ -1,15 +1,15 @@ Crosscompiling from OSX: ======================== -export PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:$PATH -export CC=`pwd`/sys/ios-sdk-gcc -# set only for arm64, otherwise it is armv7 -export CPU=arm64 -# select ios sdk version -export IOSVER=7.1 -./configure --prefix=/usr --with-ostype=darwin --with-compiler=ios-sdk --target=arm-unknown-darwin -make -j4 -make install DESTDIR=/tmp/r2ios + export PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:$PATH + export CC=`pwd`/sys/ios-sdk-gcc + # set only for arm64, otherwise it is armv7 + export CPU=arm64 + # select ios sdk version + export IOSVER=7.1 + ./configure --prefix=/usr --with-ostype=darwin --with-compiler=ios-sdk --target=arm-unknown-darwin + make -j4 + make install DESTDIR=/tmp/r2ios Natively compiling on iOS @@ -19,31 +19,32 @@ Setup SDK for ARMv6 ------------------- + 1) Install 'APT 0.7 Strict' and OpenSSH packages from cydia. - apt-get coreutils install wget inetutils rsync git expat curl + apt-get coreutils install wget inetutils rsync git expat curl 2) Download missing packages from lolcathost: - wget http://lolcathost.org/b/libgcc_4.2-20080410-1-6_iphoneos-arm.deb - wget http://lolcathost.org/b/libSystem.dylib + wget http://lolcathost.org/b/libgcc_4.2-20080410-1-6_iphoneos-arm.deb + wget http://lolcathost.org/b/libSystem.dylib 3) Install them - dpkg -i libgcc_4.2-20080410-1-6_iphoneos-arm.deb - apt-get install com.bigboss.20toolchain - cp libSystem.dylib /usr/lib - cd /usr/lib ; ln -sf libSystem.dylib libm.dylib - apt-get install make vim gawk git + dpkg -i libgcc_4.2-20080410-1-6_iphoneos-arm.deb + apt-get install com.bigboss.20toolchain + cp libSystem.dylib /usr/lib + cd /usr/lib ; ln -sf libSystem.dylib libm.dylib + apt-get install make vim gawk git 4) /var/include/sys/stat.h is broken. - Solution: add 'int foo[3];' after 'st_rdev' at line 178 + Solution: add 'int foo[3];' after 'st_rdev' at line 178 5) Get the varinclude tarball - wget lolcathost.org/b/varinclude.tar.gz - tar xzvf varinclude.tar.gz -C / + wget lolcathost.org/b/varinclude.tar.gz + tar xzvf varinclude.tar.gz -C / Compilation ----------- diff -Nru radare2-2.3.0+dfsg/doc/kvast radare2-2.8.0+dfsg/doc/kvast --- radare2-2.3.0+dfsg/doc/kvast 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/kvast 1970-01-01 00:00:00.000000000 +0000 @@ -1,95 +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 -Nru radare2-2.3.0+dfsg/doc/kvast.md radare2-2.8.0+dfsg/doc/kvast.md --- radare2-2.3.0+dfsg/doc/kvast.md 1970-01-01 00:00:00.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/kvast.md 2018-08-07 14:12:36.000000000 +0000 @@ -0,0 +1,97 @@ +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 -Nru radare2-2.3.0+dfsg/doc/license radare2-2.8.0+dfsg/doc/license --- radare2-2.3.0+dfsg/doc/license 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/license 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -Licensing -========= - -Before you try to statically link r2, you should know about the licenses that go along with it, - -http://stackoverflow.com/questions/10130143/gpl-lgpl-and-static-linking - -Also this stackoverflow page explains the legal case of using it via r2pipe, - -http://stackoverflow.com/questions/1394623/can-i-dynamically-call-a-lgpl-gpl-software-in-my-closed-source-application - -LGPLv3 keeps the freedom to the user to switch to a different version of the r2 libraries, so static linking is not permitted unless the privative software is distributed with the object files needed to do the full static link, so the users will be able to upgrade or modify r2 libraries even if - -r2 is licensed under the LGPL license, which permits statically linking, but forces you to liberate the object files and a way to allow users to link them. - -r2pipe or scripting/plugins can be used from r2 without any kind of legal issue, only if you modify r2 to make it work with your tools, you should make those changes public, this way we ensure the users always have the freedom to change or upgrade the r2 libraries that come along with r2. - -Some parts of r2 are under the GPL license, here's a list of them: - -* C++ demangler (libr/bin) -* Some exotic disassemblers -* GNU binutils disassemblers (libr/asm) -* GRUB filesystems (libr/fs) - -If you are going to use r2 in your propietary product bear in mind to build it without those parts, which may infect your program. Please refer to the FSF or GNU sites to understand how licenses work. - -As long as r2pipe, or webui access is done via a textual interface which requires no reverse engineering or linking for integration other programs will not be affected by the license rules. - -If you have any other question about how to use, build, link and distribute r2 with your own tools drop me an email (pancake@nopcode.org) or just talk to the Free Software Foundation in order to clarify that. - ---pancake diff -Nru radare2-2.3.0+dfsg/doc/license.md radare2-2.8.0+dfsg/doc/license.md --- radare2-2.3.0+dfsg/doc/license.md 1970-01-01 00:00:00.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/license.md 2018-08-07 14:12:36.000000000 +0000 @@ -0,0 +1,31 @@ +Licensing +========= + +Before you try to statically link r2, you should know about the licenses that go along with it, + +http://stackoverflow.com/questions/10130143/gpl-lgpl-and-static-linking + +Also this stackoverflow page explains the legal case of using it via r2pipe, + +http://stackoverflow.com/questions/1394623/can-i-dynamically-call-a-lgpl-gpl-software-in-my-closed-source-application + +LGPLv3 keeps the freedom to the user to switch to a different version of the r2 libraries, so static linking is not permitted unless the privative software is distributed with the object files needed to do the full static link, so the users will be able to upgrade or modify r2 libraries even if + +r2 is licensed under the LGPL license, which permits statically linking, but forces you to liberate the object files and a way to allow users to link them. + +r2pipe or scripting/plugins can be used from r2 without any kind of legal issue, only if you modify r2 to make it work with your tools, you should make those changes public, this way we ensure the users always have the freedom to change or upgrade the r2 libraries that come along with r2. + +Some parts of r2 are under the GPL license, here's a list of them: + +* C++ demangler (libr/bin) +* Some exotic disassemblers +* GNU binutils disassemblers (libr/asm) +* GRUB filesystems (libr/fs) + +If you are going to use r2 in your propietary product bear in mind to build it without those parts, which may infect your program. Please refer to the FSF or GNU sites to understand how licenses work. + +As long as r2pipe, or webui access is done via a textual interface which requires no reverse engineering or linking for integration other programs will not be affected by the license rules. + +If you have any other question about how to use, build, link and distribute r2 with your own tools drop me an email (pancake@nopcode.org) or just talk to the Free Software Foundation in order to clarify that. + +--pancake diff -Nru radare2-2.3.0+dfsg/doc/macos.md radare2-2.8.0+dfsg/doc/macos.md --- radare2-2.3.0+dfsg/doc/macos.md 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/macos.md 2018-08-07 14:12:36.000000000 +0000 @@ -25,29 +25,29 @@ (Based on https://llvm.org/svn/llvm-project/lldb/trunk/docs/code-signing.txt) - - Launch /Applications/Utilities/Keychain Access.app - - In Keychain Access select the "login" keychain in the "Keychains" list in the upper left hand corner of the window. - - Select the following menu item: - Keychain Access->Certificate Assistant->Create a Certificate... - - Set the following settings - Name = org.radare.radare2 - Identity Type = Self Signed Root - Certificate Type = Code Signing - - Click Create - - Click Continue - - Click Done - - Click on the "My Certificates" - - Double click on your new org.radare.radare2 certificate - - Turn down the "Trust" disclosure triangle, scroll to the "Code Signing" trust pulldown menu and select "Always Trust" and authenticate as needed using your username and password. - - Drag the new "org.radare.radare2" code signing certificate (not the public or private keys of the same name) from the "login" keychain to the "System" keychain in the Keychains pane on the left hand side of the main Keychain Access window. This will move this certificate to the "System" keychain. You'll have to authorize a few more times, set it to be "Always trusted" when asked. - - In the Keychain Access GUI, click and drag "org.radare.radare2" in the "System" keychain onto the desktop. The drag will create a "~/Desktop/org.radare.radare2.cer" file used in the next step. - - Switch to Terminal, and run the following: - $ sudo security add-trust -d -r trustRoot -p basic -p codeSign -k /Library/Keychains/System.keychain ~/Desktop/org.radare.radare2.cer - $ rm -f ~/Desktop/org.radare.radare2.cer - - Drag the "org.radare.radare2" certificate from the "System" keychain back into the "login" keychain - - Quit Keychain Access - - Reboot - - Run sys/install.sh (or follow the next steps if you want to install and sign radare2 manually) +1. Launch /Applications/Utilities/Keychain Access.app +1. In Keychain Access select the "login" keychain in the "Keychains" list in the upper left hand corner of the window. +1. Select the following menu item: +1. Keychain Access->Certificate Assistant->Create a Certificate... +1. Set the following settings +1. Name = org.radare.radare2 +1. Identity Type = Self Signed Root +1. Certificate Type = Code Signing +1. Click Create +1. Click Continue +1. Click Done +1. Click on the "My Certificates" +1. Double click on your new org.radare.radare2 certificate +1. Turn down the "Trust" disclosure triangle, scroll to the "Code Signing" trust pulldown menu and select "Always Trust" and authenticate as needed using your username and password. +1. Drag the new "org.radare.radare2" code signing certificate (not the public or private keys of the same name) from the "login" keychain to the "System" keychain in the Keychains pane on the left hand side of the main Keychain Access window. This will move this certificate to the "System" keychain. You'll have to authorize a few more times, set it to be "Always trusted" when asked. +1. In the Keychain Access GUI, click and drag "org.radare.radare2" in the "System" keychain onto the desktop. The drag will create a "~/Desktop/org.radare.radare2.cer" file used in the next step. +1. Switch to Terminal, and run the following: +1. $ sudo security add-trust -d -r trustRoot -p basic -p codeSign -k /Library/Keychains/System.keychain ~/Desktop/org.radare.radare2.cer +1. $ rm -f ~/Desktop/org.radare.radare2.cer +1. Drag the "org.radare.radare2" certificate from the "System" keychain back into the "login" keychain +1. Quit Keychain Access +1. Reboot +1. Run sys/install.sh (or follow the next steps if you want to install and sign radare2 manually) As said before, the signing process can also be done manually following the next process. First, you will need to sign the radare2 binary: diff -Nru radare2-2.3.0+dfsg/doc/maemo radare2-2.8.0+dfsg/doc/maemo --- radare2-2.3.0+dfsg/doc/maemo 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/maemo 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ - Build for maemo6 (Harmattan) N9 - N950 -======================================== - -* Install QtSDK - - - http://qt.nokia.com/downloads/ - -* Configure mad (maemo development environment) - - cd /usr/bin ; sudo ln -fs $HOME/QtSDK/Madde/bin/mad - mad set harmattan-nokia-meego-api - mad sh - -* Compile - - ./configure --prefix=/usr --with-little-endian \ - --with-compiler=mad --with-ostype=gnulinux - make - -* Create the package - - cd maemo - make - -* Install the package - - dpkg -i radare2-*.deb diff -Nru radare2-2.3.0+dfsg/doc/maemo.md radare2-2.8.0+dfsg/doc/maemo.md --- radare2-2.3.0+dfsg/doc/maemo.md 1970-01-01 00:00:00.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/maemo.md 2018-08-07 14:12:36.000000000 +0000 @@ -0,0 +1,27 @@ +Build for maemo6 (Harmattan) N9 - N950 +====================================== + +1. Install QtSDK + + http://qt.nokia.com/downloads/ + +2. Configure mad (maemo development environment) + + cd /usr/bin ; sudo ln -fs $HOME/QtSDK/Madde/bin/mad + mad set harmattan-nokia-meego-api + mad sh + +3. Compile + + ./configure --prefix=/usr --with-little-endian \ + --with-compiler=mad --with-ostype=gnulinux + make + +4. Create the package + + cd maemo + make + +5. Install the package + + dpkg -i radare2-*.deb diff -Nru radare2-2.3.0+dfsg/doc/node.js/index.js radare2-2.8.0+dfsg/doc/node.js/index.js --- radare2-2.3.0+dfsg/doc/node.js/index.js 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/node.js/index.js 2018-08-07 14:12:36.000000000 +0000 @@ -24,7 +24,7 @@ wwwroot = wwwroot.trim (); r.cmd ("e http.port", function(port) { port = +port.trim (); - r.cmd ("e scr.color=false", function() {}); + r.cmd ("e scr.color=0", function() {}); r.cmd ("e scr.interactive=false", function() {}); r.cmd ("e scr.html=true", function(){}); var app = express(); diff -Nru radare2-2.3.0+dfsg/doc/oo radare2-2.8.0+dfsg/doc/oo --- radare2-2.3.0+dfsg/doc/oo 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/oo 1970-01-01 00:00:00.000000000 +0000 @@ -1,41 +0,0 @@ -Radare OO -========= - -I do realize that Object Orientation sucks, so I tried to do libr 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 thru 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 libr directory. - diff -Nru radare2-2.3.0+dfsg/doc/oo.md radare2-2.8.0+dfsg/doc/oo.md --- radare2-2.3.0+dfsg/doc/oo.md 1970-01-01 00:00:00.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/oo.md 2018-08-07 14:12:36.000000000 +0000 @@ -0,0 +1,45 @@ +Radare OO +========= + +I do realize that Object Orientation sucks, so I tried to do libr 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 thru 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 libr directory. + diff -Nru radare2-2.3.0+dfsg/doc/openbsd.md radare2-2.8.0+dfsg/doc/openbsd.md --- radare2-2.3.0+dfsg/doc/openbsd.md 1970-01-01 00:00:00.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/openbsd.md 2018-08-07 14:12:36.000000000 +0000 @@ -0,0 +1,41 @@ +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/radare/radare2 + cd radare2 + 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/radare/radare2-bindings + cd radare2-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 -Nru radare2-2.3.0+dfsg/doc/pdb/pdb_usage radare2-2.8.0+dfsg/doc/pdb/pdb_usage --- radare2-2.3.0+dfsg/doc/pdb/pdb_usage 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/pdb/pdb_usage 1970-01-01 00:00:00.000000000 +0000 @@ -1,68 +0,0 @@ -PDB usage -========= - -- To get information about functions, structures, unions, enumerates etc: -```` -rabin2 -P some_pdb_file -For example: -rabin2 -P Project1.pdb -... -TEST_STRUCT: size 0x8 - 0x0: a type:(member) long - 0x4: b type:(member) long -TEST_ENUM: size 0x0 - 0x10: eENUM1 type:enumerate eENUM1 - 0x20: eENUM2 type:enumerate eENUM2 - 0x21: eENUM_MAX type:enumerate eENUM_MAX -TEST_UNION: size 0x4 - 0x0: union_var_1 type:(member) long - 0x0: union_var_2 type:(member) long -TEST_STRUCT: size 0x8 - 0x0: struct_var_1 type:(member) long - 0x4: struct_var_2 type:(member) long -{"gvars":[0x00001000 0 .textbss __enc$textbss$begin -0x00011000 0 .textbss __enc$textbss$end -0x000192c8 0 .idata __imp__printf -0x000192c0 0 .idata __imp__system -0x000113e0 2 .text ?test_func@@YAHHH@Z -... -```` - -- To display all mentioned above information in json format: -```` -rabin2 -Pj some_pdb_file -```` - -- To export information about types, functions: -```` -rabin2 -Pr some_pdb_file -For example: -rabin2 -P Project1.pdb -... -pf TEST_STRUCT ii a b -"td enum TEST_ENUM eENUM1=00000010,eENUM2=00000020,eENUM_MAX=00000021 };" -pf TEST_UNION ii union_var_1 union_var_2 -pf TEST_STRUCT ii struct_var_1 struct_var_2 -f pdb.__enc_textbss_begin = 0x1000 # 0 .textbss -f pdb.__enc_textbss_end = 0x11000 # 0 .textbss -f pdb.__imp__printf = 0x192c8 # 0 .idata -f pdb.__imp__system = 0x192c0 # 0 .idata -f pdb._test_func__YAHHH_Z = 0x113e0 # 2 .text -... -Check out this post for more information about pf: http://radare.today/types/ -```` - -- To download PDB file for some binary (.exe, .dll): -```` -rabin2 -PP path_to_binary -For example: -rabin2 -PP ~/Downloads/libs/user32.dll -% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed -100 336k 100 336k 0 0 34388 0 0:00:10 0:00:10 --:--:-- 38385 -Extracting cabinet: /home/inisider/Downloads/libs/user32.pd_ -extracting /home/inisider/Downloads/libs/user32.pdb -All done, no errors. -```` -The following dependencies are required for PDB downloader: -* curl -* cabextract (non-Windows only, optional) diff -Nru radare2-2.3.0+dfsg/doc/pdb/pdb_usage.md radare2-2.8.0+dfsg/doc/pdb/pdb_usage.md --- radare2-2.3.0+dfsg/doc/pdb/pdb_usage.md 1970-01-01 00:00:00.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/pdb/pdb_usage.md 2018-08-07 14:12:36.000000000 +0000 @@ -0,0 +1,68 @@ +PDB usage +========= + +- To get information about functions, structures, unions, enumerates etc: +```` +rabin2 -P some_pdb_file +For example: +rabin2 -P Project1.pdb +... +TEST_STRUCT: size 0x8 + 0x0: a type:(member) long + 0x4: b type:(member) long +TEST_ENUM: size 0x0 + 0x10: eENUM1 type:enumerate eENUM1 + 0x20: eENUM2 type:enumerate eENUM2 + 0x21: eENUM_MAX type:enumerate eENUM_MAX +TEST_UNION: size 0x4 + 0x0: union_var_1 type:(member) long + 0x0: union_var_2 type:(member) long +TEST_STRUCT: size 0x8 + 0x0: struct_var_1 type:(member) long + 0x4: struct_var_2 type:(member) long +{"gvars":[0x00001000 0 .textbss __enc$textbss$begin +0x00011000 0 .textbss __enc$textbss$end +0x000192c8 0 .idata __imp__printf +0x000192c0 0 .idata __imp__system +0x000113e0 2 .text ?test_func@@YAHHH@Z +... +```` + +- To display all mentioned above information in json format: +```` +rabin2 -Pj some_pdb_file +```` + +- To export information about types, functions: +```` +rabin2 -Pr some_pdb_file +For example: +rabin2 -P Project1.pdb +... +pf TEST_STRUCT ii a b +"td enum TEST_ENUM eENUM1=00000010,eENUM2=00000020,eENUM_MAX=00000021 };" +pf TEST_UNION ii union_var_1 union_var_2 +pf TEST_STRUCT ii struct_var_1 struct_var_2 +f pdb.__enc_textbss_begin = 0x1000 # 0 .textbss +f pdb.__enc_textbss_end = 0x11000 # 0 .textbss +f pdb.__imp__printf = 0x192c8 # 0 .idata +f pdb.__imp__system = 0x192c0 # 0 .idata +f pdb._test_func__YAHHH_Z = 0x113e0 # 2 .text +... +Check out this post for more information about pf: http://radare.today/types/ +```` + +- To download PDB file for some binary (.exe, .dll): +```` +rabin2 -PP path_to_binary +For example: +rabin2 -PP ~/Downloads/libs/user32.dll +% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed +100 336k 100 336k 0 0 34388 0 0:00:10 0:00:10 --:--:-- 38385 +Extracting cabinet: /home/inisider/Downloads/libs/user32.pd_ +extracting /home/inisider/Downloads/libs/user32.pdb +All done, no errors. +```` +The following dependencies are required for PDB downloader: +* curl +* cabextract (non-Windows only, optional) diff -Nru radare2-2.3.0+dfsg/doc/plugins radare2-2.8.0+dfsg/doc/plugins --- radare2-2.3.0+dfsg/doc/plugins 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/plugins 1970-01-01 00:00:00.000000000 +0000 @@ -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 - -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) - -libr/plugins/shared -libr/plugins/static - -the configure-plugins script will regenerate the required Makefiles -to build this stuff as defined. - -PD: This is not implemented :) - ---pancake diff -Nru radare2-2.3.0+dfsg/doc/plugins.md radare2-2.8.0+dfsg/doc/plugins.md --- radare2-2.3.0+dfsg/doc/plugins.md 1970-01-01 00:00:00.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/plugins.md 2018-08-07 14:12:36.000000000 +0000 @@ -0,0 +1,27 @@ +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 + +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) + + libr/plugins/shared + libr/plugins/static + +the configure-plugins script will regenerate the required Makefiles +to build this stuff as defined. + +PD: This is not implemented :) + +--pancake diff -Nru radare2-2.3.0+dfsg/doc/qnx radare2-2.8.0+dfsg/doc/qnx --- radare2-2.3.0+dfsg/doc/qnx 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/qnx 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -r2 on android -============= - - . ./bbndk-env.sh - cd ~/radare2 - rm -f plugins.cfg - ./configure --with-compiler=qnx --with-ostype=qnx --prefix=/accounts/devuser/radare2 --without-pic --with-nonpic - make -j 4 - diff -Nru radare2-2.3.0+dfsg/doc/qnx.md radare2-2.8.0+dfsg/doc/qnx.md --- radare2-2.3.0+dfsg/doc/qnx.md 1970-01-01 00:00:00.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/qnx.md 2018-08-07 14:12:36.000000000 +0000 @@ -0,0 +1,11 @@ +r2 on android +============= + +``` +. ./bbndk-env.sh +cd ~/radare2 +rm -f plugins.cfg +./configure --with-compiler=qnx --with-ostype=qnx --prefix=/accounts/devuser/radare2 --without-pic --with-nonpic +make -j 4 +``` + diff -Nru radare2-2.3.0+dfsg/doc/rap radare2-2.8.0+dfsg/doc/rap --- radare2-2.3.0+dfsg/doc/rap 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/rap 1970-01-01 00:00:00.000000000 +0000 @@ -1,97 +0,0 @@ -RAP protocol -============ - -RAP stands for the Remote Access Protocol of Radare2, it is compatible with radare1 -and it simply defines a communication between a client and a server to simulate IO -operations. - -There are two different implementations, one in C and another in Python. - -Usage example -------------- - -Start in one terminal the following command to wait for incoming connections: - - r2 rap://:9999 - -In another machine or terminal connect it: - - r2 rap://localhost:9999//bin/ls - -As you see, the path of the remote file to load must be specified, and this handled -by the open() packet. - -Known Bugs ----------- - -* Read/Write operations ignore the filedescriptor completely because it is supposed to be handled by the IO layer and it is redundant, but it introduces a bug that breaks support for multiple files. -* This can be fixed with a new packet type RAP_SETFD. -* Read lengths should be only 2 bytes, there's no sense in read > 64K of memory in a shot. -* Seek does not returns anything -* System vs Cmd - the first should have a return value as well as string result -* Filedescriptors are assumed to be 32bit - - -Operations ----------- - -The protocol is designed to be bidirectional, but right now, only one way is supported. -The client sends a byte specifying the operation and the server will reply the same byte -masked with the RMT_REPLY value (0x80 | op) - - RAP_OPEN = 1 - RAP_READ = 2 - RAP_WRITE = 3 - RAP_SEEK = 4 - RAP_CLOSE = 5 - RAP_SYSTEM = 6 - RAP_CMD = 7 - RAP_REPLY = 0x80 - -This is how are constructed the packets: - - RAP_OPEN - struct packed RapOpen { - ut8 op = 1; - ut8 rw = 0; // 0 = read-only, 1 = read-write - ut8 len = 15; // length of filename - } - >> 01 RW LN [....] - << 81 FD=(.. .. .. ..) - - RAP_READ - >> 02 LN=(.. .. .. ..) - << 82 LN=(.. .. .. ..) [..LN..] - - RAP_WRITE - >> 03 LN=(.. .. .. ..) [..LN..] - << 83 LN=(.. .. .. ..) - - RAP_SEEK - >> 04 FLAG=(..) OFFSET=(.. 8 bytes ..) - << 84 - - RAP_CLOSE - >> 05 FD=(4 bytes) - << 85 RET=(4 bytes) - - RAP_SYSTEM - >> 06 LEN=(4 bytes) STR[LEN bytes] - << 86 LN=(.. .. .. ..) STR[ LEN bytes] - - RAP_CMD_ - >> 07 LEN=(4 bytes) STR[LEN bytes] - << 87 LN=(.. .. .. ..) STR[ LEN bytes] - - -Examples --------- - -Python: - - See radare2-bindings/python/remote.py and test-rap-*.py - -C: - - Server: libr/socket/rap_server.c - Client: libr/io/p/io_rap.c diff -Nru radare2-2.3.0+dfsg/doc/rapatch.md radare2-2.8.0+dfsg/doc/rapatch.md --- radare2-2.3.0+dfsg/doc/rapatch.md 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/rapatch.md 2018-08-07 14:12:36.000000000 +0000 @@ -3,12 +3,12 @@ Human friendly text format to apply patches to binary files. - Patch format ------------ Those patches must be written in files and the syntax looks like the following: +``` ^# -> comments . -> execute command ! -> execute command @@ -17,14 +17,16 @@ OFFSET 01020304 OFFSET : assembly + {code}|"str"|0210|: asm +``` Example scripts --------------- -This script will run the '?e ..' command in r2 and then write the string 'Hello' at 0x200 offset - - # rapatch example - :?e hello world - 0x200 "Hello" +This script will run the `?e ..` command in r2 and then write the string 'Hello' at 0x200 offset +``` +# rapatch example +:?e hello world +0x200 "Hello" +``` Running rapatches ----------------- diff -Nru radare2-2.3.0+dfsg/doc/rap.md radare2-2.8.0+dfsg/doc/rap.md --- radare2-2.3.0+dfsg/doc/rap.md 1970-01-01 00:00:00.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/rap.md 2018-08-07 14:12:36.000000000 +0000 @@ -0,0 +1,97 @@ +RAP protocol +============ + +RAP stands for the Remote Access Protocol of Radare2, it is compatible with radare1 +and it simply defines a communication between a client and a server to simulate IO +operations. + +There are two different implementations, one in C and another in Python. + +Usage example +------------- + +Start in one terminal the following command to wait for incoming connections: + + r2 rap://:9999 + +In another machine or terminal connect it: + + r2 rap://localhost:9999//bin/ls + +As you see, the path of the remote file to load must be specified, and this handled +by the open() packet. + +Known Bugs +---------- + +* Read/Write operations ignore the filedescriptor completely because it is supposed to be handled by the IO layer and it is redundant, but it introduces a bug that breaks support for multiple files. +* This can be fixed with a new packet type RAP_SETFD. +* Read lengths should be only 2 bytes, there's no sense in read > 64K of memory in a shot. +* Seek does not returns anything +* System vs Cmd - the first should have a return value as well as string result +* Filedescriptors are assumed to be 32bit + + +Operations +---------- + +The protocol is designed to be bidirectional, but right now, only one way is supported. +The client sends a byte specifying the operation and the server will reply the same byte +masked with the RMT_REPLY value (0x80 | op) + + RAP_OPEN = 1 + RAP_READ = 2 + RAP_WRITE = 3 + RAP_SEEK = 4 + RAP_CLOSE = 5 + RAP_SYSTEM = 6 + RAP_CMD = 7 + RAP_REPLY = 0x80 + +This is how are constructed the packets: + + RAP_OPEN + struct packed RapOpen { + ut8 op = 1; + ut8 rw = 0; // 0 = read-only, 1 = read-write + ut8 len = 15; // length of filename + } + >> 01 RW LN [....] + << 81 FD=(.. .. .. ..) + + RAP_READ + >> 02 LN=(.. .. .. ..) + << 82 LN=(.. .. .. ..) [..LN..] + + RAP_WRITE + >> 03 LN=(.. .. .. ..) [..LN..] + << 83 LN=(.. .. .. ..) + + RAP_SEEK + >> 04 FLAG=(..) OFFSET=(.. 8 bytes ..) + << 84 + + RAP_CLOSE + >> 05 FD=(4 bytes) + << 85 RET=(4 bytes) + + RAP_SYSTEM + >> 06 LEN=(4 bytes) STR[LEN bytes] + << 86 LN=(.. .. .. ..) STR[ LEN bytes] + + RAP_CMD_ + >> 07 LEN=(4 bytes) STR[LEN bytes] + << 87 LN=(.. .. .. ..) STR[ LEN bytes] + + +Examples +-------- + +Python: + + See radare2-bindings/python/remote.py and test-rap-*.py + +C: + + Server: libr/socket/rap_server.c + Client: libr/io/p/io_rap.c diff -Nru radare2-2.3.0+dfsg/doc/releases radare2-2.8.0+dfsg/doc/releases --- radare2-2.3.0+dfsg/doc/releases 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/releases 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ -radare2 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 dont follow any rules for this) -* Codenames for releases MUST be funny (until we didnt get a name that can make - me laugh, we should not release anything!) - -Before any release we have to: - - - Remove warnings - - We dont 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, libr 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 libr - - - 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 -Nru radare2-2.3.0+dfsg/doc/releases.md radare2-2.8.0+dfsg/doc/releases.md --- radare2-2.3.0+dfsg/doc/releases.md 1970-01-01 00:00:00.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/releases.md 2018-08-07 14:12:36.000000000 +0000 @@ -0,0 +1,55 @@ +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 dont follow any rules for this) +* Codenames for releases MUST be funny (until we didnt get a name that can make + me laugh, we should not release anything!) + +Before any release we have to: + + - Remove warnings + + We dont 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, libr 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 libr + + - 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 -Nru radare2-2.3.0+dfsg/doc/repo radare2-2.8.0+dfsg/doc/repo --- radare2-2.3.0+dfsg/doc/repo 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/repo 2018-08-07 14:12:36.000000000 +0000 @@ -5,4 +5,5 @@ CAPSTONE=https://github.com/radare/radare2-capstone BINDINGS=https://github.com/radare/radare2-bindings REGRESSIONS=https://github.com/radare/radare2-regressions +PR_REGRESSIONS=https://github.com/__USER__/radare2-regressions [ -z "$1" ] && grep -h $0 | grep -v grep || eval echo \$$1 diff -Nru radare2-2.3.0+dfsg/doc/rgraph radare2-2.8.0+dfsg/doc/rgraph --- radare2-2.3.0+dfsg/doc/rgraph 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/rgraph 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -Not-much-updated graph of relationships between the libr 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 -Nru radare2-2.3.0+dfsg/doc/rgraph.md radare2-2.8.0+dfsg/doc/rgraph.md --- radare2-2.3.0+dfsg/doc/rgraph.md 1970-01-01 00:00:00.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/rgraph.md 2018-08-07 14:12:36.000000000 +0000 @@ -0,0 +1,23 @@ +Not-much-updated graph of relationships between the libr 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 -Nru radare2-2.3.0+dfsg/doc/sandbox/README.md radare2-2.8.0+dfsg/doc/sandbox/README.md --- radare2-2.3.0+dfsg/doc/sandbox/README.md 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/sandbox/README.md 2018-08-07 14:12:36.000000000 +0000 @@ -19,8 +19,8 @@ **NOTE**: r2 -S is an alias for -e cfg.sandbox=true -OpenBSD (starting to 5.9) -------------------------- +OpenBSD (from 5.9) +------------------ OpenBSD comes with support for sandboxing using the pledge(2) syscall. @@ -45,6 +45,14 @@ $ systrace -a r2 -S /bin/ls +FreeBSD (from 10.0) +------------------- + +FreeBSD comes with the Capsicum framework support, + using cap_enter(2). + +Operations limited on what basic capability mode support. + Other ----- diff -Nru radare2-2.3.0+dfsg/doc/solaris radare2-2.8.0+dfsg/doc/solaris --- radare2-2.3.0+dfsg/doc/solaris 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/solaris 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -ORACLE SOLARIS NOTES -==================== - -Packages you need: ------------------- -pkg install gcc-3 gmake - -To compile it: --------------- -./configure --without-debugger --without-gmp -gmake -gmake install diff -Nru radare2-2.3.0+dfsg/doc/solaris.md radare2-2.8.0+dfsg/doc/solaris.md --- radare2-2.3.0+dfsg/doc/solaris.md 1970-01-01 00:00:00.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/solaris.md 2018-08-07 14:12:36.000000000 +0000 @@ -0,0 +1,16 @@ +ORACLE SOLARIS NOTES +==================== + +Packages you need: +------------------ +``` +pkg install gcc-3 gmake +``` + +To compile it: +-------------- +``` +./configure --without-debugger --without-gmp +gmake +gmake install +``` diff -Nru radare2-2.3.0+dfsg/doc/static radare2-2.8.0+dfsg/doc/static --- radare2-2.3.0+dfsg/doc/static 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/static 1970-01-01 00:00:00.000000000 +0000 @@ -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 -Nru radare2-2.3.0+dfsg/doc/statis.md radare2-2.8.0+dfsg/doc/statis.md --- radare2-2.3.0+dfsg/doc/statis.md 1970-01-01 00:00:00.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/statis.md 2018-08-07 14:12:36.000000000 +0000 @@ -0,0 +1,26 @@ +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 -Nru radare2-2.3.0+dfsg/doc/strings radare2-2.8.0+dfsg/doc/strings --- radare2-2.3.0+dfsg/doc/strings 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/strings 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +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 ------------- -rabin2 -z # list strings -rabin2 -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 -Nru radare2-2.3.0+dfsg/doc/strings.md radare2-2.8.0+dfsg/doc/strings.md --- radare2-2.3.0+dfsg/doc/strings.md 1970-01-01 00:00:00.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/strings.md 2018-08-07 14:12:36.000000000 +0000 @@ -0,0 +1,37 @@ +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 +------------ +``` +rabin2 -z # list strings +rabin2 -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 -Nru radare2-2.3.0+dfsg/doc/termux.md radare2-2.8.0+dfsg/doc/termux.md --- radare2-2.3.0+dfsg/doc/termux.md 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/termux.md 2018-08-07 14:12:36.000000000 +0000 @@ -13,37 +13,37 @@ it is ok to just install the package from Termux unless you really want to track git master or develop for this platform. - $ apt install radare2 + sudo apt install radare2 Building from git ----------------- The packages required to build are: - $ apt install git make patch clang + sudo apt install git make patch clang Now you can clone the repo and build: - $ git clone --depth 1 https://github.com/radare/radare2 - $ cd radare2 - $ sys/termux.sh + git clone --depth 1 https://github.com/radare/radare2 + cd radare2 + sys/termux.sh Building with meson ------------------- If you want to build with meson: - $ apt install python - $ pip install meson - $ r2pm -i ninja + sudo apt install python + sudo pip install meson + sudo r2pm -i ninja And then you can run the build: - $ make meson + make meson To install: - $ make meson-symstall PREFIX=/data/data/com.termux/files/usr + make meson-symstall PREFIX=/data/data/com.termux/files/usr Updating -------- @@ -52,7 +52,7 @@ 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 + git reset --hard + git clean -xdf + sys/termux.sh diff -Nru radare2-2.3.0+dfsg/doc/types.md radare2-2.8.0+dfsg/doc/types.md --- radare2-2.3.0+dfsg/doc/types.md 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/types.md 2018-08-07 14:12:36.000000000 +0000 @@ -24,6 +24,7 @@ | c | char (signed byte) | | d | 0x%%08x hexadecimal value (4 bytes) | | f | float value (4 bytes) | +| F | double value (8 bytes) | | i | %%i integer value (4 bytes) | | o | 0x%%08o octal value (4 byte) | | p | pointer reference (2, 4 or 8 bytes) | diff -Nru radare2-2.3.0+dfsg/doc/windbg radare2-2.8.0+dfsg/doc/windbg --- radare2-2.3.0+dfsg/doc/windbg 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/windbg 1970-01-01 00:00:00.000000000 +0000 @@ -1,81 +0,0 @@ -WinDBG -====== - -The WinDBG support for r2 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. - -Bear in mind that WinDBG support is still work-in-progress, and this is -just an initial implementation which will get better in time. - -It is also possible to use the remote GDB interface to connect and -debug Windows kernels without depending on Windows capabilities. - -------8<--------------8<------------------8<------------------------ - -Enable WinDBG support on Windows Vista and higher like this: - - bcdedit /debug on - bcdedit /dbgsettings serial debugport:1 baudrate:115200 - -Or like this for Windows XP: - Open boot.ini and add /debug /debugport=COM1 /baudrate=115200: - - [boot loader] - timeout=30 - default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS - [operating systems] - multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Debugging with Cable" /fastdetect /debug /debugport=COM1 /baudrate=57600 - - -Configure the VirtualBox Machine like this: - - Preferences -> Serial Ports -> Port 1 - - [V] Enable Serial Port - Port Number: [_COM1_______[v]] - Port Mode: [_Host_Pipe__[v]] - [v] Create Pipe - Port/File Path: [_/tmp/windbg.pipe____] - -Or just spawn the VM with qemu like this: - - $ qemu-system-x86_64 -chardev socket,id=serial0,\ - path=/tmp/windbg.pipe,nowait,server \ - -serial chardev:serial0 -hda Windows7-VM.vdi - - -Radare2 will use the 'windbg' io plugin to connect to a socket file -created by virtualbox or qemu. Also, the 'windbg' debugger plugin and -we should specify the x86-32 too. (32 and 64 bit debugging is supported) - - $ r2 -a x86 -b 32 -D windbg windbg:///tmp/windbg.pipe - -On Windows you should run the following line: - - $ radare2 -D windbg windbg://\\.\pipe\com_1 - -At this point, we will get stuck here: - - [0x828997b8]> pd 20 - ;-- eip: - 0x828997b8 cc int3 - 0x828997b9 c20400 ret 4 - 0x828997bc cc int3 - 0x828997bd 90 nop - 0x828997be c3 ret - 0x828997bf 90 nop - -In order to skip that trap we will need to change eip and run 'dc' twice: - - dr eip=eip+1 - dc - dr eip=eip+1 - dc - -Now the Windows VM will be interactive again. We will need to kill r2 and -attach again to get back to control the kernel. - -In addition, the `dp` command can be used to list all processes, and -`dpa` or `dp=` to attach to the process. This will display the base -address of the process in the physical memory layout. diff -Nru radare2-2.3.0+dfsg/doc/windbg.md radare2-2.8.0+dfsg/doc/windbg.md --- radare2-2.3.0+dfsg/doc/windbg.md 1970-01-01 00:00:00.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/windbg.md 2018-08-07 14:12:36.000000000 +0000 @@ -0,0 +1,79 @@ +WinDBG +====== + +The WinDBG support for r2 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. + +Bear in mind that WinDBG support is still work-in-progress, and this is +just an initial implementation which will get better in time. + +It is also possible to use the remote GDB interface to connect and +debug Windows kernels without depending on Windows capabilities. + +Enable WinDBG support on Windows Vista and higher like this: + + bcdedit /debug on + bcdedit /dbgsettings serial debugport:1 baudrate:115200 + +Or like this for Windows XP: + Open boot.ini and add /debug /debugport=COM1 /baudrate=115200: + + [boot loader] + timeout=30 + default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS + [operating systems] + multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Debugging with Cable" /fastdetect /debug /debugport=COM1 /baudrate=57600 + + +Configure the VirtualBox Machine like this: + + Preferences -> Serial Ports -> Port 1 + + [V] Enable Serial Port + Port Number: [_COM1_______[v]] + Port Mode: [_Host_Pipe__[v]] + [v] Create Pipe + Port/File Path: [_/tmp/windbg.pipe____] + +Or just spawn the VM with qemu like this: + + $ qemu-system-x86_64 -chardev socket,id=serial0,\ + path=/tmp/windbg.pipe,nowait,server \ + -serial chardev:serial0 -hda Windows7-VM.vdi + + +Radare2 will use the 'windbg' io plugin to connect to a socket file +created by virtualbox or qemu. Also, the 'windbg' debugger plugin and +we should specify the x86-32 too. (32 and 64 bit debugging is supported) + + $ r2 -a x86 -b 32 -D windbg windbg:///tmp/windbg.pipe + +On Windows you should run the following line: + + $ radare2 -D windbg windbg://\\.\pipe\com_1 + +At this point, we will get stuck here: + + [0x828997b8]> pd 20 + ;-- eip: + 0x828997b8 cc int3 + 0x828997b9 c20400 ret 4 + 0x828997bc cc int3 + 0x828997bd 90 nop + 0x828997be c3 ret + 0x828997bf 90 nop + +In order to skip that trap we will need to change eip and run 'dc' twice: + + dr eip=eip+1 + dc + dr eip=eip+1 + dc + +Now the Windows VM will be interactive again. We will need to kill r2 and +attach again to get back to control the kernel. + +In addition, the `dp` command can be used to list all processes, and +`dpa` or `dp=` to attach to the process. This will display the base +address of the process in the physical memory layout. diff -Nru radare2-2.3.0+dfsg/doc/yara.md radare2-2.8.0+dfsg/doc/yara.md --- radare2-2.3.0+dfsg/doc/yara.md 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/yara.md 2018-08-07 14:12:36.000000000 +0000 @@ -4,13 +4,12 @@ Preliminary documentation on yara can be found here: [Yara User's Manual](https://b161268c3bf5a87bc67309e7c870820f5f39f672.googledrive.com/host/0BznOMqZ9f3VUek8yN3VvSGdhRFU/YARA-Manual.pdf) -The following is 'YARA in a nutshell' from this document: +The following is [YARA in a nutshell](https://virustotal.github.io/yara/) from this document: > YARA is a tool aimed at helping malware researchers to identify and classify malware families. With YARA you can create descriptions of malware families based on textual or binary information contained on samples of those families. These descriptions, a.k.a rules, -consist patterns and a boolean expression which determines its -logic. Rules can be +consist patterns and a boolean expression which determines its logic. Rules can be applied to files or running processes in order to determine if it belongs to the described malware family. diff -Nru radare2-2.3.0+dfsg/doc/zsh/_r2 radare2-2.8.0+dfsg/doc/zsh/_r2 --- radare2-2.3.0+dfsg/doc/zsh/_r2 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/zsh/_r2 2018-08-07 14:12:36.000000000 +0000 @@ -10,6 +10,7 @@ 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)' @@ -47,6 +48,7 @@ '(-v -V)-v[show radare2 version]' '(-v -V)-V[show radare2 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)]' ) @@ -55,7 +57,7 @@ case $state in arch) - local -a sub=(${(f)"$(r2_qc 'e asm.arch=?~[2,4-99]' | sed -E 's/ (.*)/[\1]/')"}) + local -a sub=(${(f)"$(r2_qc 'e asm.arch=?')"}) _values 'arch' $sub && ret=0 ;; asm.os) @@ -69,7 +71,7 @@ _values 'dbg.backend' $(r2 '-D?') && ret=0 ;; project) - _values 'project' $(r2 -p) && ret=0 + _values 'project' "${(f)"$(r2 -p)"}" && ret=0 ;; esac return ret diff -Nru radare2-2.3.0+dfsg/doc/zsh/_rabin2 radare2-2.8.0+dfsg/doc/zsh/_rabin2 --- radare2-2.3.0+dfsg/doc/zsh/_rabin2 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/zsh/_rabin2 2018-08-07 14:12:36.000000000 +0000 @@ -64,7 +64,7 @@ case $state in arch) - local -a sub=(${(f)"$(r2_qc 'e asm.arch=?~[2,4-99]' | sed -E 's/ (.*)/[\1]/')"}) + local -a sub=(${(f)"$(r2_qc 'e asm.arch=?')"}) _values 'arch' $sub && ret=0 ;; checksum) diff -Nru radare2-2.3.0+dfsg/doc/zsh/_radiff2 radare2-2.8.0+dfsg/doc/zsh/_radiff2 --- radare2-2.3.0+dfsg/doc/zsh/_radiff2 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/zsh/_radiff2 2018-08-07 14:12:36.000000000 +0000 @@ -42,7 +42,7 @@ case $state in arch) - local -a sub=(${(f)"$(r2_qc 'e asm.arch=?~[2,4-99]' | sed -E 's/ (.*)/[\1]/')"}) + local -a sub=(${(f)"$(r2_qc 'e asm.arch=?')"}) _values 'arch' $sub && ret=0 ;; esac diff -Nru radare2-2.3.0+dfsg/doc/zsh/_rafind2 radare2-2.8.0+dfsg/doc/zsh/_rafind2 --- radare2-2.3.0+dfsg/doc/zsh/_rafind2 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/zsh/_rafind2 2018-08-07 14:12:36.000000000 +0000 @@ -12,6 +12,7 @@ '-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' diff -Nru radare2-2.3.0+dfsg/doc/zsh/_ragg2 radare2-2.8.0+dfsg/doc/zsh/_ragg2 --- radare2-2.3.0+dfsg/doc/zsh/_ragg2 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/zsh/_ragg2 2018-08-07 14:12:36.000000000 +0000 @@ -42,7 +42,7 @@ case $state in arch) - local -a sub=(${(f)"$(r2_qc 'e asm.arch=?~[2,4-99]' | sed -E 's/ (.*)/[\1]/')"}) + local -a sub=(${(f)"$(r2_qc 'e asm.arch=?')"}) _values 'arch' $sub && ret=0 ;; asm.os) diff -Nru radare2-2.3.0+dfsg/doc/zsh/_ragg2-cc radare2-2.8.0+dfsg/doc/zsh/_ragg2-cc --- radare2-2.3.0+dfsg/doc/zsh/_ragg2-cc 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/zsh/_ragg2-cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ -#compdef ragg2-cc -local context state state_descr line -local -i ret=1 - -r2_qc() { - r2 -qc $1 -- -} - -_ragg2-cc() { - local -a options=( - '-a+[select architecture (x86, mips, arm)]: :->arch' - '-b+[register size (32, 64, ..)]:bits:(32 64)' - '-c[generate compiled shellcode]' - '-d[enable debug mode]' - "-k+[set kernel]: :->asm.os" - '-o+[set output file]: :_files' - '-s[generate assembly]' - '-v[show version]' - '-x[show hexpair bytes]' - ) - - _arguments -S -s : $options '1:file:_files' && ret=0 - - case $state in - arch) - local -a sub=(${(f)"$(r2_qc 'e asm.arch=?~[2,4-99]' | sed -E 's/ (.*)/[\1]/')"}) - _values 'arch' $sub && ret=0 - ;; - asm.os) - _values 'asm.os' $(r2_qc 'e asm.os=?') && ret=0 - ;; - esac - return ret -} - -_ragg2-cc "$@" - -# 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 -Nru radare2-2.3.0+dfsg/doc/zsh/_rax2 radare2-2.8.0+dfsg/doc/zsh/_rax2 --- radare2-2.3.0+dfsg/doc/zsh/_rax2 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/doc/zsh/_rax2 2018-08-07 14:12:36.000000000 +0000 @@ -12,8 +12,10 @@ '-f[floating point ; rax2 -f 6.3+2.1]' '-F[stdin slurp C hex ; rax2 -F < shellcode.c]' '-h[help ; rax2 -h]' + '-i[dump as C array ; rax2 -i < bytes]' '-k[keep base ; rax2 -k 33+3 -> 36]' '-K[randomart ; rax2 -K 0x34 1020304050]' + '-L[bin -> hex ; rax2 -L 1111111]' '-n[binary number ; rax2 -n 0x1234 # 34120000]' '-N[binary number ; rax2 -N 0x1234 # \x34\x12\x00\x00]' '-r[r2 style output ; rax2 -r 0x1234]' diff -Nru radare2-2.3.0+dfsg/Dockerfile radare2-2.8.0+dfsg/Dockerfile --- radare2-2.3.0+dfsg/Dockerfile 2018-01-29 10:36:59.000000000 +0000 +++ radare2-2.8.0+dfsg/Dockerfile 2018-08-07 14:12:36.000000000 +0000 @@ -28,8 +28,8 @@ # $ r2 -d /bin/true # -# Using debian 8 as base image. -FROM debian:8 +# Using debian 9 as base image. +FROM debian:9 # Label base LABEL r2docker latest @@ -62,6 +62,7 @@ libc6:i386 \ libncurses5:i386 \ libstdc++6:i386 \ + gnupg2 \ sudo && \ curl -sL https://deb.nodesource.com/setup_8.x | bash - && \ apt-get install -y nodejs python-pip && \ diff -Nru radare2-2.3.0+dfsg/Dockerfile.travis radare2-2.8.0+dfsg/Dockerfile.travis --- radare2-2.3.0+dfsg/Dockerfile.travis 1970-01-01 00:00:00.000000000 +0000 +++ radare2-2.8.0+dfsg/Dockerfile.travis 2018-08-07 14:12:36.000000000 +0000 @@ -0,0 +1,44 @@ +FROM fedora:28 + +MAINTAINER tbd + +WORKDIR /src + +RUN dnf install -y \ + gcc \ + gcc-c++ \ + clang \ + llvm \ + make \ + patch \ + findutils \ + which \ + bison \ + curl \ + git \ + binutils \ + cabextract \ + libasan \ + libcurl-devel \ + elfutils-libelf-devel \ + elfutils-libelf-devel-static \ + libdwarf-devel \ + libdwarf-static \ + jq \ + pkgconf-pkg-config \ + glib2 \ + glib2-devel \ + ncurses-devel \ + capstone-devel \ + libzip-devel \ + file-devel \ + lz4-devel \ + gnupg2 \ + python2-pip \ + meson \ + ninja-build \ + xz + +RUN rm -rf /src/.nvm && git clone https://github.com/creationix/nvm.git /src/.nvm && (cd /src/.nvm && git checkout `git describe --abbrev=0 --tags`) && . /src/.nvm/nvm.sh && nvm install 8.11.3 + +CMD [] diff -Nru radare2-2.3.0+dfsg/Doxyfile radare2-2.8.0+dfsg/Doxyfile --- radare2-2.3.0+dfsg/Doxyfile 1970-01-01 00:00:00.000000000 +0000 +++ radare2-2.8.0+dfsg/Doxyfile 2018-08-07 14:12:36.000000000 +0000 @@ -0,0 +1,2482 @@ +# Doxyfile 1.8.14 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all text +# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv +# built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = Radare2 + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = "unix-like reverse engineering framework and cli tools" + +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. + +#PROJECT_LOGO = doc/images/r2.svg + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = doc/doxygen + +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + +CREATE_SUBDIRS = YES + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = YES + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines (in the resulting output). You can put ^^ in the value part of an +# alias to insert a newline as if a physical newline was in the original file. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding "class=itcl::class" +# will allow you to use the command class in the itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, Javascript, +# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: +# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: +# Fortran. In the later case the parser tries to guess whether the code is fixed +# or free formatted code, this is the default for Fortran type files), VHDL. For +# instance to make doxygen treat .inc files as Fortran files (default is PHP), +# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# +# Note: For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 0. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 0 + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 1 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = YES + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = YES + +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. If set to YES, local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO, only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO, these classes will be included in the various overviews. This option +# has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# (class|struct|union) declarations. If set to NO, these declarations will be +# included in the documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO, these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES, upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. +# The default value is: system dependent. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES, the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO, doxygen will only warn about wrong or incomplete +# parameter documentation, but not about the absence of documentation. +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. +# The default value is: NO. + +WARN_AS_ERROR = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING +# Note: If this tag is empty the current directory is searched. + +INPUT = + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: https://www.gnu.org/software/libiconv/) for the list of +# possible encodings. +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, +# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, +# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf. + +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.idl \ + *.ddl \ + *.odl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.cs \ + *.d \ + *.php \ + *.php4 \ + *.php5 \ + *.phtml \ + *.inc \ + *.m \ + *.markdown \ + *.md \ + *.mm \ + *.dox \ + *.py \ + *.pyw \ + *.f90 \ + *.f95 \ + *.f03 \ + *.f08 \ + *.f \ + *.for \ + *.tcl \ + *.vhd \ + *.vhdl \ + *.ucf \ + *.qsf + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = doc/images + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = ./README.md + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = YES + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# function all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see https://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = YES + +# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in +# which the alphabetical index list will be split. +# Minimum value: 1, maximum value: 20, default value: 5. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all classes will +# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag +# can be used to specify a prefix (or a list of prefixes) that should be ignored +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). For an example see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the style sheet and background images according to +# this color. Hue is specified as an angle on a colorwheel, see +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use grayscales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to YES can help to show when doxygen was last run and thus if the +# documentation is up to date. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = NO + +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via Javascript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have Javascript, +# like the Qt help browser. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_MENUS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: https://developer.apple.com/tools/xcode/), introduced with +# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a +# Makefile in the HTML output directory. Running make will produce the docset in +# that directory and running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See https://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler (hhc.exe). If non-empty, +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the master .chm file (NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: http://doc.qt.io/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: http://doc.qt.io/qt-4.8/qthelpproject.html#virtual-folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://doc.qt.io/qt-4.8/qthelpproject.html#custom-filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://doc.qt.io/qt-4.8/qthelpproject.html#custom-filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# http://doc.qt.io/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location of Qt's +# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the +# generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = YES + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANSPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# https://www.mathjax.org) which uses client side Javascript for the rendering +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. See the MathJax site (see: +# http://docs.mathjax.org/en/latest/output.html) for more details. +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility), NativeMML (i.e. MathML) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from https://www.mathjax.org before deployment. +# The default value is: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/ + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /