Commit Graph

183 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
RHL120
785e500a7e
A better way to check if a project has been saved ##projects
* Add a dirty var to RFlag, RAnal and RConfig
* Add  prj.alwaysprompt
* Add R_DIRTY() and R_IS_DIRTY()
2022-01-25 10:39:15 +01:00
Lazula
ad749a0b1a Fix static/R_API function definition formatting
* Remove spaces before parens
* Remove spaces after asterisks
2021-12-21 20:58:12 +01:00
RHL120
7a2b03d4c5
Removed some pointless frees in r_config_set in config.c (#18814) 2021-06-08 17:01:40 +02:00
pancake
71a83e865b
Fix autocompletion for 'e ' and handle cfg.charset=<tab> ##shell (#18748) 2021-05-24 21:41:35 +02:00
pancake
96756a3048 Simplify RConfigHold APIs and update calls from RCore ##config 2021-02-05 18:48:01 +01:00
pancake
ebed292f66 Add RConfig.{get,set}_b dummy APIs 2021-02-05 18:48:01 +01:00
Riccardo Schirone
a2b3adb671 Support evar filtering in eq and check for bool type in RConfig.toggle ##core 2021-01-19 05:37:17 +01:00
pancake
3d2856bb81 Type and null check fixes for RConfig 2021-01-18 11:15:04 +01:00
pancake
773695d835 Expose RConfigNode.options APIs to avoid messing with internals ##core 2021-01-18 11:15:04 +01:00
pancake
08d7fe688c Implement RTable:sql and add RTable.name ##core 2021-01-15 10:56:58 +01:00
pancake
d09987546d Fix some returns to fix initialization issues in evars ##config 2021-01-03 10:54:00 +01:00
pancake
4b6fd801e4
Import last random rizin fixes and more (#18128) 2020-12-28 23:34:16 +01:00
Lazula
243bc871c3 Multiple refactors in io and util ##io ##util ##refactor
* Add r_io_map macros throughout code base
* Update string NULL-checking with renamed functions r_str_get() and r_str_getf()
* Change string NULL-checks throughout code base to use functions
* Add r_str_get_fail() to specify a custom string to return if NULL-check fails
* Mark JSON to be updated with PJ with "TODO PJ"
* Incidental style updates such as missing spaces
2020-12-13 05:09:13 +01:00
Khairul Azhar Kasmiran
d9057505dc
Set RPATH/RUNPATH on r2 libs too if local (#17639) 2020-09-15 09:16:14 +02: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
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
75ee57bfb0
Update SDB with boolified SdbForeachCallback (#17040) 2020-06-11 11:25:23 +02:00
Riccardo Schirone
8a8a579c35 Fix RConfigHold in case the same key is set two times
Before this patch, if you temporarily change the same variable two
times, the second time it will store the new value, which may be
restored later instead of the actual original one.
2020-03-24 15:23:35 +01:00
radare
5e629a3260
Avoidify the strTrim() APIs + cleanup/refactor ##util (#16056) 2020-03-02 21:39:37 +01:00
Paul I
c017695b88
Fix memory leak in r_config_hold_num_free() (#16079) 2020-02-29 23:39:12 +01:00
Anton Kochkov
9ae41ae69f
Revert "Avoidify the RUtil.strTrim() APIs, rename trimHeadTail() and add asserts in RConfig ##refactor" (#16055)
This reverts commit 38b61c7bcf.
2020-02-26 09:59:04 +08:00
radare
38b61c7bcf
Avoidify the RUtil.strTrim() APIs, rename trimHeadTail() and add asserts in RConfig ##refactor 2020-02-25 17:53:09 +01:00
Riccardo Schirone
f322c1b1bc
Add support for @* commands in new r2-shell-parser (#16038)
* Use TSSymbol instead of comparing type strings

This patch uses ts_node_symbol instead of ts_node_type to check whether
a node is of a given type. Since TSSymbol is just an integer, the check
will be much faster. Also, it allows to store commands handler in an
hashtable, instead of having if-cascade.

* Make sure r_config_hold works even when keys do not exist or are freed

* Add support for all _tmp_commands

* Make sure to always reuse the same TSLanguage

* Update both tree-sitter and radare2-shell-parser

This way we use TSLanguage version 11, which fixes some problems with
TSSymbols.

* Compute is_last_cmd on each single command and fix logging

is_last_cmd should be set on a per-command basis, so if you analyze
things like `pd 3; .; .; .;` the `.` refers to `pd 3`.

This also fixes logging, so when an invalid command is parsed, it is
still available in the history.

* Add comment about directly using r2-shell-parser in r_core_cmd_lines

r_core_cmd_lines tries to parse the input and split it in lines, but at
least in theory, we don't need it as the new parser can already handle
full scripts.

* Allow other tasks to run between commands even in the new parser

* Update radare2-shell-parser
2020-02-24 09:46:15 +01:00
Khairul Azhar Kasmiran
2b7bf5bee2
Treat empty string as false when boolifying (#15859)
* Treat empty string as false when boolifying

* Fix :, in ej output
2020-01-21 21:01:06 +08:00
Riccardo Schirone
d8f2b4a4db Do not try to convert to true/false, as it breaks integer vars
See discussion at https://github.com/radareorg/radare2/pull/15681 .
Unfortunately the change cannot be done for non-int vars only, because
right now vars are not statically typed, so a var that is initially
CN_INT can then become CN_STR if you set a string.

Changing vars to assign them a static type when they are created would
require a much bigger change and discussion.
2020-01-17 12:22:44 +01:00
Riccardo Schirone
8a330bedb0 A bit of refactoring in r_config.h 2020-01-17 12:22:44 +01:00
Khairul Azhar Kasmiran
eb7b4b756b When setting non-bool config var, set false/true if r_str_is_false()/_is_true() (#15681)
* When setting non-bool config var, set false/true if r_str_is_false()/_is_true()

* Fix for cmd_open tests

* Fix for cmd_print test
2019-12-20 21:12:54 -06:00
Riccardo Schirone
fd1f980eca Pass R2_CONFIG file to ! commands and serialize methods ##config 2019-12-16 23:23:17 +01:00
Anton Kochkov
e11b2a9145
Some Coverity defect fixes (#15626) 2019-12-13 11:25:19 -06:00
Florian Märkl
2a1250c041 Remove unnecessary RConfig Members (#15509) 2019-11-27 11:42:15 +01:00
Florian Märkl
aad2a2c79e Link sdb fully into r_util in meson (#15338) ##build 2019-10-23 15:52:19 +02:00
Paul I
c5aa976847 Remove needless strdup() calls in r_config_set_i() (#15313) 2019-10-19 13:15:30 +02:00
Remco Verhoef
f24f3b31db fix typo (#15225) 2019-10-08 10:54:38 +02:00
pancake
a228c9297b Implement 'cols' RTable.query to filter by column names ##print
* r_str_split_list() rewritten to support nth limit

r2 -qq -c 'aac;aflt size/gt/200,addr/cols/name/nbbs,nbbs/sort/inc' /bin/ls
2019-08-28 23:25:31 +02:00
pancake
3a235b49c2 Visual panels layout save/load via 'v' command ##panels 2019-08-10 14:33:08 +02:00
karliss
a04f863db8 Fix some leaks found by ASAN 2019-07-28 19:08:24 +02:00
pancake
9b7dcd30a9 Simplify RConfig.eval and improve e with e, for csv ##core 2019-06-20 10:30:52 +02:00
radare
a49bb7cf66
Change the signature of r_str_trim to avoid confusions ##refactor 2019-06-16 20:58:40 +02:00
pancake
1d33705cc0 Code cleanup in RConfig and bring back 'e asm.' for listing ##config 2019-05-05 23:18:53 +02:00
radare
d90a2f5c1f
Fix uaf in config hold (#13591) 2019-04-01 00:19:40 +02:00
pancake
38a0343e62 Implement visual decompiler and fix the RConfigHold API ##disasm 2019-03-04 02:44:13 +01:00
Florian Märkl
f80a47ab60 Move Palette to RConsContext to make RCoreTask less racy ##cons 2019-01-18 11:58:49 +01:00
GustavoLCR
89914ace5f Fix #12773 - Support setting multiple configs at the same time ##core 2019-01-15 19:54:25 +01:00
lzutao
1365948cee Do not use reversed keyword of meson ##build
`files` is a reversed keyword in meson. Try to avoid using it.
2019-01-10 14:15:50 +01:00
lzutao
9cc6d2d291 meson: Do not use glob with meson ##build
* meson: Explicit is better than implicit
* meson: Fix deprecated warnings in Meson 0.49.0
* meson: Do not need separate array for installed files

libr/socket/meson.build:30: DEPRECATION: Library r_socket was passed to
the "libraries" keyword argument of a previous call to generate() method
instead of first positional argument. Adding r_socket to "Requires" field,
but this is a deprecated behaviour that will change in a future version
of Meson. Please report the issue if this warning cannot be avoided in
your case.
2018-12-27 14:17:54 +01:00
Riccardo Schirone
4b7f8313e1 Fix some COVs (#12255) 2018-11-21 17:53:20 +01:00
Riccardo Schirone
f77ecfb357 Upgrade SDB and use the new HtPP, HtUP, HtUU ##refactoring
* sdb-sync: update to commit ea05ca8808605daa683a2b35f143e24c3a70f0c9
2018-11-14 10:47:28 +01:00
Riccardo Schirone
c09ba158fe
sync sdb and adapt r2 codebase (#11953)
add improvements of SdbHt from sdb
2018-10-26 15:54:32 +02:00
radare
945e9566fb
Fix #11455 - Implement internal less pager with scr.pager=.. (#11548)
* Use full screen in r_cons_less (last line was not used before)
2018-09-17 12:15:12 +02:00