Commit Graph

1429 Commits

Author SHA1 Message Date
pancake
d01afcc9c6 Very tested much wow 2021-05-20 03:15:12 +02:00
pancake
e916cfe5c2 Add deprecation warning for \ 2021-05-20 02:59:22 +02:00
pancake
04747c7fde Fix #16674 - Kill ' and \ commands, use ':' for the only alias of =! ##shell
* .:9090 is now '=t 9090' (listen for commands via tcp)
* '=:9090' (listen for commands via rap) is now '=r 9090'
* The backslash and single quote aliases were confusing and break commands consistency
2021-05-20 02:59:22 +02:00
pancake
eaf303d49e
Add ===errmsg to support the new r2pipe side ##r2pipe (#18705)
* == honors scr.interactive
* Improved help in ==? and =+?
2021-05-18 09:08:27 +02:00
pancake
3af7510818 Implement @@@e and @@@E to iterate over entries and exports ##shell 2021-05-04 23:49:52 +02:00
Anthoine Bourgeois
c66854e85d remove use_newshell, there is only one now
Signed-off-by: Anthoine Bourgeois <anthoine.bourgeois@gmail.com>
2021-04-24 21:58:09 +02:00
Anthoine Bourgeois
1b3e24257e Handle $() and `` as equal sub-command.
Test fix:
db/cmd/feat_quote Quotes and substitution - newshell

Signed-off-by: Anthoine Bourgeois <anthoine.bourgeois@gmail.com>
2021-04-24 21:58:09 +02:00
Anthoine Bourgeois
41339efd7c Do not execute subcommand under simple quotes protection.
Partially fix:
db/cmd/feat_quote Quotes and substitution - newshell

Signed-off-by: Anthoine Bourgeois <anthoine.bourgeois@gmail.com>
2021-04-24 21:58:09 +02:00
Anthoine Bourgeois
6a6b8a0e41 Protect arroba under quotes.
Tests fix:
db/cmd/feat_quote Single quotes - newshell
db/cmd/feat_quote Double quotes - newshell

Signed-off-by: Anthoine Bourgeois <anthoine.bourgeois@gmail.com>
2021-04-24 21:58:09 +02:00
Anthoine Bourgeois
c88877f990 Remove refs to radare2-shell-parser
This fix the CI build of linux-static.

Signed-off-by: Anthoine Bourgeois <anthoine.bourgeois@gmail.com>
2021-04-24 21:58:09 +02:00
Anthoine Bourgeois
987212fdd6 unescape the alias' argument
Test fixed:
db/cmd/cmd_interpret $foo=#!pipe

Signed-off-by: Anthoine Bourgeois <anthoine.bourgeois@gmail.com>
2021-04-24 21:58:09 +02:00
Anthoine Bourgeois
074f027fd3 cmd: simple quotes also escape the hash comment
Add a new test:
db/cmd/cmds hash comment and simple quote

Signed-off-by: Anthoine Bourgeois <anthoine.bourgeois@gmail.com>
2021-04-24 21:58:09 +02:00
Anthoine Bourgeois
6e838b6ba4 cmd: double quotes escape the semi-colon command separator
Simple quotes already has.

Test fixed:
db/tools/rax2 C array {0x33,33,23,32}

Signed-off-by: Anthoine Bourgeois <anthoine.bourgeois@gmail.com>
2021-04-24 21:58:09 +02:00
Anthoine Bourgeois
e55da9853f cmd: flush console buffer between multi-command
Tests fixed:
db/cmd/feat_grep multi-command single-line grep
db/cmd/cmd_zignature af ; af ; zfs libc-v10.sig - newshell
db/cmd/cmd_zignature af ; af ; zfs libc-v7.sig - newshell

New test failed:
db/tools/rax2 C array {0x33,33,23,32}

