21419 Commits

Author SHA1 Message Date
GustavoLCR
bafc2e2b72 Fix r_anal_block_automerge incorrectly merging blocks ##anal 2020-11-01 02:12:14 +01:00
Aswin C
089d1cdd54
Fix u? and improve uc? ##cons (#17795) 2020-11-01 01:50:09 +01:00
Khairul Azhar Kasmiran
fc16ceebb7
Do not skip blank lines in ~:s..e (#17872) ##cons 2020-11-01 01:17:55 +01:00
Liumeo
d4519ef324
Fix msvc warning c4090 in z80 (#17883) 2020-11-01 01:15:13 +01:00
Liumeo
3aca0298a8
Fix macos warning: overrides prior initialization (#17882) 2020-11-01 01:13:52 +01:00
pancake
8d0711dcc9
Add division overflow macros in r_types ##util (#17856) 2020-10-30 12:42:32 +08:00
Liumeo
898a29713a
Remove some of the ARM64 warnings (#17875) 2020-10-30 12:18:56 +08:00
Paul I
92501b0082
COFF: add ARMNT and ARM64 support ##bin (#17800) 2020-10-29 13:33:43 +08:00
Liumeo
50f5cca9d0
Fix ARM64 db/anal/x86_32 (#17861) 2020-10-29 12:50:36 +08:00
Paul I
626aada98e
Fix memleak in __anal_fcn_check_bp_use() (#17863)
* Fix memleak in __anal_fcn_check_bp_use()
* Fix indent
2020-10-29 12:50:07 +08:00
pancake
e9916a1914
Fix warnings in RBin.{dmp,elf} (#17865) 2020-10-28 10:21:07 +01:00
Liumeo
b0ee85edbf
Remove unnecessary macro ##refactor (#17821) 2020-10-28 11:24:47 +08:00
pancake
6db4dcb55a
Initialize variables in r_core_anal_type_match (#17834)
Co-authored-by: pancake <pancake@nopcode.org>
2020-10-28 10:59:01 +08:00
pancake
cb3d90c6de
Fix #17857 - Fix warnings (#17858) 2020-10-27 21:19:25 +01:00
pancake
b0228ca85b
Autocomplete e <tab> ##shell (#17855) 2020-10-27 19:05:57 +01:00
Heersin
df3d7a8e99
Extend usage info about '/*' and '*/' (#17851) 2020-10-27 14:42:08 +01:00
pancake
d54ceac382
Fix unexpected FPU exception in ESIL emulation ##esil (#17815)
* Fix unexpected FPU exception in ESIL emulation ##esil
* More fixes and add test
* Add comment

Co-authored-by: pancake <pancake@nopcode.org>
2020-10-27 11:58:20 +01:00
Hex
6ea0a08ecf
Add cfg.json.* encoding options (#17681) ##json 2020-10-27 11:46:27 +01:00
pancake
3a14d204ea
Do not show return code message in r2pipe api if it succeds (#17854)
Co-authored-by: pancake <pancake@nopcode.org>
2020-10-27 14:25:37 +08:00
pancake
6009345d63
Fix uninitialized usage of a variable, fix crash in r_str_append (#17830)
In file included from rtr.c:234:0:
rtr_http.c: In function 'r_core_rtr_http_run.isra.1':
rtr_http.c:403:44: warning: 'path' may be used uninitialized in this function [-Wmaybe-uninitialized]
      path = (*index == '/')? strdup (index): r_str_append (path, index);
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~

Co-authored-by: pancake <pancake@nopcode.org>
2020-10-27 14:24:55 +08:00
pancake
f786e73e07
Fix UB in r_core_cmd_init (#17832)
Co-authored-by: pancake <pancake@nopcode.org>
2020-10-26 18:33:25 +08:00
Dennis Goodlett
ceb661ca7a
Refactor r_sign metrics match ##signatures (#17786)
* Refactor r_sign metrics match ##signatures

This reduces the interface for matching function metrics to a single call. Now
each RSignItem is created once for all metric search types. Additionally, other
function data that is expensive to compute is now cached.

* Replace int with size_t

Co-authored-by: Dennis Goodlett <dennis@hurricanelabs.com>
2020-10-26 14:08:42 +08:00
pancake
137fdd0821
Fix warning in the JSON parser (#17827)
json_parser.c: In function 'parse_value':
json_parser.c:240:9: warning: 'new_key' may be used uninitialized in this function [-Wmaybe-uninitialized]
     p = parse_value (js, new_key, p);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

Co-authored-by: pancake <pancake@nopcode.org>
2020-10-26 14:07:15 +08:00
pancake
752787fdbc
Fix uninitialized pj instance in dreg.c (#17828)
dreg.c:294:3: warning: 'pj' may be used uninitialized in this function [-Wmaybe-uninitialized]

Co-authored-by: pancake <pancake@nopcode.org>
2020-10-26 14:06:18 +08:00
pancake
8eaf953b8a
Fix UB crash in cmd_kuery (#17835)
cmd.c:1510:3: warning: 'cur_cmd' may be used uninitialized in this function [-Wmaybe-uninitialized]

Co-authored-by: pancake <pancake@nopcode.org>
2020-10-26 14:05:10 +08:00
pancake
0f9b4604be
Initialize PJ pointer to avoid UB crashes (#17837)
Co-authored-by: pancake <pancake@nopcode.org>
2020-10-26 14:04:30 +08:00
pancake
c2865f1a2e
Fix uninitialized variable use in ostackptr (#17836)
disasm_stackptr.inc:124:29: warning: 'ostackptr' may be used uninitialized in this function [-Wmaybe-uninitialized]

Co-authored-by: pancake <pancake@nopcode.org>
2020-10-26 14:03:24 +08:00
pancake
cfb21c38e3
Fix UB in fcn_recurse (#17838)
```
fcn.c: In function 'fcn_recurse':
fcn.c:229:68: warning: 'omov_aop.disp' may be used uninitialized in this function [-Wmaybe-uninitialized]
   if (o_reg_dst && reg_src && o_reg_dst->offset == reg_src->offset && omov_aop.disp != UT64_MAX) {
fcn.c:181:10: note: 'omov_aop.disp' was declared here
  RAnalOp omov_aop, mov_aop = { 0 };
          ^~~~~~~~
fcn.c:229:17: warning: 'reg_src' may be used uninitialized in this function [-Wmaybe-uninitialized]
   if (o_reg_dst && reg_src && o_reg_dst->offset == reg_src->offset && omov_aop.disp != UT64_MAX) {
                 ^~
fcn.c:183:12: note: 'reg_src' was declared here
  RRegItem *reg_src, *o_reg_dst = NULL;
```

Co-authored-by: pancake <pancake@nopcode.org>
2020-10-26 14:03:02 +08:00
Paul I
dcd0f37817
Don't clear write cache in "aaa" (#17844) 2020-10-26 14:01:06 +08:00
Roman Hargrave
5aff070b0f
Make use of dbg.args on *nix and macos (#17846)
As with the windbg implementation of fork_and_ptraceme, this checks for
the presence io->args and appends them to the child command before
invoking it.

The primary purpose of this fix is to make argument-passing possible
when using Cutter to debug programs, as Cutter sets dbg.args in order to
pass user-provided arguments to the child task. Presently, this does not
do anything on *nix platforms, greatly limiting Cutter's usefulness
insofar as debugging.
2020-10-26 13:56:59 +08:00
David CARLIER
5e9fd04843
Fixing r_sys_pid_to_path for DragonFlyBSD ##util (#17842)
Same API and approach as FreeBSD.
2020-10-26 13:56:26 +08:00
x1nixmzeng
a25af4d367
Fix XBE format symbol name lookup ##bin (#17841) 2020-10-26 13:55:39 +08:00
pancake
0279929704
Fix bugs and improve pxr (add pxr[1248][j] to override asm.bits) ##print 2020-10-25 12:35:45 +01:00
eagleoflqj
6279aa6301 fix travis arm64 db/asm/dalvik 2020-10-25 01:32:02 +02:00
GustavoLCR
bae726b716
Fix prompt autocompletion when in graph mode (#17797)
* Fix prompt autocompletion when in graph mode
* Don't enter interactive graph mode if `scr.interactive=false`
2020-10-23 14:41:14 +08:00
Liumeo
7dafe64be5
Fix MSVC warning 'void' function returning a value (#17819) 2020-10-23 13:21:09 +08:00
David CARLIER
b1996da031
Setting ASLR support for DragonFlyBSD ##util (#17810)
Enable calls for rarun2
2020-10-22 16:26:53 +08:00
pancake
3fffa6f7e1
Fix #17804 - This has-main code in swift-sd.c is already in libdemangle (#17812)
Co-authored-by: pancake <pancake@nopcode.org>
2020-10-22 16:26:32 +08:00
Anton Kochkov
ade2fe1a02 Fix _ALIGN macro redefinition 2020-10-22 13:37:25 +08:00
Anton Kochkov
afba51ce98 Fix format warnings in libr/core 2020-10-22 13:37:25 +08:00
Liumeo
4287408a3e
Fix ARM64 db/tools/ragg2 (#17801) 2020-10-19 18:21:49 +08:00
eagleoflqj
9fb7fc3bcd fix travis arm64 db/tools/rasm2 2020-10-19 11:55:37 +02:00
Anton Kochkov
21907a565e Fix format string warnings 2020-10-19 11:50:06 +02:00
Riccardo Schirone
735b36ba51 Remove trailing whitespace 2020-10-19 11:50:06 +02:00
Liumeo
4a6b69b2d2
Fix ARM64 test_r2pipe_404 (#17796) 2020-10-19 12:47:31 +08:00
GustavoLCR
5f7f1b07cf
Fix #17790 - Fix crash when recovering MSVC RTTI on 32-bit host (#17794) 2020-10-19 12:28:01 +08:00
Fabian Freyer
9e586bf3b4
Fix incorrect esil of RISC-V jalr insn ##emu (#17788)
* The emitted esil for jalr was incorrect in the case where `rd` and
  `rs1` are equal, since then `rs1` is written to as `rd` before adding
  the immediate.

  For example, `jalr ra ra 0x42` was lifted to the following esil:

      4,$$,+,ra,=,ra,66,+,pc,=

  While this does correctly set rd to the return address after the call,
  pc is not correctly set according to `pc <- ra + 0x42`, but instead
  `pc <- pc + 4 + 66`.

  This commit flips the order of setting `pc` and `rd`, so that `rd` is
  read from before it is written to.
2020-10-16 12:53:05 +08:00
Fabian Freyer
e4d7f656ca
Fix incorrect esil of RISC-V auipc insn ##emu (#17787)
* According to the spec, the auipc instruction's immediate is a
  20-bit upper immediate, which means it should be left-shifted
  by 12 similar to the lui instruction:

  > AUIPC forms a 32-bit offset from the 20-bit U-immediate,
  > filling in the lowest 12 bits with zeros, adds this offset
  > to the address of the AUIPC instruction, then places the
  > result in register rd.
2020-10-16 12:52:42 +08:00
GustavoLCR
79de725396
Fixes for MSVC demangling (#17783)
* Support demangling nested names
* Support demangling RTTI operator codes
* Fix parsing function pointers with access modifier
2020-10-16 12:52:01 +08:00
Khairul Azhar Kasmiran
fb9aec2eb3
Fix pxd asan crash (#17789) 2020-10-15 18:14:03 +08:00