Commit Graph

1275 Commits

Author SHA1 Message Date
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