Commit Graph

1594 Commits

Author SHA1 Message Date
pancake
5b7c970f2b eprintf requires newline
* git grep eprintf | grep -v '\\n'| grep '('
2022-05-05 13:11:52 +02:00
pancake
a3a95d26a6
Deshadow some variables, in progress for the full -Wshadow cleanup ##build 2022-05-05 09:44:03 +02:00
pancake
138906e27f
Use RLog in RCons ##api 2022-04-25 01:12:44 +02:00
pancake
b77b92b31d Fix glitch in scr.html when scr.color=1 ##cons 2022-04-19 20:32:35 +02:00
pancake
e7816e4d67 Improve RLog API and usage, document R2_LOG_ vars in r2 -hh ##core 2022-04-19 11:14:57 +02:00
pancake
576e81d71d Add sandbox checks for the debugger io plugins ##security 2022-04-19 00:50:42 +02:00
pancake
1546300810 Handle ^C in fg and improve ^C in pd ##shell 2022-04-13 00:14:27 +02:00
pancake
3760bfcd8d
Add tests for the code tokenizer and fix <<= assignments ##util 2022-03-26 10:35:13 +01:00
pancake
cdde8abf05 Add missing 'OK' in the preconfigure script 2022-03-22 12:21:39 +01:00
pancake
c8ae21f68f
Only build library archives when -Dblob is provided ##build
* Lowers the amount of objects from 2400 to 1500
2022-03-22 11:59:13 +01:00
pancake
82794237d7
Update sdb and fix some more unused return value warnings 2022-03-22 11:12:43 +01:00
pancake
7699f37c7d Fix warnings spotted by latest XCode (unused variables) 2022-03-17 10:12:02 +01:00
pancake
4ba0af5d1d Fix meson -Dblob=true builds for static ##windows 2022-03-16 00:48:50 +01:00
pancake
f8a35da205
Dont use != NULL as its implicit in C, even for bool casts ##refactor
$ find binr libr -name "*.c" -exec sed -i -e 's/ != NULL//g' {} \;
2022-03-15 19:54:04 +01:00
pancake
7370759fa0
Fix some bugs spotted by CodeQL 2022-03-15 15:22:25 +01:00
Lazula
d507bda91c Remove R_EMPTY and R_EMPTY2 2022-03-13 11:26:10 +01:00
pancake
7ce6ae4ad1
Initial import of the code tokenizer ##print
* Integrated in pdg~:) .. the happy filter
* Needs more testing, and nobody tests unmerged branches. so here we go
2022-03-10 18:16:53 +01:00
Lazula
119ee01cc6 Fix inexact r_core_cmd_help_match() 2022-03-03 15:13:17 -06:00
pancake
bf9102eaee Two more null deref fixes for cons/task initialization 2022-03-03 10:52:01 +01:00
Sergi Àlvarez i Capilla
aef278ee9c Make -Dblob=true statically link all r2 libraries ##build 2022-03-02 11:30:28 +01:00
Sergi Àlvarez i Capilla
79a4f840ea Missing parenthesis in sizeof 2022-03-02 00:07:55 +01:00
Lazula
0cb960087d Make grep begin, end, and negate properties per-word 2022-03-01 15:51:53 +01:00
Lazula
b5a26e0c0c
Significantly reduce memory leaks in anal tests (#19759) 2022-02-27 14:57:58 -06:00
Lazula
3de3c43ec6 Free color in r_cons_pal_init() 2022-02-18 14:23:30 +01:00
Sergi Àlvarez i Capilla
46a69a5014 Fix all the latest covs which spotted new findings 2022-02-15 12:05:50 +01:00
pancake
dd25b01275
Fix 'disable mouse' ansi code ##cons
Co-authored-by: Segev Finer <segev208@gmail.com>
2022-02-14 01:55:27 +01:00
Sergi Àlvarez i Capilla
f248f2f22f Fix last 2 covs in panels/canvas (dead code elimination) 2022-02-12 12:22:47 +01:00
pancake
85b9343d28
Minor rgb.parse optimization and remove the use of sscanf in pal.c ##cons 2022-02-11 22:37:23 +01:00
pancake
5c2c9bf86d Use rgb:RGB instead of rgb:RRGGBB in the bluy theme 2022-02-11 11:20:30 +01:00
Sergi Àlvarez i Capilla
4d75eeb99a Fix visibility issue in the bluy theme ##cons 2022-02-09 11:59:45 +01:00
Sergi Àlvarez i Capilla
4a8d97589b Fix panel focus glitch ##visual 2022-02-07 23:50:07 +01:00
pancake
1c8966bd1c
Fix disable-threads builds 2022-02-06 20:55:06 +01:00
meme
ab5606e3e6 Use static RThreadLock in cons ##cons 2022-02-01 08:14:58 +01:00
pancake
50bf4d5918
Simplify meson logic and use ole's PR to fix Windows ##build
* Kudos to @oleavr for reproducing, spotting and fixing the bug!
* Context https://github.com/mesonbuild/meson/pull/9918
2022-01-31 23:54:00 +01:00
pancake
3b8feb0d7a
Dont SIGINT in RCons when used in a thready way ##cons 2022-01-25 17:41:05 +01:00
Lazula
45160a5854
Add r_core_help_match() to get help for a specific command ##api
* Add exact argument to help_match
2022-01-23 23:40:15 +01:00
pancake
cf2ae64e88 Make RCons thread-friendly ##core 2022-01-21 17:04:56 +01:00
pancake
f2995c2949
Introduce r_strf and stop using sdb_fmt ##util 2022-01-18 18:35:31 +01:00
Lazula
e9ee449bba Fix grepbuf grep->counter memory leak when buffer is NULL 2022-01-15 16:42:34 +01:00
pancake
fb0ec6ed00
Use stdint like if there was no yesterday ##refactor
* stdint is needed to build r2, so there's no need to keep using
  those weak basic types anymore, and we can just alias them
2022-01-09 19:48:16 +01:00
pancake
0c6d40c274 Improve the basic theme ##cons 2021-12-21 22:09:26 +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
Sergi Àlvarez i Capilla
6e2f15dcbc Fix all the known issues in the ayu theme ##cons
* Time to jump into the 'basic', one theme at a time
2021-12-21 20:08:27 +01:00
pancake
e6f2cd0b2a
Remove trailing spaces (#19460)
$ git grep ' $' | grep -v ^test/ | cut -d : -f 1 | sort -u > /tmp/trailing
$ for a in `cat /tmp/trailing` ; do sed -i -e 's/ *$//' $a ; done
2021-12-02 17:39:59 +01:00
pancake
4e4efef0f7
Improve the snow experience in panels mode ##cons 2021-11-29 00:42:10 +01:00
Lazula
2255bf8b5d Many indentation style fixes
* Change several 8-space indents to tabs
* Apply tab indent style when breaking long lines
* Move operators from EOL to start of next line
* Fix ternary formatting
2021-11-18 10:43:52 +01:00
pancake
3e032073a3
Fix null name maps, workaround msvc-asan compiler crash and acp/utf/wchar fixes for w32 2021-11-14 00:50:54 +01:00
Sergi Àlvarez i Capilla
b12bfc5cd8 Fix bluy dark color scheme 2021-11-05 16:07:00 +01:00
pancake
9539aa12f4 Fix buffer overflow in RConsPixel API affecting the braile renderer ##cons 2021-10-28 17:34:11 +02:00
Sergi Àlvarez i Capilla
23f2fdd21d Add lowercase seven-segmented-ascii-art alphabet for ?ea ##print 2021-10-27 01:54:43 +02:00
pancake
f6010a4ba1
Improve default theme ##cons (#19304) 2021-10-25 00:24:33 +02:00
pancake
30e6516a01
Add scr.prompt.tabhelp enabled by default ##cons 2021-10-24 03:20:12 +02:00
pancake
cf5cd6df56
Fix latest covs (#19259) 2021-10-19 10:49:11 +02:00
pancake
93f6b4cd3b
Initial work towards supporting mingw32/64 again ##build 2021-10-18 23:58:16 +02:00
pancake
d1320d3e6e
Use RUtil.Str.ss in disasm when scr.demo is set ##visual 2021-10-18 18:45:47 +02:00
Lazula
d12be9e614 Fix new defects and an overread
* Fix global variable overread in r_str_ss()
* Fix memory leak in grep ASCII art ~?ea
* Fix memory leak in @%
* Fix use-after-free in r_io_bank_del_map()
2021-10-12 21:53:05 +02:00
pancake
2423ced03c Implement ?ea and ~?ea to use the seven segment ascii art text rendering ##visual 2021-10-09 10:16:38 +02:00
pancake
f3563759ef
Move more context fields out of the globals ##cons
* Fix |H |T and | suffixes when webserver in background
* Ignore noflush in the RCons.flush() call
2021-09-30 01:04:03 +02:00
thymol0
6513ffa59f
Move the console flushing decision to the console context ##cons 2021-09-29 10:46:37 +02:00
pancake
27beba4761 Fix #19100 - RCons.isatty() renamed to RCons.is_tty() 2021-09-25 12:43:59 +02:00
Dennis Goodlett
7195616448 Fix potential NULL deref in r_cons_flush 2021-09-19 22:58:26 +02:00
pancake
d520902ce8 Add RCons.isWindows() and update mini graph test 2021-09-17 09:24:27 +02:00
pancake
b80c77e931
Fix arrow keys regression on windows prompt ##cons 2021-09-13 17:09:09 +02:00
pancake
f86bee1852 Fix null deref in RCons.grep 2021-09-13 10:52:49 +02:00
pancake
2f5d8c9cfb
Remove globals on input.c for w32 (#19074) 2021-09-13 10:44:21 +02:00
pancake
6fc305c5e6
Fix #19065 - Fix prompt input when using scr.color=0 ##cons (#19067) 2021-09-09 20:31:11 +02:00
pancake
bdef1223da
Fix recently regressed tests 2021-08-29 21:00:28 +02:00
pancake
8ba42d98da
Do not serialize the config everytime, expose and use utf8 and fix R2COLOR env ##shell 2021-08-29 19:01:34 +02:00
pancake
9912c3ee0b
Check if user interrupted the shell command in nested macros ##shell (#19015) 2021-08-25 16:20:50 +02:00
pancake
dd344717c9 'e cfg.editor=' == 'e cfg.editor=-' 2021-08-19 18:39:54 +02:00
pancake
50d84c4c02 Fix assert when using the internal line editor with no file 2021-08-19 18:17:39 +02:00
pancake
89173f99dc
Dont check out of bounds last chars ##cons 2021-08-18 13:35:23 +02:00
pancake
bd888a2edf Fix more vs warnings 2021-08-17 00:35:52 +00:00
pancake
0acb19b68a
Fix some warnings spotted by visual studio (#18985)
Co-authored-by: pancake <pancake@nopcode.org>
2021-08-16 20:45:17 +02:00
pancake
09033f4406
Honor faster ^D on interactive execution path ##cons (#18983) 2021-08-14 21:06:52 +02:00
László Vaskó
8ef090c017
r_cons_printf_list: fix potential busy loop (#18970)
In case the string to be written by `vsnprintf` including `\0`
termination equals to the length of the buffer, the code enters in a
busy loop. The original code seems to assume, that `vsnprintf` won't
terminate the string with `\0` character which it does.

The [documentation of `vsnprintf`
states](https://en.cppreference.com/w/c/io/vfprintf):

> `int vsnprintf( char *restrict buffer, size_t bufsz, const
> char *restrict format, va_list vlist );`
>
> Writes the results to a character string buffer. At most bufsz - 1
> characters are written. The resulting character string will be
> terminated with a null character, unless bufsz is zero. If bufsz is
> zero, nothing is written and buffer may be a null pointer, [...]

This means that the `size` variable should be set to the total
available length of the buffer, not `length - 1`. Furthermore on the
return value the manual writes:

> however the return value (number of bytes that would be written not
> including the null terminator) is still calculated and returned.

This means that the `written` size returned doesn't count the
terminating `\0` in the length, so the value of `written` can be at
most `size - 1` before truncating the output. In other words a string
having`size = written + 1` would fit exactly in the buffer.

Also as `vsnprintf` will write the terminating `\0` there is no need
to explicitly do that.
2021-08-10 00:31:20 +02:00
pancake
305145d37f Fix #18963 - Fix regression when pressing SUPR key in the prompt 2021-08-03 12:44:36 +02:00
pancake
39993b39d7 Fix arrow handling after fixing mouse clicking glitches ##cons 2021-07-27 11:25:47 +02:00
pancake
67d43c4865 Fix memleaks in RCons.grep 2021-07-26 12:40:25 +02:00
pancake
324a0ff77d Fix glitches when clicking in the hud ##visual 2021-07-26 11:14:09 +02:00
pancake
857b1bfce1
Add scr.hist.filter to toggle the filtered history up/down search ##shell (#18913)
* Introduced in f6f7728cf4
2021-07-18 19:15:54 +02:00
pancake
ddb7842228
Improved reverse-search in command history ##shell 2021-07-18 18:37:23 +02:00
pancake
5f4c27f7f8
Initial implementation of ~.... for hudline prompt ##visual (#18861)
* Add new RCons.hud.line(_string) APIs
2021-06-28 00:13:15 +02:00
pancake
7c14bac05b
Add initial support for building r2 on WASI ##build 2021-06-20 17:14:43 +02:00
Sergi Àlvarez i Capilla
d20b1ac8de Fix memleak when allocation fails in RCons.input 2021-06-10 22:40:03 +02:00
pancake
f49ba3a948
Reduce stackframe usage in exchange for the heap for portability (#18824) 2021-06-10 16:13:38 +02:00
pancake
02b6d5d4f0 Fix RCons grep regression 2021-05-30 21:28:50 +02:00
Murphy
70d533b488
Fix grep cmd with neg (#18763) ##cons 2021-05-30 10:29:33 +02:00
pancake
d90510f951 Fix more recently introduced memleaks 2021-05-21 11:17:32 +02:00
pancake
3fd5ef358c
Add scr.optimize with experimental optimization ansi routine ##visual 2021-05-20 02:47:34 +02:00
pancake
374037a4d2 Fix warnings 2021-05-18 19:34:23 +02:00
pancake
df95c1e6c8 Rename defragger test to bobcrawl 2021-05-11 13:22:29 +02:00
pancake
57a9926b1f
Remove globals in cons/grep and random cleanup (#18671) 2021-05-10 11:56:08 +02:00
pancake
7ac5e17440
Fix double-prompt bug (#18650)
Co-authored-by: pancake <pancake@nopcode.org>
2021-05-03 09:46:03 +02:00
pancake
a2e28857b3 Handle aliased files in wff and wtf commands ##shell 2021-04-27 15:15:40 +02:00
pancake
69f18eecef Add guard check for r_cons_write 2021-04-27 15:15:40 +02:00
gogo2464
c093e68c48
Support null bytes in r_print_raw ##print 2021-04-27 13:27:29 +02:00
pancake
c217db6b8d Fix oob crash in 'pri' command ##print 2021-04-25 01:44:35 +02:00
Anthoine Bourgeois
a846d314dc Fix type "intgerp" -> "intgrep"
Signed-off-by: Anthoine Bourgeois <anthoine.bourgeois@gmail.com>
2021-04-24 21:58:09 +02:00
pancake
d1cd05a82d Fix oob read crash in dietline 2021-04-21 13:07:04 +02:00
pancake
b5e262a6b9 Linux debugger improvements 2021-04-19 17:28:42 -07:00
pancake
5f98cb2ff8
Add new theme named 'bluy' (#18588) ##cons
Co-authored-by: pancake <pancake@nopcode.org>
2021-04-16 19:29:22 +02:00
valdaarhun
b3941078a4 Fix Ctrl-J issue and remove redundant code in 'Ctrl-J' block ##cons 2021-04-10 23:46:33 +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
pancake
3f70b40af0 Minor white theme fix 2021-04-09 17:34:42 +02:00
pancake
530c737d5d
Fix incorrect use of non-const strings and fiz zousans of warnings (#18544)
Co-authored-by: pancake <pancake@nopcode.org>
2021-04-06 12:45:19 +02:00
pancake
bd0b0be77b
Two coverity findings less 2021-03-30 00:56:04 +02:00
pancake
e3dfe63657 Fix a couple of warnings 2021-03-29 11:40:33 +02:00
pancake
8dc2894613 Add agfb for braile graphs ##visual
* Can be used from shell, panels or visual
* Added graph.zoom and graph.mini config variables
* Add r_str_size() api like r_cons_size()
* Add r_cons_pixel_flush()
2021-03-29 11:34:57 +02:00
pancake
625aca16e6 Implement RConsPixel and RBraile APIs ##cons 2021-03-29 11:34:57 +02:00
pancake
a7c08c15ce Don't scream out WARNINGs, capitalizing it is enough 2021-03-19 11:02:54 +01:00
pancake
6ed4b00727 Fix heap overflow in cons.grep 2021-03-10 16:58:24 +01:00
Alexandr
15094a5e01
Fix #16254 - grep expression parse improvement ##cons (#18419) 2021-03-06 23:04:37 +01:00
pancake
4ae1527bd2 Fix null derefs on RCons when no context is provided ##cons 2021-03-02 00:36:07 +01:00
pancake
4dee81b7a9 Initial implementation of graph edge highlighting ##visual 2021-02-28 16:17:07 +01:00
pancake
054b5fa46a
Add 32bit Debian packaging and bonus CI fixes ##build 2021-02-13 05:09:30 +01:00
pancake
126f8c799f Add p2 and pri in visual graphics modes ##visual 2021-02-09 11:38:24 +01:00
Khairul Azhar Kasmiran
3f18a68556 Fix strncpy truncation warnings 2021-02-06 03:30:53 +01:00
ChD1
2f1488656d
Add hidden aeaB by using switch instead of ifelse chain + divbyzero issue fixed 2021-01-27 17:52:29 +01:00
ChD1
580bdf2c52
Fix some bugs in dex.c, marshal.c, panels.c and other code optimization and fixel (#18297) 2021-01-27 10:53:50 +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
pancake
f6f7728cf4
Implement history filtering for dietline ##cons (#18283) 2021-01-25 03:28:37 +01:00
Liumeo
c631443b9b
Remove strncat usage (#18229) ##refactor 2021-01-14 17:24:23 +01:00
pancake
298888dfec Fix issues spotted with gcc -Werror 2021-01-13 01:28:10 +01:00
eagleoflqj
7b1b103f13 Fix r2 - tab crash related to regex apis 2021-01-09 12:47:47 +01:00
Liumeo
06b735441d
Fix memleak in test_anal_block & test_io (#18153) 2021-01-02 09:37:23 +01:00
pancake
0cd6b5528a
Initial implementation of r_cons_eprintf ##cons (#18145) 2020-12-31 19:35:01 +01:00
pancake
4b6fd801e4
Import last random rizin fixes and more (#18128) 2020-12-28 23:34:16 +01:00
ratijas
44755fe08d
Fix help rendering: avoid printing trailing whitespaces (#18115) ##cons 2020-12-27 12:16:20 +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
pancake
b77d97a6a9 Improve str.wrap, add cons.line and fix cons.printat glitch ##cons 2020-12-23 23:14:07 +01:00
pancake
a5399eeddf Box borders in graph and panels are now in yellow ##visual 2020-12-23 23:14:07 +01:00
Lazula
f2976d3c7e
Use r_str_get_fail() throughout codebase ##refactor (#18079) 2020-12-21 08:51:44 +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
d3157e2ed3
Fix 32 critical COVs (UAF, UB and OOB) (#18077) 2020-12-21 01:10:22 +01:00
pancake
c90aee3c85
Do not glitch the prompt when using scr.color=0 ##cons (#18057) 2020-12-20 14:12:56 +01:00
pancake
d813cf19ca
Add r_str_wrap() and r_cons_printat() new APIs needed by r2book ##cons 2020-12-20 14:10:21 +01:00
pancake
67151ec31e
Use CYAN in the single line edges in the graph (#18041) 2020-12-14 17:19:48 +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
d63c9ee62f
Fix double click issue in panels ##visual (#18012) 2020-12-13 02:45:24 +01:00
Emi1305
38b5bd69b8
Fix for internal less and hud mode available while in non-interactive (#17678) ##shell 2020-12-09 03:33:21 +01:00
pancake
b81cf6665f
Remove useless README file in libr/cons (#17966)
Co-authored-by: pancake <pancake@nopcode.org>
2020-11-24 12:33:30 +08:00
Anton Kochkov
5da1b3b076 Fix some warnings 2020-11-16 18:56:21 +08:00
Khairul Azhar Kasmiran
fc16ceebb7
Do not skip blank lines in ~:s..e (#17872) ##cons 2020-11-01 01:17:55 +01:00
Riccardo Schirone
75a80741ee
Make root a argv RCmdDesc ##newshell (#17326) 2020-09-15 15:27:10 +02:00
Khairul Azhar Kasmiran
d9057505dc
Set RPATH/RUNPATH on r2 libs too if local (#17639) 2020-09-15 09:16:14 +02:00
pancake
4249c71e82
Parse ansi->html properly in pdJ ##disasm (#17628) 2020-09-14 10:21:31 +02:00
pancake
dc6a06b75e
Implement RCons.setTitle() for Windows and add ?et command ##cons (#17624)
* Implement r_cons_set_title for Windows ##cons

* Implement ?et command to change terminal title ##cons

* Apply Windows fix from @a1ext

Co-authored-by: pancake <pancake@nopcode.org>
2020-09-11 21:28:09 -05: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
pancake
4d2a83e575
Fix #17492 - EOF when alt+e is pressed on Linux systems ##cons (#17513) 2020-09-03 09:00:25 +02: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
68a1db448d
Merge everything time-related in r_time.h (#17445) 2020-08-12 18:54:49 +02:00
Khairul Azhar Kasmiran
78ea6ec78c
Don't disable (enable) mouse if mouse is already disabled (enabled) (#17390) 2020-08-03 20:32:03 +08:00
HoundThe
1c74f3f729
r_cons_print fix for very large output ##cons (#17343)
* 0x prefix to hex printout
* Change `buffer_size` and `len` to `size_t`
2020-07-24 13:46:30 +08:00
GustavoLCR
407121f6da
Fix selecting text on Windows ##cons (#17303)
* Use Shift key to allow for text selection
2020-07-20 14:23:13 +08: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
Alexis Ehret
ad20ed47bd
Fix buffer overflow #17122 (#17152) 2020-06-29 09:28:35 +02:00
Riccardo Schirone
08cd3c62e3
Fix r_cons_yesno. Key variable was never changed (#17101) 2020-06-19 00:16:30 +08:00
pancake
bd9a604a87
Check for return values in about ~50 method calls (#17025) 2020-06-15 11:24:43 +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
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
Khairul Azhar Kasmiran
1fef151d37
r_cons: Save and restore the active code page on Windows (#16998)
* r_cons: Save and restore the active code page on Windows
* Use r_sys_cmdf() instead
2020-06-03 18:54:55 +08:00
GustavoLCR
9f40bfae6d
Fix prompt bug on Windows (#16981)
Fixes line wrapping causing prompt to descend every keypress
2020-06-03 12:48:07 +08:00
pancake
fc4aaa9c46
Fix an oobread when pressing the backspace in the r2 shell (#16844)
* Regression inrtoduced when moving from int to size_t in r_str_utf8_charsize_prev

str.c:2043:8: runtime error: addition of unsigned offset to 0x00010c7de67f overflowed to 0x00010c7de67e
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior str.c:2043:8 in
2020-05-18 15:51:52 +02:00
Khairul Azhar Kasmiran
2a4cc154f6
Prevent flicker in Visual mode on mintty when holding down PgUp/PgDn (#16780) 2020-05-07 19:37:14 -05:00
GustavoLCR
3142e60e8c
Fix #11808 - Fix -0 mode on Windows (#16772) 2020-05-06 11:58:48 +08:00
Khairul Azhar Kasmiran
ccab2eb393
When getting terminal size on mintty, reuse prev vals if rows=0 (#16769)##cons 2020-05-06 00:30:47 +02:00
Riccardo Schirone
79bee09fc3 Use g->x and g->y to rebase x/y got with r_str_str_xy
* Use RVector instead of RPVector
* Use RAGraph instead of the fixed core->agraph which may be wrong
* Fix infinite loop and remove unused functions
2020-05-03 17:33:36 +02:00
pancake
4b0e25caeb Implement findNextWord in the interactive Visual Graph ##graph 2020-05-03 17:33:36 +02:00
Khairul Azhar Kasmiran
8484a1b103
Fix some remaining issues of #16747 (#16760)
* Fix mintty issue with mouse clicks/scroll wheel after quit

* Fix alacritty issue with stty
2020-05-03 22:06:50 +08:00
GustavoLCR
153de56173
Add VT sequences input support ##windows (#16747)
* Add VT sequences input support ##windows

* Fix radare2 immediately exiting when console is redirected to pipe
* Hack to get viewport size under MinTTY
* Fix mouse when VT input disabled and buffer scrolled
* Fix line wrapping when VT output disabled

* Fix build on VS2017

* Fix for comments

* fix some weirdness

* Fix losing echo after exiting
2020-05-03 17:31:52 +08:00
pancake
9079a7bd96
Fix #15978 - segfault when using r2pipe webserver + local visual (#16508) 2020-04-11 01:57:39 +02:00
Liumeo
75bc5ec905
y already >=0 (#16512) 2020-04-10 09:02:35 +02:00
pancake
d95befca7a
Fix #16233 - ~{} works on colorized JSONs ##json (#16425)
* Fix #16233 - ~{} works on colorized JSONs ##json
* Fix issue in json_indent
2020-04-06 16:08:47 +08:00
radare
3f77b9a76b
Avoid duplicated module filenames to fix static.sh ##build (#16403) 2020-04-02 14:30:27 +02:00
Florian Märkl
0b5e78e923
Make size arg of r_file_slurp() size_t (#16221) 2020-03-15 23:34:38 +01:00
pancake
a56d67cd52 Fix #16192 - segfault in qwert^a^x 2020-03-12 12:08:28 +01:00
radare
72093ac706
Fix #16138 - Do not preincrement when it's not necessary (#16151) 2020-03-05 19:06:59 +01:00
pancake
bb78ef3457 Drop the reset attributes on newlines 2020-03-04 02:10:07 +01:00
radare
33f2e9bed6
Fix again the EOL bgcolor issue (and improve scr.html) (#16120) ##cons 2020-03-04 00:09:12 +01:00
radare
5e629a3260
Avoidify the strTrim() APIs + cleanup/refactor ##util (#16056) 2020-03-02 21:39:37 +01:00
Paul I
0e62dda341
Fix fgets() usage (#16068) 2020-02-29 20:47:10 +01:00
radare
12495ec098
Fix #16063 - bgcolor not reset on newlines ##cons (#16064) 2020-02-28 11:34:36 +01:00
Florian Märkl
204e038211
Fix r_cons_rgb_parse() harder (#16061)
Also fix init of some ret args in r_meta_print()
2020-02-27 20:13:34 +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
radare
2b74ff5cda
Fix #15359 - Enable key.f# keys to be used in the shell ##cons 2020-02-23 11:55:54 +01:00
pancake
560c59c848 Fix ASAN segfault in RCons.rgbParse() 2020-02-18 01:04:08 +01:00
Khairul Kasmiran
78e21373be Revert "ONE_STREAM_HACK & scr.onestream: Force expected ONE_STREAM order if necessary (#15535)"
This reverts commit 39b40cdedd.
2020-02-17 00:00:46 +01:00
pancake
446727b1f8 Improve the gentoo theme ##cons 2020-02-11 00:49:40 +01:00
Vane11ope
2d7f7e4e6d
Fix a bug on clicking in panels (on Mac and Linux) ##panels 2020-02-06 00:19:33 +01:00
radare
1ac6209c88
Fix #14424 - Handle ~ operator in the ms shell ##cons (#15846) 2020-01-19 07:40:21 +01:00
Anton Kochkov
b4de5c5113 Some more coverity fixes (#15802) 2020-01-14 12:57:34 +01:00
Anton Kochkov
f3a0a3d01c Some coverity fixes 2020-01-10 12:30:23 +01:00
Vane11ope
45fec159c5
fix some crashes of the widget (#15694)
fix some crashes of the widget
2019-12-21 06:57:29 +09:00
GustavoLCR
07b5e062f2 Fix #15545 - Fix NULL derefs after r_file_slurp() fails 2019-12-15 23:38:38 +01:00
Anton Kochkov
e11b2a9145
Some Coverity defect fixes (#15626) 2019-12-13 11:25:19 -06:00
GustavoLCR
e43c9e7caf Fix some warnings (#15549) 2019-12-08 12:49:58 +01:00
GustavoLCR
54c8929a3c Fix #14197 - Don't highlight control chars on hud filter (#15552) ##cons 2019-12-07 20:33:38 +01:00
Khairul Azhar Kasmiran
39b40cdedd
ONE_STREAM_HACK & scr.onestream: Force expected ONE_STREAM order if necessary (#15535) 2019-12-02 23:09:38 +08:00
karliss
00a890f4f2 Include last line when greping using foo~n.. (#15524) ##cons 2019-11-29 10:47:23 +01:00
MNayer
f4bd6bce0b Fix anal.timeout calculation in r_cons_break_timeout (#15490) 2019-11-23 21:53:44 +01:00
dok
34e4bd7291 Use sigaction instead of signal ##core 2019-11-06 12:41:36 +01:00
GustavoLCR
4716e50572 Fix #15407 - Fix using unexpected ACP for input on Windows (#15408) 2019-11-04 00:36:20 -06:00
GustavoLCR
5da7f2476c Fix double-free in canvas.c (#15379) 2019-10-29 10:24:09 +01:00
radare
583687dcd9
Fix function key handling in visual/panels ##cons (#15345) 2019-10-24 02:21:20 +02:00
GustavoLCR
92bbe968b2 Kill r_sys_get_osinfo () (#15346) 2019-10-24 02:20:57 +02:00
Florian Märkl
aad2a2c79e Link sdb fully into r_util in meson (#15338) ##build 2019-10-23 15:52:19 +02:00
Khairul Azhar Kasmiran
184a67abac For utf-8 locale, check LC_ALL, LC_CTYPE and LANG in sequence instead (#15326) ##cons 2019-10-22 19:21:20 +02:00
Florian Märkl
80c74d7aa7 Replace r_str_const* with RStrConstPool (#15300)
* Add RStrConstPool

* Replace RAnal.consts with RStrConstPool

* Remove useless r_str_const() calls

* Kill more r_str_const()

* Remove r_str_const() from Java

* Remove r_str_const() from Canvas

* Remove r_str_const() from mach0

* Remove r_str_const() from PE

* Kill r_str_const* completely
2019-10-20 12:31:45 +02:00
GustavoLCR
73d555dbed Also use LANG env var to check for UTF-8 output support (#15257) ##cons 2019-10-16 12:12:26 +02:00
GustavoLCR
50174972fd Move UTF-8 setting logic to scr.utf8 config callback on Windows (#15273) ##cons 2019-10-16 12:11:52 +02:00
GustavoLCR
bf15aa7a4e Fix #15267 - Fix jump shortcuts on Windows (#15270)
* Revert " Fix #12921 - Impl. r_cons_arrow_to_hjkl for Windows ##cons"

This reverts commit 7f86ef243c.

This fixes #15267

* Re-Fix #12921 - Impl. r_cons_arrow_to_hjkl for Windows

This time only translate arrows in the function.

This is so that __cons_readchar_w32 does not return inputs that we are
not interested in that caused the #15267 regression.
2019-10-14 12:47:17 +02:00
neuracr
d561a59a03 Fix #15222 (#15236) - inverse page up/down in popup widget 2019-10-10 04:44:34 +02:00
pancake
94ed5c2c7d FIx warnings with latest GCC on GNU/Linux 2019-10-08 17:42:39 +02:00
GustavoLCR
006d4716df
Fix missing return statement in dietline.c
In r_line_readchar_utf8()
2019-10-06 01:40:08 -03:00
Paul I
c7828248bc Fix memleaks in r_cons_highlight() (#15172) 2019-10-03 01:41:18 +02:00
Paul I
25565f2ff3 Fix memleak in r_cons_canvas_write() (#15139) 2019-09-27 22:07:25 +02:00
Sanyam Agrawal
f166a1af0a Update stiv.c to remove warning (#15116) 2019-09-26 18:46:06 +02:00
dodococo
bf43f18382 Fix #14919: truncate long function names in Vv (#14996) ##visual 2019-09-23 09:02:36 +02:00
pancake
4edccf94d2 Fix #14559 - Honor scr.fps ##panels 2019-09-23 03:25:47 +02:00
radare
bbe6c0e184
Fix #10851 - Solve slurp messages on http/sandbox/pipe ##remote 2019-09-16 14:25:37 +02:00
Kārlis Seņko
dac82f4ea9 Fix bound check for hud scrolling with arrow keys. 2019-09-16 09:38:21 +02:00
dodococo
f1646f76b9 Fix #14611: Vi-mode indication by prompt color ##cons 2019-09-09 20:09:46 +02:00
dodococo
c13138f2bc Add tab to next support for popup widget (#14995) 2019-09-09 19:53:08 +02:00
GustavoLCR
5bb2417119 Fixes for Windows (#14985)
* Fix dbW help message

* Fix memleak on r_w32_print_windows

* Imitate unix gotoxy behavior on Windows
2019-09-08 02:53:25 +08:00
Lowly Worm
61f34671a6 fix heap buffer overflow in dietline autocomplete (#14984) 2019-09-08 01:05:08 +08:00
dodococo
879e4723bd Fix autocompletion popup (#14958) 2019-09-04 19:02:13 +02:00
pancake
490422ff96 Fix uninitialized variable issue related to the mouse state 2019-09-02 00:31:46 +02:00
dodococo
6f5b81674f Fixes #14914: Mouse wheel for hud (#14940) ##visual 2019-09-01 16:18:37 +02:00
dodococo
9926496395 Fixes #14896: Enable and disable mouse based on requirement in visual/panels (#14909) 2019-08-27 15:44:42 +02:00
pancake
6e11ba3e1e Reset mouse settings after leaving the hud 2019-08-27 05:12:00 +02:00
Florian Märkl
f5c5d0afa3 Make cmd_depth task-local (#14888) 2019-08-24 20:22:31 +02:00
GustavoLCR
2d894471b7 Fix crash on r_line_readchar_win (#14875) 2019-08-23 12:38:54 +08:00
GustavoLCR
1964f6f4a1 Drop not needed wrapper
* Fix non-unicode Windows build virtual keys not working
2019-08-23 02:12:19 +02:00
GustavoLCR
8fef69e697 Fix arrows in vi mode on Windows 2019-08-23 02:12:19 +02:00
GustavoLCR
7416b88783 Merge Windows and Unix dietline implementation
* Simulate escape sequences in r_line_readchar_win
* Fix some bugs on Windows
* Some refactoring
2019-08-23 02:12:19 +02:00
radare
e1cf65332a
Use r_sandbox_fopen instead of fopen (#14832) 2019-08-18 17:19:53 +02:00
dodococo
2b1e53b9c7 Fix #14522: Added g support for Vv mode (#14823) 2019-08-18 12:58:54 +02:00
Khairul Azhar Kasmiran
e0532b817f
Specify graph.diff colors for sepia (#14817) 2019-08-17 01:20:16 +08:00
dodococo
a0354d4cfd Implement agd* based commands (#14809)
* ag* commands fully functional
* Indent and r_return usage
* All agd* commands functional now
* Graphs are pretty now
* Refactoring the code
* Fixed assertion error
* Fixed broken agf
2019-08-16 22:51:11 +08:00
Paul I
2556919857 Add clang-cl support (#14814) 2019-08-16 12:10:00 +08:00
GustavoLCR
b1879aed6c Fixes for path autocompletion on Windows (#14813) 2019-08-16 11:39:31 +08:00
dodococo
2c53ca5bf4 Fixes #14396: Does not highlight dot based output (#14787)
* Fixes #14396: Does not highlight dot based output

* Disable highlight for ag* commands

* Added space in function call

* Other pr issues

* Fixed lgtm error
2019-08-12 23:54:34 +08:00
dodococo
40f4db6eaa Fixes #13651: Added config var for max autocompletion array (#14786)
* Fixes #13651: Added config var for max autocompletion array

* Fixed indent
2019-08-11 14:15:28 +08:00
Vanellope
1c43206634 Fixing critical issues of the menu and refactoring (#14752) 2019-08-03 09:58:50 -07:00
pancake
033e37de8d Better gameboy theme 2019-08-01 01:42:41 +02:00
GustavoLCR
3344ca0b3c Make click and drag work on Windows ##cons 2019-07-31 23:34:16 +02:00
karliss
7592fa52a9 Fix memory leaks part 2 (#14720) 2019-07-31 23:33:04 +02:00