Showing with 2,226 additions and 985 deletions.
  1. +4 −4 .appveyor.yml
  2. +1 −1 .github/ISSUE_TEMPLATE/bug_report.md
  3. +2 −3 CONTRIBUTING.md
  4. +1 −1 DEVELOPERS.md
  5. +4 −3 README.md
  6. +6 −3 binr/r2pm/r2pm
  7. +4 −4 configure
  8. +1 −1 configure.acr
  9. +1 −0 doc/fortunes.fun
  10. +4 −0 doc/rapatch.md
  11. +1 −1 doc/repo
  12. +5 −3 libr/anal/anal.c
  13. +4 −3 libr/anal/esil.c
  14. +3 −1 libr/anal/esil2reil.c
  15. +124 −159 libr/anal/fcn.c
  16. +19 −13 libr/anal/meta.c
  17. +4 −0 libr/anal/p/anal_arm_cs.c
  18. +5 −4 libr/anal/p/anal_avr.c
  19. +15 −6 libr/anal/p/anal_i4004.c
  20. +18 −11 libr/anal/p/anal_m680x_cs.c
  21. +1 −1 libr/anal/p/anal_sh.c
  22. +5 −1 libr/anal/p/anal_x86_cs.c
  23. +2 −2 libr/anal/reflines.c
  24. +106 −2 libr/anal/sign.c
  25. +33 −8 libr/anal/type.c
  26. +7 −1 libr/asm/arch/i4004/i4004dis.c
  27. +2 −2 libr/asm/p/asm_m680x_cs.c
  28. +5 −5 libr/bin/bfile.c
  29. +2 −1 libr/bin/bin.c
  30. +3 −2 libr/bin/bobj.c
  31. +7 −11 libr/bin/format/mach0/mach0.c
  32. +11 −9 libr/bin/format/ne/ne.c
  33. +4 −5 libr/bin/format/wasm/wasm.c
  34. +7 −6 libr/bin/p/bin_dex.c
  35. +1 −1 libr/bin/p/bin_elf.inc
  36. +2 −2 libr/bin/p/bin_pe.c
  37. +2 −2 libr/bin/p/bin_pe64.c
  38. +1 −0 libr/cons/cons.c
  39. +39 −16 libr/cons/dietline.c
  40. +1 −1 libr/cons/line.c
  41. +13 −5 libr/cons/output.c
  42. +2 −1 libr/cons/pipe.c
  43. +2 −10 libr/core/agraph.c
  44. +5 −2 libr/core/blaze.c
  45. +42 −36 libr/core/canal.c
  46. +12 −7 libr/core/cbin.c
  47. +26 −1 libr/core/cconfig.c
  48. +1 −0 libr/core/citem.c
  49. +50 −38 libr/core/cmd.c
  50. +220 −61 libr/core/cmd_anal.c
  51. +26 −0 libr/core/cmd_debug.c
  52. +3 −3 libr/core/cmd_info.c
  53. +2 −0 libr/core/cmd_meta.c
  54. +15 −24 libr/core/cmd_print.c
  55. +5 −1 libr/core/cmd_search.c
  56. +12 −162 libr/core/cmd_type.c
  57. +74 −30 libr/core/cmd_write.c
  58. +30 −0 libr/core/cmd_zign.c
  59. +51 −39 libr/core/disasm.c
  60. +61 −40 libr/core/panels.c
  61. +15 −15 libr/core/patch.c
  62. +1 −0 libr/core/visual.c
  63. +200 −47 libr/core/windows_heap.c
  64. +1 −0 libr/debug/meson.build
  65. +21 −1 libr/debug/p/debug_gdb.c
  66. +8 −4 libr/debug/p/debug_native.c
  67. +463 −0 libr/debug/p/native/windows/windows_message.c
  68. +11 −0 libr/debug/p/native/windows/windows_message.h
  69. +21 −1 libr/debug/p/native/xnu/xnu_debug.c
  70. +1 −0 libr/debug/p/native/xnu/xnu_debug.h
  71. +1 −1 libr/debug/plugin.c
  72. +1 −2 libr/flag/flag.c
  73. +8 −2 libr/include/r_anal.h
  74. +2 −1 libr/include/r_bin.h
  75. +8 −1 libr/include/r_cons.h
  76. +4 −1 libr/include/r_core.h
  77. +6 −6 libr/include/r_endian.h
  78. +3 −0 libr/include/r_sign.h
  79. +3 −2 libr/include/r_types.h
  80. +15 −15 libr/include/r_util/r_buf.h
  81. +6 −0 libr/include/r_util/r_table.h
  82. +2 −2 libr/include/sdb/ht_pp.h
  83. +2 −2 libr/include/sdb/ht_up.h
  84. +1 −1 libr/include/sdb/sdb_version.h
  85. +23 −0 libr/include/sdb/set.h
  86. +5 −0 libr/io/Makefile
  87. +5 −18 libr/io/cache.c
  88. +2 −6 libr/io/ioutils.c
  89. +8 −6 libr/io/meson.build
  90. +3 −13 libr/io/p/io_default.c
  91. +2 −1 libr/io/p/io_ihex.c
  92. +2 −2 libr/io/p/io_rap.c
  93. +13 −1 libr/io/p/io_self.c
  94. +50 −40 libr/io/p/io_shm.c
  95. +2 −2 libr/io/p/io_zip.c
  96. +2 −0 libr/lang/p/zig.c
  97. +3 −1 libr/main/radare2.c
  98. +3 −1 libr/main/radiff2.c
  99. +4 −0 libr/meson.build
  100. +3 −0 libr/reg/value.c
  101. +3 −0 libr/util/file.c
  102. +3 −3 libr/util/print.c
  103. +1 −0 libr/util/sandbox.c
  104. +1 −0 libr/util/sdb.mk
  105. +2 −2 libr/util/sys.c
  106. +44 −4 libr/util/table.c
  107. +1 −1 libr/util/thread.c
  108. +1 −0 libr/util/utf8.c
  109. +4 −3 libr/util/w32-sys.c
  110. +2 −0 plugins.static.cfg
  111. +1 −1 shlr/gdb/src/gdbclient/core.c
  112. +9 −0 shlr/heap/include/r_windows/windows_heap.h
  113. +5 −0 shlr/meson.build
  114. +1 −1 shlr/sdb/config.mk
  115. +1 −0 shlr/sdb/meson.build
  116. +1 −1 shlr/sdb/src/Makefile
  117. +1 −0 shlr/sdb/src/ht_inc.c
  118. +2 −2 shlr/sdb/src/ht_pp.h
  119. +2 −2 shlr/sdb/src/ht_up.h
  120. +3 −4 shlr/sdb/src/sdb.c
  121. +2 −0 shlr/sdb/src/sdbht.c
  122. +47 −0 shlr/sdb/src/set.c
  123. +23 −0 shlr/sdb/src/set.h
  124. +1 −1 sys/ldconfig.sh
  125. +8 −3 sys/meson.py
  126. +3 −2 sys/osx-pkg.sh
  127. +1 −1 t/Makefile
