Add V& key to rotate between asm.bits

This commit is contained in:
pancake 2014-06-25 03:07:54 +02:00
parent ea67c628b0
commit d98acc233d
2 changed files with 44 additions and 2 deletions

View File

@ -222,13 +222,14 @@ static int cb_asmbits(void *user, void *data) {
asmos = r_config_get (core->config, "asm.os");
asmarch = r_config_get (core->config, "asm.arch");
if (core->anal)
if (core->anal) {
if (!r_syscall_setup (core->anal->syscall, asmarch,
asmos, node->i_value)) {
//eprintf ("asm.arch: Cannot setup syscall '%s/%s' from '%s'\n",
// node->value, asmos, R2_LIBDIR"/radare2/"R2_VERSION"/syscall");
}
if (core->anal) __setsegoff (core->config, asmarch, core->anal->bits);
__setsegoff (core->config, asmarch, core->anal->bits);
}
return ret;
}

View File

@ -75,6 +75,7 @@ static void visual_help() {
r_cons_less_str (
"Visual mode help:\n"
" ? show this help or manpage in cursor mode\n"
" & rotate asm.bits between supported 8, 16, 32, 64\n"
" ! run r2048 game\n"
" _ enter the hud\n"
" . seek to program counter\n"
@ -566,6 +567,46 @@ R_API int r_core_visual_cmd(RCore *core, int ch) {
case 'M':
r_core_visual_mounts (core);
break;
case '&':
switch (core->assembler->bits) {
case 8:
r_config_set_i (core->config, "asm.bits", 16);
if (core->assembler->bits!=16) {
r_config_set_i (core->config, "asm.bits", 32);
if (core->assembler->bits!=32) {
r_config_set_i (core->config, "asm.bits", 64);
}
}
break;
case 16:
r_config_set_i (core->config, "asm.bits", 32);
if (core->assembler->bits!=32) {
r_config_set_i (core->config, "asm.bits", 64);
if (core->assembler->bits!=64) {
r_config_set_i (core->config, "asm.bits", 8);
}
}
break;
case 32:
r_config_set_i (core->config, "asm.bits", 64);
if (core->assembler->bits!=64) {
r_config_set_i (core->config, "asm.bits", 8);
if (core->assembler->bits!=8) {
r_config_set_i (core->config, "asm.bits", 16);
}
}
break;
case 64:
r_config_set_i (core->config, "asm.bits", 8);
if (core->assembler->bits!=8) {
r_config_set_i (core->config, "asm.bits", 16);
if (core->assembler->bits!=16) {
r_config_set_i (core->config, "asm.bits", 32);
}
}
break;
}
break;
case 't':
r_core_visual_trackflags (core);
break;