Commit Graph

302 Commits

Author SHA1 Message Date
Sergi Àlvarez i Capilla
aef278ee9c Make -Dblob=true statically link all r2 libraries ##build 2022-03-02 11:30:28 +01:00
Sergi Àlvarez i Capilla
46a69a5014 Fix all the latest covs which spotted new findings 2022-02-15 12:05:50 +01:00
pancake
467ca68d48
Save and check the reg arena size when peekpoking (Fix tests_64923) ##crash 2021-11-01 22:38:53 +01:00
Sergi Àlvarez i Capilla
59a9dfb60a Fix uaf crash in aaft (tests_64927) ##crash
Reported by giantbranch of NSFOCUS TIANJI Lab
2021-10-30 14:11:29 +02:00
pancake
e8d4e5cc9f
Fix the windows build regressions 2021-10-19 22:17:47 +02:00
pancake
93f6b4cd3b
Initial work towards supporting mingw32/64 again ##build 2021-10-18 23:58:16 +02:00
pancake
a242ecf943
Add one more RReg wrapper in RAnal for bindings (#18946) 2021-07-28 12:09:23 +02:00
pancake
352630295e
Polish some asserts here and there (#18927) 2021-07-23 09:36:10 +02:00
pancake
3231c0d585 Initial working implementation of =RS 2021-04-11 01:38:25 +02:00
pancake
4bb90e2399 Add =RS directive in reg profiles to define default value ##anal 2021-04-11 01:38:25 +02:00
pancake
fd1484525a
Implement drcq and show it in visual debug/emu ##debug (#18519)
Co-authored-by: pancake <pancake@nopcode.org>
2021-03-31 19:26:19 +02:00
pancake
f07bedfacd
Use proper types in some fields in IO to fix some potential issues 2021-03-04 18:32:59 +01:00
pancake
47358feb6d Improve reg profile parsing and error handling ##anal 2021-03-02 00:08:14 +01:00
Giovanni
5ffe3e4240 Fixing clang flow warnings (#321) ##rizin 2021-01-19 05:37:17 +01:00
eagleoflqj
d7631443b6 Fix s390x test_reg 2021-01-09 12:34:29 +01:00
pancake
d3157e2ed3
Fix 32 critical COVs (UAF, UB and OOB) (#18077) 2020-12-21 01:10:22 +01:00
Riccardo Schirone
741d22ed61
Use -Werror when building in CI (#17781) 2020-10-13 12:42:57 +02:00
pancake
413437e2b6
Move arp gdb into arpg, improve error and parsing + tests ##debug (#17658) 2020-09-16 19:16:24 +02:00
Khairul Azhar Kasmiran
73317d4955
r_reg_get_bytes: Return NULL if there are no bytes in the arena for the given regset type (#17657) 2020-09-16 18:14:43 +08:00
Khairul Azhar Kasmiran
d9057505dc
Set RPATH/RUNPATH on r2 libs too if local (#17639) 2020-09-15 09:16:14 +02:00
pancake
2ad2744796
Implement arcc command using the new r_reg_profile_to_cc API ##types (#17618) 2020-09-15 00:59:56 +02:00
Khairul Azhar Kasmiran
fe5b80d615
Fix asan r2pipe test by updating libasan and using LD_PRELOAD (#17594)
* Set LD_PRELOAD for unit tests
* Declare failed debug tests as broken if no assertion or Sanitizer in output
* Check for ASAN=1 in cmd_pipe test
* Set asan: true in the GitHubCI matrix
* Fix ttyname-related runtime error
* Upgrade asan build to Ubuntu 20.04
* Quick fix for reg/arena.c runtime error
2020-09-11 18:47:27 +08:00
Anisse Astier
a4c76ff641
Bring merge sort and insertion sort cmp function semantics together (#17473) ##util
Merge sort uses cmp (a, b) < 0 for its first test branch, and insertion
sort cmp (a, b) > 0 ; which means the 0 boundary goes in one case in one
branch, and in the other sort function in the other branch.

It makes it possible to support compare function that return true/false
instead of -1/0/1; although this isn't an acceptable use of
RListComparator, this prevents future bugs from appearing, because this
works with insertion sort, but not merge sort.

The main advantage of this patch is that both sort functions should sort
equal elements the same way. This stability is important for zignatures
for example.
2020-09-09 15:45:34 +02:00
Khairul Kasmiran
730e4b11bc r_reg_get_name_idx: Don't treat empty reg name differently from other invalid reg names 2020-08-28 23:14:09 +08:00
FXTi
bbc1c4ec7e
Add length check to r_reg_get_name_idx() (#17519)
* Update libr/reg/reg.c

Co-authored-by: Riccardo Schirone <ret2libc@users.noreply.github.com>

* Fix format

Co-authored-by: Riccardo Schirone <ret2libc@users.noreply.github.com>
2020-08-25 08:55:15 -05:00
Riccardo Schirone
594b940b7c
Fixes some of the issues in Travis (#17267)
* Do not check with r_return_ if the convention is present

Let's just assume the NULL default in such a case, so that architectures
for which we don't have a defined calling convention can still be
processed somehow by the analysis code. It won't be precise, but it's
better than nothing.

Also add a warning message so users are aware when the calling
convention is not defined.

* Fix oob-read when # is at the end of the cmd string

* Do not set TMPDIR when the new value is the empty string

When TMPDIR is set to empty value, clang+ld behaves in weird ways and
you cannot compile files from within the r2 shell (e.g. when using #!c
or #!cpipe)

* Use meson and add -lasan to pkgconfig files when sanitizer are used
2020-07-16 20:47:30 +08:00
Zi Fan
af485c0770
Fix non-working drt flg command and refactor (#17254) ##debug
* Refactor r_reg_get_list to support R_REG_TYPE_ALL
* Fix registers type in linux_x64 regprofile
* Add test for drt flg
2020-07-13 12:09:58 +02:00
pancake
160fc95e66
Use (void) instead of () in function signatures (#17026) ##refactoring
* Use (void) instead of () in function signatures
* Add test to avoid further contributions to commit the same mistake
2020-06-14 16:08:32 +02:00
Anton Kochkov
ffe743ef39
Fix #4056 - rename DEPS to R2DEPS ##build (#17020)
* Rename DEPS to R2DEPS
* Cleanup of sys/build.sh
2020-06-12 10:49:28 +08:00
pancake
7be2b26ec5
Use r_str_trim_head_ro instead of hacky while loops (#16416)
$ git grep IS_WHITE | grep while
2020-04-05 15:50:19 +02:00
radare
3f77b9a76b
Avoid duplicated module filenames to fix static.sh ##build (#16403) 2020-04-02 14:30:27 +02:00
radare
3099a82256
Hide 128reg warnings and use rgb: instead of # in pal test (#16220) 2020-03-16 13:21:54 +01:00
Khairulmizam Samsudin
bb389101da
Make r_reg_get_list() search harder (#16202) ##reg 2020-03-13 12:01:54 +01:00
Khairulmizam Samsudin
d6fa5a9442
Enhance r_reg_get_pack() and r_reg_set_pack() (#16172)
* Add warning if packbits larger than 64bit
* Fix out of bound checking to consider max packed_size
2020-03-10 10:35:09 +01:00
radare
72093ac706
Fix #16138 - Do not preincrement when it's not necessary (#16151) 2020-03-05 19:06:59 +01:00
radare
1be8f02906
Add test for r_reg_get_value() and r_reg_set_value() (#16136) ##test 2020-03-05 14:42:47 +01:00
Khairulmizam Samsudin
ae1ef3ffbe
Create RReg test unit (#16081)
* Add test for r_reg_set_name() and r_reg_get_name()
* Add test for r_reg_set_profile_string()
* Add test for r_reg_setv() and r_reg_getv()
2020-03-02 13:39:47 +08:00
Xiao Di Guan
3a0dd576c0 Fix bounds check for flag registers in last byte of arena (#12949) (#15893) 2020-01-26 16:19:19 +01:00
yossizap
71669c2cb3 Added register specific comment parsing to register profiles ##debug 2020-01-14 11:35:13 +01:00
yossizap
3c0267fc0a Fix gdbr's reg_write and reg_next_diff for reverse stepping ##debug
Writing registers with gdbr worked with single registers because
reg_next_diff started at delta 0 and only had to run the diff once for
the single register that was changed. When running reverse
stepping/continue, multiple registers are changed at once so
r_reg_next_diff would fail every time due to incorrect offset calculation.
The new r_reg_next_diff also support different register sizes to restore
all registers correctly.
The endianity swapping part from reg_write isn't needed since the arena
is the return value of 'g' which is already in the correct target byte
order (see: https://sourceware.org/gdb/onlinedocs/gdb/Packets.html#read-registers-packet)
2019-11-18 22:56:56 -06:00
Armin Weihbold
82047cc580 Add experimental ymm regs support for linux-x64 and extend drm command ##debug 2019-11-07 17:23:18 +01:00
Armin Weihbold
1015d9dfe4 Refactor drm to be ready for the YMM registers (#15394) 2019-11-01 02:56:14 +01:00
pancake
4b2bf8dccd Fix assert 2019-10-30 23:33:33 +01:00
pancake
23540846db Add some asserts in rreg 2019-10-30 20:17:00 +01:00
Armin Weihbold
b9874fb102 Add support for setting xmm registers on linux (#15365) ##debug 2019-10-27 17:38:36 +01:00
Florian Märkl
aad2a2c79e Link sdb fully into r_util in meson (#15338) ##build 2019-10-23 15:52:19 +02:00
Riccardo Schirone
3afba69a5b r_reg_get_pack/r_reg_set_pack are not able to deal with 128 packbits ##debug 2019-10-22 23:09:35 +02:00
pancake
7bcac956b1 Fix zero register set issue ##r2wars
aer x0=0;aer zr=0xffffffff;aer?x0
2019-09-06 18:17:30 +02:00
pancake
3113d2acaf Massage two more assertions 2019-08-30 15:24:35 +02:00
pancake
ff7b52874a Blindfix more null derefs in reg.value 2019-08-30 04:44:55 +02:00