Fix sC, remove printfs and add more cfg descriptions

This commit is contained in:
pancake 2012-07-12 04:21:56 +02:00
parent 99774c723f
commit 5bf36a6b74
6 changed files with 16 additions and 4 deletions

1
TODO
View File

@ -7,6 +7,7 @@
====[[ 0.9.1 ]]====
* Colorize multiple ranges of chars in hexdump
* Source debugging or gtfo
- integration with rabin2 -d
* sC not working

View File

@ -441,7 +441,6 @@ static int r_core_cmd_pipe(RCore *core, char *radare_cmd, char *shell_cmd) {
stdout_fd = dup (1);
pipe (fds);
eprintf ("CMDPIPE (%s)\n", shell_cmd);
if (fork ()) {
dup2 (fds[1], 1);
close (fds[1]);

View File

@ -58,7 +58,6 @@ static int cmd_macro(void *data, const char *input) {
if (comma) {
*comma = ' ';
strcpy (comma+1, buf+mustcall);
printf ("CALL (%s)\n", buf);
r_cmd_macro_call (&core->cmd->macro, buf);
} else eprintf ("Invalid syntax for macro\n");
}

View File

@ -1,4 +1,5 @@
/* radare - LGPL - Copyright 2009-2012 // pancake<nopcode.org> */
// XXX this command is broken. output of _list is not compatible with input
static int cmd_meta(void *data, const char *input) {
RAnalVarType *var;

View File

@ -20,7 +20,7 @@ static int cmd_seek(void *data, const char *input) {
off = r_num_math (core->num, input + delta);
if ((st64)off<0)off =-off; // hack to fix s-2;s -2
if (isalpha (input[delta]) && off == 0) {
if (!r_flag_get (core->flags, input+delta)) {
if (delta==1 && !r_flag_get (core->flags, input+delta)) {
eprintf ("Invalid address (%s)\n", input+delta);
return R_FALSE;
}
@ -34,6 +34,9 @@ static int cmd_seek(void *data, const char *input) {
switch (*input) {
case 'C':
if (input[1]=='*') {
r_core_cmd0 (core, "C*~^CC");
} else
if (input[1]==' ') {
int n = 0;
RListIter *iter;
@ -59,13 +62,16 @@ static int cmd_seek(void *data, const char *input) {
break;
case 1:
r_cons_printf ("0x%08"PFMT64x" %s\n", item->from, item->str);
off = item->from;
r_io_sundo_push (core->io, core->offset);
r_core_seek (core, off, 1);
r_core_block_read (core, 0);
break;
}
} else eprintf ("Usage: sC comment grep\n");
} else eprintf ("Usage: sC[?*] comment-grep\n"
"sC* list all comments\n"
"sC const seek to comment matching 'const'\n");
break;
case ' ':
r_io_sundo_push (core->io, core->offset);

View File

@ -476,7 +476,9 @@ R_API int r_core_config_init(RCore *core) {
r_config_set (cfg, "asm.filter", "true");
r_config_desc (cfg, "asm.filter", "Show filtered flags at disassembly");
r_config_set (cfg, "asm.varsub", "true");
r_config_desc (cfg, "asm.varsub", "Substitute variables in disasm");
r_config_set (cfg, "asm.trace", "true");
r_config_desc (cfg, "asm.trace", "Show execution traces for each opcode");
r_config_set (cfg, "asm.decode", "false");
r_config_desc (cfg, "asm.decode", "Use code analysis as a disassembler");
r_config_set (cfg, "asm.offset", "true");
@ -524,10 +526,13 @@ R_API int r_core_config_init(RCore *core) {
r_config_set_cb (cfg, "dbg.backend", "native", &config_dbgbackend_callback);
r_config_desc (cfg, "dbg.backend", "Select the debugger backend");
r_config_set (cfg, "dbg.bep", "loader"); // loader, entry, constructor, main
r_config_desc (cfg, "cfg.bep", "break on entrypoint (loader, entry, constructor, main)");
r_config_set_cb (cfg, "dbg.stopthreads", "true", &config_stopthreads_callback);
r_config_desc (cfg, "dbg.stopthreads", "stop all threads when debugger breaks");
r_config_set_cb (cfg, "dbg.swstep", "false", &config_swstep_callback);
r_config_desc (cfg, "dbg.swstep", "If enabled forces the use of software steps (code analysis+breakpoint)");
r_config_set_cb (cfg, "dbg.trace", "true", &config_trace_callback);
r_config_desc (cfg, "dbg.trace", "enable debugger trace (see asm.trace)");
r_config_set_cb (cfg, "dbg.trace.tag", "0xff", &config_tracetag_callback);
r_config_set_cb (cfg, "fs.view", "normal", &config_fsview_callback);
r_config_desc (cfg, "fs.view", "Set visibility options for filesystems");
@ -624,6 +629,7 @@ R_API int r_core_config_init(RCore *core) {
r_config_set_i (cfg, "magic.depth", 100);
r_config_desc (cfg, "magic.depth", "Recursivity depth in magic description strings");
r_config_set (cfg, "rap.loop", "true");
r_config_desc (cfg, "rap.loop", "run rap as a forever-listening daemon");
/* fkeys */
r_config_set (cfg, "key.f1", "");
r_config_desc (cfg, "key.f1", "Commands executed when press F1 key in visual mode");