Signed-off-by: Anthoine Bourgeois <anthoine.bourgeois@gmail.com>
2021-04-24 21:58:09 +02:00
pancake
cbc949c039 Remove tree-sitter and the r2-shell-parser ##shell
* Will be reimplemented soon with a new parser
* Simplifies and speedup the build
2021-04-24 21:58:09 +02:00
RHL120
280a4cddba
Fixed confusion between *input and *arg in cmd_ls() (#18583) 2021-04-16 17:13:47 +02:00
RHL120
4c2a518b75
Tried to fix certain problems in r_file_dir_recursive and added it to a cmd.c (#18552)
* Fixed some of the glaring issues found in r_file_dir_recursive()
* Added a command to access r_file_dir_recursive()
* Made dir constant to hopefuly fix tests
* Split r_file_dir_recursive into 2 functions to make it return RList *
* Adjusted the lsrf function to work with the new split
* Moved the lr command logic to the cmd_lsrf function
* Applied requested changes
* Fixed the CI issues
* Changed !arg to !input
* Changed !input to R_STR_ISEMPTY (input)
2021-04-11 17:00:11 +02:00
pancake
0a268e67a5 Implement pFX command exemplifying the use of r_sys_unxz() ##print
* Add support for xz decompression, that will be the base for future
  api handling internal implementations and system tools to decompress
  buffers in memory.
2021-04-10 23:13:27 +02:00
pancake
3862fb7e82
Rename r_cons_memcat to r_cons_write ##api (#18559) 2021-04-10 22:21:35 +02:00
Alucowie
198ef7e997
Fix proper hash comments & quotes mix (#18551) ##shell
The problem was that the quotes are not checked to be before or after
the hash comment.

Fixes: 765f2b6
Signed-off-by: Anthoine Bourgeois <anthoine.bourgeois@gmail.com>

Co-authored-by: Anthoine Bourgeois <anthoine.bourgeois@blade-group.com>
2021-04-09 09:13:01 +02:00
murphy
3dbb38a1b4 Fix 1134937 Resource leak 2021-04-01 21:52:06 +02:00
pancake
a7c08c15ce Don't scream out WARNINGs, capitalizing it is enough 2021-03-19 11:02:54 +01:00
pancake
db6ecbfeaf Implement whoami and uid commands ##shell 2021-03-17 18:45:24 +01:00
pancake
06adab8389
Add variable autocompletion class in !!! ##shell 2021-03-15 01:46:33 +01:00
condret
1fae2164cb Rename r_io_map_get_for_fd to r_io_map_get_by_fd ##io 2021-03-12 20:52:45 +01:00
pancake
1e6ca89e90
Add scr.loopnl to add a newline on all the @@ loops ##shell (#18378) 2021-02-23 00:08:06 +01:00
pancake
a0885d7ec6 Implement =r and =R commands for reverse shell ##shell 2021-02-06 01:37:50 +01:00
pancake
96756a3048 Simplify RConfigHold APIs and update calls from RCore ##config 2021-02-05 18:48:01 +01:00
Kamil Rytarowski
9d761f6a88
Avoid array subscript type issues (#18295)
Cast char to unsigned char for standard reasons and security purposes.

Fixes build issues on NetBSD.
2021-01-26 13:08:58 +01:00
Alexis Ehret
21c98d60ac Remove all dead assignment detect by clang sa (#310) ##rizin 2021-01-19 05:37:17 +01:00
pancake
08d7fe688c Implement RTable:sql and add RTable.name ##core 2021-01-15 10:56:58 +01:00
pancake
cb6c12a522 Fix return type in RCore.cmd 2021-01-13 13:51:50 +01:00
pancake
c46b9d76f9 Fix #18129 - Use bool in RCore.cmd 2021-01-13 10:34:57 +01:00
Liumeo
a74ca8f07b
Remove core.file ##refactor (#18178) 2021-01-06 23:44:18 +01:00
pancake
839f438b58 Refactor tcc and afcl commands, improve help and JSON ##types 2021-01-05 02:17:37 +01:00
Liumeo
f140925ab8
Fix kj segfault (#18168) 2021-01-04 11:05:30 +01:00
pancake
7a849f26ef dir.projects becomes abspath when set ##projects 2021-01-03 10:54:00 +01:00
pancake
0cd6b5528a
Initial implementation of r_cons_eprintf ##cons (#18145) 2020-12-31 19:35:01 +01:00
Carson McManus
92d4685be6
Add a progress bar for when scripts are running ##shell
* Add config var `scr.progressbar` to display a progress bar when running a script
##print
* Don't show progressbar when not in a tty
* Also don't show progressbar when scr.interactive == 0
* Add a progress bar for when scripts are running. Includes when projects are being loaded
* Add config var `scr.progressbar` to display a progress bar when running a script
* Don't show progressbar when not in a tty
* Also don't show progressbar when scr.interactive == 0
2020-12-29 04:48:03 +01:00
pancake
4b60f0f2bb Honor R2_CFG_NEWSHELL=0 to disable it ##shell 2020-12-28 20:03:25 +01:00
pancake
adcfe0181f Code cleanup 2020-12-28 20:03:25 +01:00
pancake
54c6bca80e Seek command ignores the tmpseek ##shell 2020-12-28 20:03:25 +01:00
ivan tkachenko
38f5804ecf Move breaks inside switch-case scopes
Update DEVELOPERS.md code style section and
refactor switch-cases across all code base.
2020-12-26 11:15:03 +01:00
ratijas
6d811285c2
Fix wording and whitespacing ##doc (#18065)
* Fix wording, whitespacing and other minor stuff
* cmd.c: ellaborated yy syntax, improved descriptions
  - replace "srcoff" with "origin"
* cmd.c(cmd_autocomplete):
  - refactor help into function: render autocomplete types with generic
    help subsystem;
  - "Types" heading now follow the "Usage" style by not being prefixed
    by a pipe character;
* cmd_anal.c: fix whitespaces & help text
* cmd_info.c: fix help text capitalization.
* cmd_print.c:
  - fix `pf` cmd help;
  - TODO: what pz? is doing here?
* cons.c:
  - refactor & better document r_cons_cmd_help();
  - fix whitespaces;
* visual & panels modes:
  - as of commit 46187fe4e1, '!' no longer
    launches the r2048 game. The game itself it broken anyway, even when
    running from the Help menu in panels mode;
  - transitioning from panels to visual is not 'entering' but actually
    swapping/replacing visual panels with just panels, thus...
  - reword 'enter into the' to 'swap into' or even just 'enter', e.g.:
    "enter into the visual panels mode" -> "enter visual panels mode".
  - remove the "(dwm style)" words from a fortune tip, because I have no
    idea what it is, and it does not appear to be a valid command in any
    of the r2 modes.
  - update global help text.
* [WIP 2] Fix wording, whitespacing and other minor stuff
* visual.c:
  - r_core_visual_append_help(): first steps merging with
    r_cons_cmd_help from cons.c; use consistent colors for headers.
* [WIP 3] Fix wording, whitespacing and other minor stuff
* panels.c(__update_help):
  - shorten code and titles;
  - add comment to clarify that it is not a copy-paste error;
* [WIP 4] Fix wording, whitespacing and other minor stuff
panels.c, visual.c: tweak help text;
* [WIP 5] Fix wording, whitespacing and other minor stuff
* cmd_help.c: update global help text about visual mode -- it was
  outdated and overloaded.
* vmenus.c:
  - rename stuff, shuffle around static consts to reflect an actual
    ordering when viewing as a help text;
  - slightly improve help text rendering;
  - fix whitespaces;
* [WIP 6] Fix wording, whitespacing and other minor stuff
* lots of help text changed.  still working on proper commit message.
2020-12-21 01:12:08 +01:00
pancake
89f6c6e1f1
Fix many ASAN issues, from uaf to memory leaks and some boolification (#18048) 2020-12-20 23:37:45 +01:00
Lazula
4a1a624318
Clean up r_num ##util ##refactor (#18049)
* Fix function spacing for r_num functions
* Remove r_num_ntohs
* Rename r_num_to_trits to r_num_to_ternary for
  consistency with surrounding code
* Rename trits to ternary in other files
* Fix spacing in test_contrbtree.c
2020-12-17 22:24:27 +01:00
pancake
c6052a1c35
Fix #18006 - @v: doesnt wasnt reverting the origfd properly ##shell (#18043) 2020-12-16 09:55:37 +01:00
pancake
cb33fdb420 Improve code, add cfg.charset, use pse, add test ##print 2020-12-14 12:11:13 +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
pancake
d179c5719a
Fix oob in load_table_asciiart ##asan (#18026) 2020-12-13 03:19:27 +01:00