114 Commits

Author SHA1 Message Date
GustavoLCR
8968759923
Add unit tests for RSkyline (#17969) 2020-11-24 12:02:11 +08: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
Liumeo
a19736d67c
Fix s390x unit/bin/test_dwarf_info (#17947) 2020-11-23 12:32:24 +08:00
condret
2540a73de1 Add units for the new next/prev file APIs ##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
Riccardo Schirone
741d22ed61
Use -Werror when building in CI (#17781) 2020-10-13 12:42:57 +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
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
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
phakeobj
89e1618e3c
Fix #17353 - Remove duplicated implementation of uleb128 in mach0 ##bin (#17489) 2020-09-24 09:47:23 +02:00
Florian Märkl
1c485e8bfc
Rename r_sign_anal_additem to r_sign_add_item and add r_sign_get_item ##signatures (#17691) 2020-09-22 14:09:17 +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
Florian Märkl
178f69b643
Refactor Labels out of SDB ##anal (#17621) 2020-09-16 09:54:33 +02:00
Riccardo Schirone
75a80741ee
Make root a argv RCmdDesc ##newshell (#17326) 2020-09-15 15:27:10 +02:00
Florian Märkl
456b0fdf09
Add API for getting Atomic and Typedef Types and remove broken !size (#17599) 2020-09-15 13:31:38 +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
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
Florian Märkl
7f0bc9b418 Rename r_anal_base_type fcns and update usages 2020-09-06 12:36:42 +02:00
Florian Märkl
d1bcbcf041 Move member initialization of RAnalBaseType to new 2020-09-06 12:36:42 +02:00
mscherer
42f90d5df5
Return empty string when slurping a empty file (#17520) 2020-09-03 09:46:17 +02:00
Riccardo Schirone
abfda31e66
Fix a bunch of warnings (#17575) 2020-09-02 19:54:17 +08:00
HoundThe
eca62ba4db
Fix big endian DWARF parsing ##bin (#17503) 2020-09-02 11:01:16 +08:00
Khairul Azhar Kasmiran
c9b6149d7b
Fix test_idstorage mu_assert warnings (#17565) 2020-09-01 17:04:30 -05:00
condret
e54103eef9
Add tests for r_id_storage (#17548) 2020-09-01 00:49:41 +08:00
HoundThe
f01711583a
Fix compilation warnings ##dwarf (#17544) 2020-09-01 00:48:03 +08:00
condret
1cae744fd5
Add tests for idpool (#17515) 2020-08-26 09:21:35 +02:00
Zi Fan
3c88900134
Implement save and load functions for debug session ##debug (#17430)
* Add `dtst` and `dtsf` commands
* Change `RDebugSession` to store its data in their own sdb namespace
* Add `r_debug_session_serialize()` and `r_debug_session_deserialize()` API
* Add unit tests for `RDebugSession `save and load functions
2020-08-20 12:25:47 +08:00
HoundThe
5845ec39ca
Add function information from DWARF ##anal ##bin (#17434) 2020-08-19 18:21:20 +08:00
karliss
adc2fb525d
Improve cons_html_filter. (#17471)
Better handle mix of background and text color changes.
2020-08-17 09:13:20 +03:00
Florian Märkl
3ef9c81da9
Add the r_json json parser based on nxjson ##util (#17439) 2020-08-14 20:57:09 +02:00
NIRMAL MANOJ C
b4677b4dfe
Add Function Name, Constants, Globals and Local Variables to RAnnotatedCode (#17429)
* Annotation for function name (#17204)
* Annotations for Constant Variables and Global Variables for the decompiler (#17281)
* Annotation For Function Variables (#17375)
* function variable annotation added (includes local variable and function parameter)
* API for checking if an annotation is a reference or function variable. (#17386)
* Update docs in annotate code API  (#17397)
* Unit tests for annotated code API (#17403)
2020-08-10 13:40:16 +03:00
HoundThe
b44b8cb405
Add acg - printing class hierarchy graph ##anal (#17362)
* add `acg` - printing class hierarchy graph
* Move the printing into the cmd_anal.c from returned RAGraph
* Change API to return Graph and transform it to AGraph when printing is necessary
* Move graph to agraph into agraph module, move generic node structure to rgraph, removing unnecessary dependency
* Move RGraphNodeInfo related functions to graph.c
2020-08-07 17:23:52 +08:00
Riccardo Schirone
154416c8fd
Add unit tests for binheap (#17367) 2020-07-31 18:09:50 +08:00
GustavoLCR
cef191cde3
Fix #14024 - Make r_io_map_get() faster (#17324) ##io
* Fix O(n) in r_io_map_get() ##io
* Kill `map_skyline_shadow` and `do_skyline`
2020-07-31 10:04:57 +02:00
Riccardo Schirone
48c30dfd99
Support compilation with meson on old systems like CentOS6/DebianWheezy ##build (#17345)
* Compile tree-sitter and newshell parser with gnu99 if possible ##meson
* Make sure to use `-lrt` when needed to use clock_gettime ##meson
2020-07-27 12:25:06 +08:00
HoundThe
eac93216ec
Improving PDB type information parsing and saving types into SDB (#17226) 2020-07-25 01:40:55 +08:00
pancake
b25c3275de
Add ovf tests and more overflow macro definitions ##util (#17216) 2020-07-24 13:21:52 +02:00
pancake
2b38b2f03c
Add more null checks and fix a lock when no r2 in path ##r2pipe (#16999)
Co-authored-by: pancake <pancake@nopcode.org>
Co-authored-by: Anton Kochkov <xvilka@gmail.com>
2020-07-24 16:24:19 +08:00
Riccardo Schirone
652df7f497
Add r_cmd_desc_remove API to unregister commands (#17349) 2020-07-24 14:23:56 +08:00
Riccardo Schirone
af7376f3f8
Add unit test for graph, from legacy_unit files (#17306) 2020-07-21 10:54:00 +02:00
HoundThe
435eb89b67
DWARF - type parsing into RAnalBaseTypes and saving into sdb (#17111) 2020-07-15 18:17:05 +08:00
HoundThe
914624a921
DWARF .debug_info parsing fix and improvement (#17007)
* Get .debug_info working for DWARF 2, 3
* Fill up missing information in abbrev string table
* Add 64bit dwarf option into debug_info
* Add DWARF4 and DWARF5 forms
* Add unit tests
* added basic test

Co-authored-by: Riccardo Schirone <sirmy15@gmail.com>
2020-06-19 19:25:59 +08:00
HoundThe
e9952265ac
DWARF unit testing ##tests (#16965) 2020-06-19 13:54:11 +08:00
Riccardo Schirone
2ffa790e0a
Generate help automatically ##newshell (#16782)
* Add additional RCmdStatuses
* ?? should be a cmd_identifier, not help_command
2020-06-17 21:29:23 +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
GustavoLCR
ae2ed249f8
Fix crash in r_anal_block_chop_noreturn (#17012) 2020-06-12 10:19:50 +02:00
GustavoLCR
04edfa82c1
Fix command injection on PDB download (#16966)
* Fix r_sys_mkdirp with absolute path on Windows
* Fix build with --with-openssl
* Use RBuffer in r_socket_http_answer()
* r_socket_http_answer: Fix read for big responses
* Implement r_str_escape_sh()
* Cleanup r_socket_connect() on Windows
* Fix socket being created without a protocol
* Fix socket connect with SSL ##socket
* Use select() in r_socket_ready()
* Fix read failing if received only protocol answer
* Fix double-free
* r_socket_http_get: Fail if req. SSL with no support
* Follow redirects in r_socket_http_answer()
* Fix r_socket_http_get result length with R2_CURL=1
* Also follow redirects
* Avoid using curl for downloading PDBs
* Use r_socket_http_get() on UNIXs
* Use WinINet API on Windows for r_socket_http_get()
* Fix command injection
* Fix r_sys_cmd_str_full output for binary data
* Validate GUID on PDB download
* Pass depth to socket_http_get_recursive()
* Remove 'r_' and '__' from static function names
* Fix is_valid_guid
* Fix for comments
2020-06-10 18:00:00 +02:00
pancake
7bdafe5638
Kill tinyrange api because it's not used anywhere (#17027) 2020-06-09 21:20:16 +02:00