mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-23 05:09:43 +00:00
Implement Vd1! to toggle all bits from the selected byte ##visual
This commit is contained in:
parent
2028e53633
commit
2d5ff60b23
@ -4728,7 +4728,7 @@ R_API int r_core_anal_search_xrefs(RCore *core, ut64 from, ut64 to, PJ *pj, int
|
||||
uninit = true;
|
||||
at += bsz;
|
||||
if (!r_io_is_valid_offset (core->io, at, 0)) {
|
||||
R_LOG_ERROR ("invalid memory");
|
||||
R_LOG_ERROR ("invalid memory at 0x%08"PFMT64x, at);
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
|
@ -426,7 +426,7 @@ R_API bool r_core_visual_esil(RCore *core, const char *input) {
|
||||
r_cons_clear00 ();
|
||||
r_cons_printf (
|
||||
"VdE?: Visual Esil Debugger Help (aev):\n\n"
|
||||
" q - quit the bit editor\n"
|
||||
" q - quit the esil debugger\n"
|
||||
" h/r - reset / go back (reinitialize esil state)\n"
|
||||
" s - esil step in\n"
|
||||
" S - esil step over\n"
|
||||
@ -435,6 +435,7 @@ R_API bool r_core_visual_esil(RCore *core, const char *input) {
|
||||
" j/k - next/prev instruction\n"
|
||||
" n/p - go next/prev instruction\n"
|
||||
" = - enter cmd.vprompt command\n"
|
||||
" ! - toggle all bits\n"
|
||||
" : - enter command\n");
|
||||
r_cons_flush ();
|
||||
r_cons_any_key (NULL);
|
||||
@ -666,6 +667,12 @@ R_API bool r_core_visual_bit_editor(RCore *core) {
|
||||
free (op_hex);
|
||||
}
|
||||
return false;
|
||||
case '!':
|
||||
{
|
||||
const int nbyte = x / 8;
|
||||
*(buf + nbyte) = ~*(buf + nbyte);
|
||||
}
|
||||
break;
|
||||
case 'H':
|
||||
{
|
||||
const int y = R_MAX (x - 8, 0);
|
||||
@ -705,7 +712,7 @@ R_API bool r_core_visual_bit_editor(RCore *core) {
|
||||
}
|
||||
break;
|
||||
case '>':
|
||||
buf[x/8] = rotate_nibble (buf [(x / 8)], -1);
|
||||
buf[x / 8] = rotate_nibble (buf [(x / 8)], -1);
|
||||
break;
|
||||
case '<':
|
||||
buf[x / 8] = rotate_nibble (buf [(x / 8)], 1);
|
||||
@ -770,6 +777,7 @@ R_API bool r_core_visual_bit_editor(RCore *core) {
|
||||
" </> - rotate left/right byte value\n"
|
||||
" i - insert numeric value of byte\n"
|
||||
" = - set cmd.vprompt command\n"
|
||||
" ! - toggle all the bits\n"
|
||||
" : - run r2 command\n");
|
||||
r_cons_flush ();
|
||||
r_cons_any_key (NULL);
|
||||
|
@ -164,7 +164,7 @@ void __magic_file_badread(RMagic *ms) {
|
||||
__magic_file_error (ms, errno, "error reading");
|
||||
}
|
||||
|
||||
int __magic_file_buffer(RMagic *ms, int fd, const char *inname, const void *buf, size_t nb) {
|
||||
R_IPI int __magic_file_buffer(RMagic *ms, int fd, const char *inname, const void *buf, size_t nb) {
|
||||
int mime, m = 0;
|
||||
if (!ms) {
|
||||
return -1;
|
||||
|
Loading…
Reference in New Issue
Block a user