8 changes: 4 additions & 4 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ install:
build_script:
- appveyor AddMessage "Compiling radare2 %R2_VERSION% (%builder%)"

- cmd: if %builder% == vs2017_64 ( set "PATH=C:\mingw\bin;C:\mingw\msys\1.0\bin;%PYTHON%;%PATH%" && call "%VSVARSALLPATH%" x64 && python sys\meson.py --backend vs2017 --release --xp --install="%DIST_FOLDER%" --options static_runtime=true && 7z a %ARTIFACT_ZIP% %DIST_FOLDER% )
- cmd: if %builder% == vs2017_64 ( set "PATH=C:\mingw\bin;C:\mingw\msys\1.0\bin;%PYTHON%;%PATH%" && call "%VSVARSALLPATH%" x64 && python sys\meson.py --backend vs2017 --release --xp --install="%DIST_FOLDER%" --webui --options static_runtime=true && 7z a %ARTIFACT_ZIP% %DIST_FOLDER% )

- cmd: if %builder% == vs2017_64_dyn ( set "PATH=C:\mingw\bin;C:\mingw\msys\1.0\bin;%PYTHON%;%PATH%" && call "%VSVARSALLPATH%" x64 && python sys\meson.py --release --shared --install="%DIST_FOLDER%" && 7z a %ARTIFACT_ZIP% %DIST_FOLDER% )
- cmd: if %builder% == vs2017_64_dyn ( set "PATH=C:\mingw\bin;C:\mingw\msys\1.0\bin;%PYTHON%;%PATH%" && call "%VSVARSALLPATH%" x64 && python sys\meson.py --release --shared --install="%DIST_FOLDER%" --webui && 7z a %ARTIFACT_ZIP% %DIST_FOLDER% )

