Commit graph

24782 commits

Author SHA1 Message Date
Riccardo Schirone
721609a17b
Rename to rizin (#2) 2020-10-01 16:13:03 +02:00
Florian Märkl
413055f67c
Temporarily disable some CI jobs 2020-10-01 14:11:08 +02:00
Florian Märkl
8a3b80eaf0
Temporarily disable CodeQL 2020-10-01 10:12:19 +02:00
Florian Märkl
f8e67549b0
Checkout testbins and fuzztargets with token 2020-10-01 09:47:47 +02:00
Florian Märkl
e83099caee
Change testbins and fuzztargets git (should fail) 2020-10-01 09:40:38 +02:00
Riccardo Schirone
af337b1439
Prevent multiple threads from opening new files at the same time ##r2r (#17736)
This should fix a nasty issue with r2r, where tests never terminated.
That was caused by the jq process waiting indefinitely for input from
fd0, because the other end of the pipe was never closed.

Indeed r2r_subprocess_start forks and closes known unnecessary opened fd
in the child process, however it does not consider also all the other
file descriptors that could have been created by other threads
simultaneously. As fd are per-process and not per-thread, file
descriptors created by other threads while doing e.g. pipe to spawn a
separate jq process will clutter other threads (and following jq
processes) as well. If two jq processes happen to keep a fd to the other
end of the pipe for the fd0 of the other jq process, none of them
terminates, thus they never close those spurious file descriptors,
causing tests to hang.

This tries to fix the issue by making sure only one thread at a time can
start a subprocess. In this way no other FDs can be created while a
thread is in the middle of r2r_subprocess_start.
2020-09-30 10:40:23 +02:00
Anton Kochkov
4bcce838df
Update shlr/lz4 to 1.9.3 293713a4fa085d73f396200d2387631b045c118e (#17738) 2020-09-30 16:06:03 +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
Azox
1287f7443f
FIX ARM IT block ##anal (#17509)
* Fix asm/anal IT block for ARM
* Fix indent + missing spaces
* Fix ARM asm patch breaking test
* Remove forgotten debug printf
* Moved anal patch to separate function anal_ITblock()
* Changed to RIOBind + fix code based on comments
* Fix issue with io/rasm
* Switched to HT, still need to invalidate HT
* Add routine to track and clean ITblock

Co-authored-by: Riccardo Schirone <ret2libc@users.noreply.github.com>
2020-09-30 13:45:01 +08:00
Florian Märkl
f56046e32a
Add setters for CC self and error and Tests ##anal (#17704)
* Add setters for CC self and error and Tests ##anal
* Purge sdb_cc on anal purge ##anal
* Add non-nonsensical syntax for self/err CC
2020-09-30 13:39:20 +08:00
Riccardo Schirone
72baf0da5c
Split GROUP RCmdDesc and regular ones ##newshell (#17726)
* Convert R_CMD_DESC_TYPE_GROUP to INNER

* Avoid confusing "group_" prefixes by splitting cmddesc ##newshell

Create "group" command descriptor and give them their own help, to avoid
dupping fields such as group_summary, group_args_str, etc. By having a
separate help structure for the grouping node we make the cmd_api code
easier because it doesn't need to distinguish between
group_summary/summary, group_args_str/args_str, etc. and we avoid few
bytes for each command descriptor help structure, since most of them
did not use group_* fields.

* Other simplification in cmd_api due to split GROUP/exec cb.

* Handle R_CMD_DESC_TYPE_GROUP in r_cmd_call_parsed_args
2020-09-30 13:38:30 +08:00
Khairul Azhar Kasmiran
0e1fa7c341
Do partial =h test on Windows (without /cmd and using curl) (#17729)
* Properly default http.root on Windows
* Do partial =h test on Windows (without /cmd and using curl)
2020-09-29 21:23:26 +08:00
Damien Zammit
56fb85bff4
Revert "r2sdb: Install executable" (#17724)
This partially reverts commit 2a0d8fbe59
Fix meson warnings.
2020-09-29 11:22:43 +02:00
Jing Xia
b3c0e42426
Fix inverted help for /ai and /aI ##doc (#17719) (#17725) 2020-09-29 11:21:00 +02:00
phakeobj
1aba692eb6
Treat error as a format string instead of a string literal (#17731) 2020-09-29 12:36:59 +08:00
Aswin C
45c0024300
Rename asm.var.sub to asm.sub.var ##cons (#17717)
* Rename `asm.var.sub` to `asm.sub.var`
* Rename tests for `asm.var.sub`
2020-09-28 17:51:38 +08:00
Florian Märkl
8fea09e21d
Use Ht instead of SDB for pcache ##io (#17716) 2020-09-27 12:22:18 +02:00
Khairul Azhar Kasmiran
9100440fae
Fix possible use of dangling pointer due to calling r_anal_pin_fini() followed by r_anal_pin_init() (#17720) 2020-09-27 12:21:50 +02:00
Florian Märkl
3f81a40844
Kill RIODesc.obsz ##io (#17715) 2020-09-27 10:01:23 +02:00
pancake
aa7de006e6 Fix TinyCC build ##build 2020-09-27 13:33:26 +08:00
Florian Märkl
ae0b5e503f
Purge Pins on r_anal_purge ##anal (#17703) 2020-09-27 12:39:50 +08:00
Khairul Azhar Kasmiran
d74ecd12b7
Unbreak =h tests (#17714) 2020-09-26 18:53:24 +08:00
Riccardo Schirone
73ebe78f94
Mark =h test on darwin as broken, it fails for now (#17713) 2020-09-25 23:18: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
Riccardo Schirone
ea7da3366b
Add parse_v850_pseudo to meson build (#17710) 2020-09-25 16:51:03 +08:00
pancake
664df15f2f
Fix race condition in http server test (#17705) 2020-09-24 18:33:54 +02:00
pancake
e28ce2990d
Implement the v850.pseudo RParser plugin ##disasm (#17687) 2020-09-24 17:56:16 +02:00
Riccardo Schirone
9b59074787
Automatically group sub-commands ##newshell (#17663)
* Add GROUP RCmdDesc type and fix where the args_str is shown
* Adjust color of `[?]`
* Differentiate between cmd<?> and cmd[?]
<?> when cmd is not valid by itself
[?] when cmd is valid but there are also other sub-commands available
* Fix usage for commands like `w` that are both commands and groups
* Do not automatically switch to detail=2 for leaf commands
* Fix test due to change in `?`/`??` behaviour
2020-09-24 17:50:52 +02:00
pancake
46aff1ec53
Implement ab./ablj/abl,/ablq - list all the basic blocks ##anal (#17680) 2020-09-24 17:23:23 +02: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
pancake
f71ec729ba
Always register the derived CC from the reg profile ##anal (#17685) 2020-09-24 17:17:15 +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
Florian Maerkl
8842de91e5 Kill RAnal.sdb_fcns because it is unused now ##refactor 2020-09-24 12:12:42 +02:00
Florian Maerkl
5e50ed7f11 Remove noperational axt for vars ##refactor 2020-09-24 12:12:42 +02:00
Florian Maerkl
e6cefa903a Directly apply Callee Args in Type Matching ##anal 2020-09-24 12:12:42 +02:00
pancake
63803c57dd
Fix scrolling with L in mini graph mode ##visual (#17700) 2020-09-24 09:47:54 +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
Khairul Azhar Kasmiran
2293d29308
x86 cmp/sub: Properly generate esil for bitsize of 64 ##anal (#17665)
* x86 cmp/sub esil: Support bitsize of 64
* Fix pij tests
* Don't shift if bitsize is 0
* Don't esilprint anything if bitsize is invalid
* Use %u instead of %d
* Check whether bitsize is 0
2020-09-24 12:14:43 +08:00
Florian Märkl
022324029d
Add Global Import API (#17692)
* Add Tests and Make it strict
2020-09-24 02:15:22 +02:00
Riccardo Schirone
13ca72df81
Make sure $( is always considered as cmd substitution ##newshell (#17699)
Sometimes argument could be "value$", but this commits ensures that if
the argument is "value$(...)", then `$(...)` is considered as a
cmd_substitution_arg.
2020-09-23 21:43:36 +02:00
GustavoLCR
22468fdc0a
Support demangling MSVC managed pointer types ##bin (#17694)
* Demangle __clrcall calling convention
* Transform a giant macro to a function for sanity sake
* Add tests
2020-09-23 16:40:10 +02:00
Khairul Azhar Kasmiran
6511ec9cd9
Test =h on Linux (#17697) 2020-09-23 20:09:21 +08:00
Riccardo Schirone
ac6bdc1e7e
Add support for additional cmd_identifiers ##newshell (#17696) 2020-09-23 14:01:24 +02:00