Commit Graph

329 Commits

Author SHA1 Message Date
lzutao
50320592a6 Fix #12060 and #12072 - Rewrite r_num_abs and r_num_units ##core
r_num_abs:

- Make r_num_abs static inline
- Use unsigned long long type when defining TB macro
- Use st64 instead of long long

r_num_units:

- Add len argument for buf in r_num_units
- Add PB and EB for r_num_units
- Always display one number after decimal point

  * This change simplifies the code
- Use long double type as assigning from ut64 to double cause data loss

r_num_tail_base:

- Use isxdigit (fast) instead of isHexDigit (slower)
- Rename nth to get_nth_nibble

Update all functions to use with new r_num_units:

- Remove side effect when using in other functions like cb_printf

* Trim trailing .0 when input is power of 2
2018-11-14 23:35:44 +01:00
pancake
9556ebb1f9 More warning issues 2018-11-14 13:47:43 +01:00
Artem Zinenko
4a2bc97a35 Fix #11918 - Moved r_print.h into r_util/r_print.h 2018-11-14 10:54:22 +01:00
dav1901
9b0fbf1ee4 Minor code cleanups - free/R_FREE/etc 2018-11-13 00:23:49 +01:00
radare
35a5c42a52
Add LL command to lock screen ##visual
* Clear terminal backbuffer
* Password not saved in command history
* Show timestamp of last attempt
* Do a random sleep after every read to avoid time attacks
* ^Z is disabled
* Can be used from shell `r2 -qcLL --`
2018-10-31 01:52:08 +01:00
Riccardo Schirone
6080edf13b
Fix r_log when used for r_assert (#11971)
- Split r_log in r_vlog/r_log and make r_assert_log use r_vlog because it
needs to provide a va_list.
- Rename _r_internal_logging to r_log because that's a R_API function
and it needs a good name
- Make R2_CHECKS_LEVEL dependent on 'buildtype' option
- Make R_LOGLVL_WARN the default log level when in debug mode (default)
- introduce ASSERT_STDOUT macro to print assert failures to stdout
- use ASSERT_STDOUT in the Travis env with asan
- use list of callbacks in RLog instead of just one.
2018-10-29 11:48:12 +01:00
Aaron
a6725edb1f Fix #10324 - Implement RLog API for leveled logging ##core (#11786) 2018-10-27 05:29:22 +02:00
pancake
15ab430fdd Fix crash in XNU when calling ttyname() on an invalid fd 2018-10-08 00:02:22 +02:00
pancake
c2e447fc01 Fix last googlefuzz (direct memory leak in cb_pager)
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10576
2018-09-21 11:41:48 +02:00
radare
20364845e3 Fix negative value on unsigned operation inside RCons (#11560) 2018-09-17 15:44:39 +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
radare
486c61529c
Implement the "underscore command" 2018-09-16 22:50:56 +02:00
Maijin
4d12a2036c Remove restrict keywords 2018-09-15 18:39:56 +02:00
Neven Sajko
8274d307de Fix signature of printf-like function (pointer) types (#11522)
The type signatures have to be compatible with printf.
2018-09-15 11:41:05 +02:00
Riccardo Schirone
bd5de316be Random fixes (#11503)
* core/panels: fix memleak
* cons: reintroduce change to correctly print multi-line help headers
2018-09-14 11:48:00 +02:00
Neven Sajko
4a722e80d8 Add braces to if, else, for, while ... (#11504) 2018-09-13 10:17:26 +02:00
pancake
f90b534a4d Fix several bugs introduced during r2con 2018-09-10 16:33:29 +02:00
ylmrx
7a2a9900a2 several inline documentation enhancements (#11429)
* - avoid the ugly lack of space between the command and its description
in the usage lines.
- avoid the confusing sections (cf. 'i?')
- prettier general help (cf. '?') -> use r_core_cmd_help instead of
r_cons_printf (#7967)

with help and advices from jeisonwi

* - strlen() is better than sizeof()
- coding style correction.
2018-09-07 15:03:01 +02:00
Neven Sajko
b0436220dc libr/cons: Do proper signal handling, use pselect (#11376)
Fixes async-signal-safety and changing errno within the signal handler
for SIGWINCH, which can cause crashes and maybe security issues.

For async-signal-safety make the signal handler just set a flag, which
is checked for while waiting for input (pselect).

SIGWINCH is blocked process-wide, except in pselect.
2018-09-03 23:46:13 +02:00
pancake
035942db81 Fix #11067 - uaf in ~ 2018-08-13 16:31:42 +02:00
Florian Märkl
cc3c87532a
Break all tasks on exit (#11026)
* Break all tasks on exit

* null check in r_cons_context_break()
2018-08-11 16:23:27 +02:00
Luca Di Bartolomeo
370f35c2a6 Vim-like autocompletion in visual offset prompt (#10912)
* Feat: autocompletion widget for offset prompt in visual mode
* Fix: screen refresh when erasing sel_widget
* Refactor: many small changes to the autocompletion widget
* Fix: colors in selection widget taken from palette
* Refactor: do not use utf8 inside selection widget
* Refactor: rename ANSI_ESC_CLEAR_LINE to R_CONS_CLEAR_LINE
2018-08-05 20:53:12 +02:00
Florian Märkl
7995089d3f Always keep break stack filled in tasks in threads 2018-07-21 16:29:12 +02:00
Florian Märkl
61950ec620 Expose r_cons_context_break() to API 2018-07-21 16:29:12 +02:00
pancake
16c807f1ce Fix hexdump bottleneck issue and probably a segfault too 2018-07-08 03:12:41 +02:00
Florian Märkl
5e35ad898b RConsContext (#10450)
* Add RConsContext
* Swap cons in tasks using RConsContext
* Create cons context for background tasks
* Move event_interrupt to RConsContext
* Fix breaking main cons from signal
* Make r_print_is_interrupted() use callback
2018-06-23 12:10:13 +02:00
pancake
8638b8395f Fix UAF introduced in previous malloc(0) bugfix 2018-06-18 19:44:29 +02:00
pancake
e3eac1a8ee Avoid malloc(0) in cons.c:71 2018-06-18 19:07:30 +02:00
Florian Märkl
e9be4e2f68 Fix Leak in cons dump loading 2018-06-17 11:34:03 +02:00
Florian Märkl
fa3ff32569 Fix Task Commands for new Tasks 2018-06-17 11:34:03 +02:00
Florian Märkl
6730a93e9c Sleep during prompt
Sleep during prompt for Windows
2018-06-17 11:34:03 +02:00
Florian Märkl
9ff250d1a7 Tasks Cons Swapping 2018-06-17 11:34:03 +02:00
Florian Märkl
61e2c0b329 Split up cons stack functions 2018-06-17 11:34:03 +02:00
Florian Märkl
6fa6ce3efb Fix Leak in r_cons_pop() (#10322) 2018-06-11 18:49:10 +02:00
Florian Märkl
f5fe86b790 Add r_cons_lastline_utf8_ansi_len() and use in ds_align_comment() 2018-05-26 18:27:29 +02:00
pancake
ceba14c612 Fix last covs 2018-05-21 11:32:37 +02:00
pancake
05cc56325e Fix #9850 - V/ - visual highlight heap overflow 2018-05-21 03:06:52 +02:00
Paolo Monti
bc08a99c06 Fix #9964 plus some style while at it (#10040) 2018-05-07 20:02:22 +02:00
pancake
8b3707078f Ensure RConsSingleton is filled with zeros 2018-05-06 19:15:00 +02:00
pancake
19c4f5223c Fix a lot of things broken in previous merged PRs. grrrrrr 2018-04-24 11:32:51 +02:00
Khairul Azhar Kasmiran
ec75785c7c Highlight seek line using different background color (#9853) 2018-04-24 09:51:14 +02:00
radare
a30c5c3722
Initial work on supporting pauseable CoreTasks (#9921) 2018-04-20 00:25:33 +02:00
Khairul Kasmiran
41fe409b74 Removed some spaces 2018-04-08 21:03:28 +08:00
pancake
fe7ae5d0af Fix last 20 coverity issues 2018-03-19 11:51:04 +01:00
pancake
1c1cad1d94 Minor improvement in r_cons_set_raw 2018-03-09 03:01:05 +01:00
Fangrui Song
a244064276 Support more terminal attributes other than bold. (#9535) 2018-02-28 17:54:39 +01:00
xarkes
b2b647a5f7 Renamed COLOR_MODE constants 2018-02-24 12:04:48 +01:00
xarkes
5e097dbae1 Killed cons->truecolor in favor of cons->color 2018-02-24 11:47:38 +01:00
pancake
caa4cc66d9 Dont initialize truecolor table if no color is needed 2018-02-24 00:19:15 +01:00
Maijin
3c4e718bae Fix ecr/eco 2018-02-23 22:59:37 +01:00