- cmd: if %builder% == clang_cl_64_dyn ( set "PATH=C:\mingw\bin;C:\mingw\msys\1.0\bin;%PYTHON%;%PATH%" && call "%VSVARSALLPATH%" x64 && set CC=clang-cl && python sys\meson.py --release --shared --install="%DIST_FOLDER%" && 7z a %ARTIFACT_ZIP% %DIST_FOLDER% )
- cmd: if %builder% == clang_cl_64_dyn ( set "PATH=C:\mingw\bin;C:\mingw\msys\1.0\bin;%PYTHON%;%PATH%" && call "%VSVARSALLPATH%" x64 && set CC=clang-cl && python sys\meson.py --release --shared --install="%DIST_FOLDER%" --webui && 7z a %ARTIFACT_ZIP% %DIST_FOLDER% )

test_script:
- set PATH=%APPVEYOR_BUILD_FOLDER%\%DIST_FOLDER%\bin;C:\msys64\mingw64\bin;%PATH%
Expand All @@ -67,7 +67,7 @@ test_script:
- radare2 -v
- ps: Install-Product node $env:nodejs_version
- node --version
- git clone https://github.com/radare/radare2-regressions
- git clone https://github.com/radareorg/radare2-regressions
- cd radare2-regressions/new
- ps: $env:pull_owner=($env:APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME -split "/")[0]
- ps: if (-not [string]::IsNullOrWhiteSpace($env:pull_owner)) {cmd /c "(git fetch https://github.com/%pull_owner%/radare2-regressions %APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH%:%pull_owner%_%APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH% && git checkout %pull_owner%_%APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH%) > nul 2>&1 || exit 0"} else {echo "Using master"}
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Make sure you are testing using the latest git version of radare2 before submitt
- Please share the binary if it is shareable by drag and dropping it here in a zip archive (mandatory)
- Use asciinema to describe the issue and share the link here (mandatory if u can't share the binary)
- Use code markdown `CODE` to make your code visible
- Or even better, create a Pull-Request for the https://github.com/radare/radare2-regressions containing the test case examples can be found in the t/ folder see for example https://github.com/radare/radare2-regressions/blob/master/t/cmd_search#L7
- Or even better, create a Pull-Request for the https://github.com/radareorg/radare2-regressions containing the test case examples can be found in the t/ folder see for example https://github.com/radareorg/radare2-regressions/blob/master/t/cmd_search#L7

### Additional Logs, screenshots, source-code, configuration dump, ...

Expand Down
5 changes: 2 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ try to keep the codebase consistent and clean.
* Check for coding style issues with ```git diff master..mybranch | ./sys/clang-format-diff.py -p1``` and be sure to follow the CODINGSTYLE (more on this in [DEVELOPERS.md](https://github.com/radare/radare2/blob/master/DEVELOPERS.md)).
* Submit the Pull Request(PR) on Github.
* When relevant, write a test for
[radare2-regressions](https://github.com/radare/radare2-regressions) and
[radare2-regressions](https://github.com/radareorg/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
NOTE: when merging PRs, *always* merge the radare2-regressions PR
first.

# Additional resources
Expand Down
2 changes: 1 addition & 1 deletion DEVELOPERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ in the code for various reasons.
The source of the radare2 regression test suite can be found in the
following github repository.
```sh
git clone git://github.com/radare/radare2-regressions
git clone git://github.com/radareorg/radare2-regressions
```

See the `README.md` file in that repository for further information.
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
--pancake
```

| | |
| Service | Badge |
|----------|---------------------------------------------------------------------|
| **Jenkins** | [![Build Status](http://ci.rada.re/buildStatus/icon?job=radare2)](http://ci.rada.re/job/radare2)|
| **TravisCI** | [![Build Status](https://travis-ci.org/radare/radare2.svg?branch=master)](https://travis-ci.org/radare/radare2)|
| **AppVeyor** | [![Build Status](https://ci.appveyor.com/api/projects/status/v9bxvsb1p6c3cmf9/branch/master?svg=true)](https://ci.appveyor.com/project/radare/radare2-shvdd)|
| **Coverity** | [![Build Status](https://scan.coverity.com/projects/416/badge.svg)](https://scan.coverity.com/projects/416) |
Expand All @@ -37,6 +36,8 @@ radare2 is portable.

To learn more on radare2 you may want to read the [official radare2 book](https://radare.gitbooks.io/radare2book/content/).

You can also use [r2lrn](https://github.com/0ki/r2lrn) or r2golf for a hands-on learning experience.

## Operating Systems

Windows (since XP), GNU/Linux, OS X, [Net|Free|Open]BSD,
Expand Down Expand Up @@ -125,7 +126,7 @@ Look at [CONTRIBUTING.md](https://github.com/radare/radare2/blob/master/CONTRIBU

## Tests

Running `make tests` will fetch the [radare2-regressions](https://github.com/radare/radare2-regressions)
Running `make tests` will fetch the [radare2-regressions](https://github.com/radareorg/radare2-regressions)
repository and run all the tests in order to verify that no changes break any functionality.

We run those tests on every commit, and they are also executed with ASAN
Expand Down
9 changes: 6 additions & 3 deletions binr/r2pm/r2pm
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ fi
mkdir -p "${R2PM_USRDIR}/pkg/"
mkdir -p "${R2PM_GITDIR}"
mkdir -p "${R2PM_PLUGDIR}"
mkdir -p "${R2PM_BINDIR}"

R2PM_SYSPKG() {
IS_SYSPKG="$1"
Expand Down Expand Up @@ -266,6 +267,8 @@ R2PM_TGZ() {
TARBALL="`basename $1`"
if [ -z "$2" ]; then
DIR="`echo ${TARBALL} | awk -F .t '{print $1}'`"
elif [ "${2%${2#?}}"x = '/x' ]; then
DIR="${2#?}"
else
DIR="$2"
fi
Expand All @@ -290,7 +293,7 @@ R2PM_TGZ() {
elif [ "`echo ${URL} | grep -e .txz -e tar`" ]; then
tar xvf "${TARBALL}"
elif [ "`echo ${URL} | grep -e .zip`" ]; then
if [ -n "$2" ]; then
if [ -n "$2" ] && [ "${2%${2#?}}"x != '/x' ]; then
unzip -d "${DIR}" -o "${TARBALL}"
else
unzip "${TARBALL}"
Expand Down Expand Up @@ -692,8 +695,8 @@ suicide)
Usage: r2pm [init|update|cmd] [...]
Commands:
-I,info information about repository and installed packages
-i,install <pkgname> install package in your home (pkgname=all)
-gi,global-install <pkg> install package system-wide
-i,install <pkgname> install or update package in your home (pkgname=all)
-gi,global-install <pkg> install or update package system-wide
-gu,global-uninstall <pkg> uninstall pkg from systemdir
-u,uninstall <pkgname> r2pm -u baleful (-uu to force)
-l,list list installed pkgs
Expand Down
8 changes: 4 additions & 4 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ done
: ${INSTALL_PROGRAM_STRIP:=${INSTALL} -m 755 -s}
: ${INSTALL_MAN:=${INSTALL} -m 444}
: ${INSTALL_LIB:=${INSTALL} -m 755 -c}
PKGNAME='radare2' ; VERSION='3.8.0' ; CONTACT_MAIL="pancake@nopcode.org" ; CONTACT_NAME="pancake" ; CONTACT="pancake <pancake@nopcode.org>" ;
PKGNAME='radare2' ; VERSION='3.9.0' ; CONTACT_MAIL="pancake@nopcode.org" ; CONTACT_NAME="pancake" ; CONTACT="pancake <pancake@nopcode.org>" ;
}

show_usage() {
cat <<EOF2
'configure' configures radare2-3.8.0 to adapt to many kinds of systems.
'configure' configures radare2-3.9.0 to adapt to many kinds of systems.
Usage: ./configure [OPTION]... [VAR=VALUE]...
Expand Down Expand Up @@ -214,7 +214,7 @@ take_environ() {
}

show_version() {
echo "radare2-3.8.0 configuration script done with acr v1.7.2.
echo "radare2-3.9.0 configuration script done with acr v1.7.2.
The 'Free Software Foundation' message is only for autodetection.
Originally written by pancake <nopcode.org>."
exit 0
Expand All @@ -238,7 +238,7 @@ case $flag in
show_version ; ;;
-r|--r|--report)
echo "PKGNAME: radare2"
echo "VERSION: 3.8.0"
echo "VERSION: 3.9.0"
echo "LANGS: c"
echo "REQUIRED: libdl"
echo "OPTIONAL: libmagic libz libzip libxxhash libssl liblibuv>=1.0.0"
Expand Down
2 changes: 1 addition & 1 deletion configure.acr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PKGNAME radare2
VERSION 3.8.0
VERSION 3.9.0
CONTACT pancake ; pancake@nopcode.org

LANG_C!
Expand Down
1 change: 1 addition & 0 deletions doc/fortunes.fun
Original file line number Diff line number Diff line change
Expand Up @@ -279,3 +279,4 @@ Long time no C
radare2 is power, France is pancake.
Come to C me!
Unable to locate package gdb
You C it, you fix it!
4 changes: 4 additions & 0 deletions doc/rapatch.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@ Running rapatches
-----------------

$ r2 -P rapatch.txt target-program.txt

Or for scripted patching like `patch(1)`:

$ r2 -w -q -P rapatch.txt target-program.txt
2 changes: 1 addition & 1 deletion doc/repo
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ IRED=https://github.com/radare/ired
EXTRAS=https://github.com/radare/radare2-extras
CAPSTONE=https://github.com/radare/radare2-capstone
BINDINGS=https://github.com/radare/radare2-bindings
REGRESSIONS=https://github.com/radare/radare2-regressions
REGRESSIONS=https://github.com/radareorg/radare2-regressions
PR_REGRESSIONS=https://github.com/__USER__/radare2-regressions
[ -z "$1" ] && grep -h $0 | grep -v grep || eval echo \$$1
8 changes: 5 additions & 3 deletions libr/anal/anal.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,10 @@ R_API RAnal *r_anal_free(RAnal *a) {
return NULL;
}
/* TODO: Free anals here */
R_FREE (a->cpu);
R_FREE (a->os);
R_FREE (a->zign_path);
set_u_free (a->visited);
free (a->cpu);
free (a->os);
free (a->zign_path);
r_list_free (a->plugins);
a->fcns->free = r_anal_fcn_free;
r_list_free (a->fcns);
Expand Down Expand Up @@ -805,6 +806,7 @@ R_API void r_anal_merge_hint_ranges(RAnal *a) {
}
range_bits = bits;
}
ls_free (sdb_range);
a->merge_hints = false;
}
}
Expand Down
7 changes: 4 additions & 3 deletions libr/anal/esil.c
Original file line number Diff line number Diff line change
Expand Up @@ -1844,12 +1844,13 @@ static bool esil_poke_some(RAnalEsil *esil) {
r_anal_esil_get_parm_size (esil, foo, &tmp, &regsize);
isregornum (esil, foo, &num64);
r_write_ble (b, num64, esil->anal->big_endian, regsize);
const ut32 written = r_anal_esil_mem_write (esil, ptr, b, regsize);
if (written != regsize) {
const int size_bytes = regsize / 8;
const ut32 written = r_anal_esil_mem_write (esil, ptr, b, size_bytes);
if (written != size_bytes) {
//eprintf ("Cannot write at 0x%08" PFMT64x "\n", ptr);
esil->trap = 1;
}
ptr += regsize/8;
ptr += size_bytes;
free (foo);
}
}
Expand Down
4 changes: 3 additions & 1 deletion libr/anal/esil2reil.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ static bool reil_eq(RAnalEsil *esil) {
// No direct register to register transfer.
ins = R_NEW0 (RAnalReilInst);
if (!ins) {
free (src);
free (dst);
return false;
}
ins->opcode = REIL_STR;
Expand Down Expand Up @@ -1172,7 +1174,7 @@ R_API int r_anal_esil_to_reil_setup(RAnalEsil *esil, RAnal *anal, int romem,
#define OT_REGW R_ANAL_ESIL_OP_TYPE_REG_WRITE
#define OT_MEMW R_ANAL_ESIL_OP_TYPE_MEM_WRITE
#define OT_MEMR R_ANAL_ESIL_OP_TYPE_MEM_READ

r_anal_esil_set_op(esil, "=", reil_eq, 0, 2, OT_REGW);
r_anal_esil_set_op(esil, "+", reil_add, 1, 2, OT_MATH);
r_anal_esil_set_op(esil, "+=", reil_addeq, 0, 2, OT_MATH | OT_REGW);
Expand Down
Loading