Commit Graph

2836 Commits

Author SHA1 Message Date
GustavoLCR
0dcac185dc
Fix another UAF in skyline ##Refactor (#17972)
* Fix another UAF in skyline
* Simplify

* r_vector_insert() accepts assign at last index
* No need to check for parts that fit/overlap with new_part if new_part itself fitted inside a prev_part
2020-11-27 12:23:44 +08:00
GustavoLCR
ee46646df8
Set realname for PDB flags (#17967) 2020-11-27 12:22:58 +08:00
GustavoLCR
d47616fc1b
Fix UAF in r_skyline_add() (#17965) 2020-11-24 03:41:41 +01:00
GustavoLCR
203878e60e
Optimize io.cache ##io (#17952)
* Add RSkyline ##util
* Add `r_vector_len()`
* Optimize io.cache ##io
* Use RSkyline instead of RList
* Add cache skyline for faster reads
* Use PJ API in `wcj`
* Add test and fix
2020-11-23 12:36:32 +08:00
Paul I
890b19a1f6
Use offset info in r_type_get_struct_memb() (#17930) 2020-11-19 11:52:01 +08:00
Anton Kochkov
5da1b3b076 Fix some warnings 2020-11-16 18:56:21 +08:00
Liumeo
d9000c0214
Fix ctime/asctime and refactor r_asctime_r ##refactor (#17911) 2020-11-12 12:25:33 +08:00
Anton Kochkov
aaccc09828 Variadic argument fixes 2020-11-10 11:11:45 +08:00
Anton Kochkov
01ed730eac Fix Windows tests 2020-11-09 18:52:16 +08:00
GustavoLCR
a26f6c5656
Fix r_core_editor() on Windows (#17887) ##windows 2020-11-02 16:09:53 +01:00
condret
965b0fa4e0 Implement first/last/next/prev fd APIs ##io 2020-11-01 11:33:31 +01:00
pancake
d08ea37ae9 Code cleanup in R_IO 2020-11-01 11:33:31 +01:00
Hex
6ea0a08ecf
Add cfg.json.* encoding options (#17681) ##json 2020-10-27 11:46:27 +01: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
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
pancake
0279929704
Fix bugs and improve pxr (add pxr[1248][j] to override asm.bits) ##print 2020-10-25 12:35:45 +01:00
David CARLIER
b1996da031
Setting ASLR support for DragonFlyBSD ##util (#17810)
Enable calls for rarun2
2020-10-22 16:26:53 +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
karliss
bdb88df38c
Graph refactor ##refactor (#17631)
* Support more output modes for class inheritence graph.
* Refactor codexrefs and importxrefs graphs.
* Add ag_w for the commands using new mechanism.
* Separate drawable graph from r_graph.
2020-10-06 10:57:51 +08:00
Riccardo Schirone
187f314c49
Unwrap quoted strings when passing args to newer handlers ##newshell (#17732)
* Unwrap quoted strings when passing args to newer handlers ##newshell

When a user wraps an argument, it means like in SH that he wants the
command to consider the argument as one single arg, even if composed by
multiple words. The same applies for r2newshell. So far we did not
unwrap quoted strings to maintain compatibility with old shell, but
doing this unwrapping is one of the nice feature of newshell.

* Add tests for quoting/unquoting

* Adjust tests with `w` for newshell/oldshell
2020-09-30 14:25:38 +08:00
Riccardo Schirone
c7b3dc9e65
Remove sig_t because not used (#17712) 2020-09-25 15:37:33 +02:00
pancake
62c2128b6f
Better use of the R_SOCKET_PROTO_DEFAULT and add _NONE (#17644)
* Better use of the R_SOCKET_PROTO_DEFAULT and add _NONE ##http

* Fix regressions in: r2 -C and =+ ##r2pipe

Introduced in 04edfa82c1

* Implement sleep command ##shell

* Add tests for the webserver and remoting

* Implement daemon directive in rarun2, fix http test ##rarun2

* Fix socket timeout on Windows (patch by @GustavoLCR) ##socket

* Missing http.root is not a reason to not start the webserver ##http

* Fix r2 -C, =!=0, replace curl with r2 in the webserver test ##http

* Honor anal.in/from/to in aae, optimize db/formats/mach0/thumb ##anal

* Bug fixes and performance improvements

Co-authored-by: pancake <pancake@nopcode.org>
2020-09-25 19:51:23 +08:00
Riccardo Schirone
83d3e7bf18
Mark tests as broken until properly fixed (#17711)
* Mark http test as broken until properly fixed
* Fix return type of `signal`
* Mark V850 pseudo test as broken

Co-authored-by: Anton Kochkov <xvilka@gmail.com>
2020-09-25 17:30:29 +08:00
pancake
7c76d85031 Add tests for RTable using r2 commands 2020-09-24 17:19:25 +02:00
pancake
e13753e6d0 Support strings in /ne/ and /eq/ RTable.filter ##util 2020-09-24 17:19:25 +02:00
pancake
6ce78c6149 Implement /head, /tail and /page in RTable API ##util 2020-09-24 17:19:25 +02:00
pancake
43ff1e4189 Support boolean columns in RTable ##util 2020-09-24 17:19:25 +02:00
pancake
454d7ada78 Support :simple in RTable.tostring() ##util 2020-09-24 17:19:25 +02:00
Damien Zammit
2a0d8fbe59
Install r2sdb, detect R2_HOME_SDB_FCNSIGN for r2extras custom CC ##build
* cc: Add autodetection for R2_HOME_SDB_FCNSIGN new location of custom calling conventions
* Fix r_file_exists not expanding tilde path
* r2sdb: Install executable
2020-09-24 12:26:53 +02:00
phakeobj
89e1618e3c
Fix #17353 - Remove duplicated implementation of uleb128 in mach0 ##bin (#17489) 2020-09-24 09:47:23 +02:00
Alexis Ehret
ec6a52e8a9
Fix 3 lgtm warnings (#17465) 2020-09-24 09:37:41 +02:00
Kārlis Seņko
7042ae727b Refactor r_str_split_lines to use size_t. 2020-09-21 07:48:17 +03:00
Riccardo Schirone
75a80741ee
Make root a argv RCmdDesc ##newshell (#17326) 2020-09-15 15:27:10 +02:00
pancake
797b937175
Implement touch command ##shell (#17645) 2020-09-15 11:11:41 +02:00
Khairul Azhar Kasmiran
d9057505dc
Set RPATH/RUNPATH on r2 libs too if local (#17639) 2020-09-15 09:16:14 +02:00
Florian Märkl
ceac3124fb
Add r_strbuf_initf() ##util (#17634) 2020-09-13 10:08:56 +02:00
pancake
f21ebbf85a
Fix #17558 - Honor hex.offset in prc, pxAv and p=e ##print (#17615) 2020-09-09 15:50:37 +02: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
GustavoLCR
080bf4918c
Fix #17590 - Fix invalid deref in print_types_format (#17592)
Make sure streams are in their proper index for `r_list_get_n` by appending a NULL item when necessary
2020-09-05 19:04:41 +02:00
David CARLIER
15e73666b2
Implements r_sys_aslr for NetBSD ##port (#17588)
ASLR on NetBSD is also settable via sysctl call.
2020-09-04 21:52:16 +02:00
GustavoLCR
f46b1749b3
Fix #17581 - Fix append to file on Windows (#17584)
* Fix append to file on Windows

* Test from @ret2libc
2020-09-03 19:13:42 -03:00
mscherer
42f90d5df5
Return empty string when slurping a empty file (#17520) 2020-09-03 09:46:17 +02:00
Riccardo Schirone
8344b7c304
Rename new json parser file to json_indent to avoid collisions (#17569) ##build
libr.a is built with all the files required to build against r2, so that
includes also SDB. As SDB already has a file named json.c, the new json
parser in r_util collides with it.
2020-09-02 04:56:54 +02:00
David CARLIER
46874bae17
Fixes r_sys_pid_to_path for Haiku using proper team_id/pid_t ##util (#17571) 2020-09-02 04:55:56 +02:00
Anton Kochkov
14bc6586fc Fixes for <=glibc-2.2 versions 2020-08-28 23:04:39 +08:00
Khairul Azhar Kasmiran
4bc96b847a
Fix MS-DOS fuzz tests (#17496) 2020-08-20 12:17:13 +08:00
HoundThe
5845ec39ca
Add function information from DWARF ##anal ##bin (#17434) 2020-08-19 18:21:20 +08:00
pancake
e22b3e9bcc
Fix race condition and remove unnecessary SDB build targets ##build (#17476)
* Simplify sdb build
* This was wrong
* updadte sdb
Co-authored-by: pancake <pancake@nopcode.org>
2020-08-19 10:31:20 +02:00
abcSup
528e79818f Undo changes that modify signals in threads 2020-08-18 12:23:30 +08:00