* 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
* Symptom: Search often failes when hexpairs are separated by spaces, e.g. "01 02 03" vs. "010203".
* Affected: radare2 and rafind2 at least
* Description: While parse-function r_hex_str2bin handles whitespace, auto-generated binmask
(function r_hex_str2binmask, called when no mask is provided) does not, creates oversized mask,
increases byte count, finally causing search for additional undefined bytes.
The behavior of the `<ctype.h>` functions is undefined for negative
arguments (other than `EOF`). In such a situation, the argument should
be cast to `unsiged char` for safety.
References:
- C Programming: A Modern Approach, 2nd Edition: page 612, chapter 23.5
r_hex_str_is_valid is called only once from r_reg_arena_set_bytes,
to find the size of the hexadecimal string. However, it stop
at the first space, while the method used for the conversion
r_hex_str2bin is skipping space and continue to convert.
So with a long enough string passed to drw and arw, it is possible
to crash r2, as reported in https://github.com/radare/radare2/issues/11407
Otherwise the plugin can't be loaded because of this:
dlerror(~/.config/radare2/plugins/lang_python2.dylib):
dlopen(~/.config/radare2/plugins/lang_python2.dylib, 6):
Symbol not found: _PyUnicode_1BYTE_DATA
Referenced from: ~/.config/radare2/plugins/lang_python2.dylib
Expected in: flat namespace
in ~/.config/radare2/plugins/lang_python2.dylib
* add parser for python
* add P flag for hex from python
* Revert "add P flag for hex from python"
This reverts commit 23a4721ef8.
* detect language automatically