21604 Commits

Author SHA1 Message Date
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
Riccardo Schirone
81e487429f
Use -Wno-cpp to avoid errors on #warning (#17785) 2020-10-14 16:57:07 +08:00
GustavoLCR
623c4819d6
Fix some warnings in WinDBG plugin (#17784) 2020-10-14 14:51:11 +08:00
pancake
6b6f88efd3
Speedup r2pipe-spawn: r2 -0 sets scr.prompt=0 do not autocomplete or log ##r2pipe (#17767) 2020-10-13 22:45:45 +02:00
Riccardo Schirone
1e58692071
Fix incorrect uses of printf-like functions ##refactor (#17648) 2020-10-13 16:26:15 +02:00
pancake
a761eb1d5a
Add initial function prelude support for v850 ##anal (#17779) 2020-10-13 15:45:24 +02:00
pancake
7c9280866d
Fix and improve ?e? help message (#17765) 2020-10-13 15:44:39 +02:00
Aswin C
e08b963ada
Improve help under v? ##cons (#17743) 2020-10-13 14:27:36 +02:00
Riccardo Schirone
741d22ed61
Use -Werror when building in CI (#17781) 2020-10-13 12:42:57 +02:00
Riccardo Schirone
ce143ac837
Do not free ds->opstr after r_parse_immtrim (#17728)
There is no new allocation in r_parse_immtrim, so it is not required to
free the "previous" string.
2020-10-13 12:40:35 +02:00
Vasilij Schneidermann
e3999b7fcd
Add help string for path input prompt (#17742) 2020-10-13 12:48:49 +08:00
pancake
34285a1ed4
Set v850 disassembler when opening v800 ELF files ##bin (#17778) 2020-10-13 02:30:11 +02:00
tantei3
6c89716d44
Add support for listing parsers, bits and add Lp command ##shell (#17741)
* Add support for listing parsers, bits and add `Lp` command
* Populate option fields for `asm.parser` and `asm.bits` instead of printing, now tab autocompletion works
* Use `r_str_newf()` function instead of snprintf for updating `asm.bits`
* Add test case for Lp command
2020-10-10 17:38:01 +08:00
pancake
dbd1f867f1
BLR on arm64 is an RCALL, not an UCALL ##anal (#17769)
Co-authored-by: pancake <pancake@nopcode.org>
2020-10-10 17:35:51 +08:00
pancake
b42fe2c807
Complete v850 instruction descriptions ##asm (#17764)
Co-authored-by: pancake <pancake@nopcode.org>
2020-10-10 12:14:49 +08:00
junchao-loongson
91529d744c
Improve mips.gnu esil ##anal (#17722) 2020-10-10 12:13:19 +08:00