mirror of
https://github.com/radareorg/radare2.git
synced 2025-03-03 03:35:37 +00:00
Implemented pmj (#15864) ##print
This commit is contained in:
parent
05d5e77f24
commit
5aa8ab5c75
@ -190,11 +190,14 @@ seek_exit:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void r_core_magic(RCore *core, const char *file, int v) {
|
||||
static void r_core_magic(RCore *core, const char *file, int v, int json) {
|
||||
ut64 addr = core->offset;
|
||||
int hits = 0;
|
||||
magicdepth = r_config_get_i (core->config, "magic.depth"); // TODO: do not use global var here
|
||||
r_core_magic_at (core, file, addr, magicdepth, v, false, &hits);
|
||||
r_core_magic_at (core, file, addr, magicdepth, v, json, &hits);
|
||||
if (json) {
|
||||
r_cons_newline ();
|
||||
}
|
||||
if (addr != core->offset) {
|
||||
r_core_seek (core, addr, true);
|
||||
}
|
||||
|
@ -6180,10 +6180,14 @@ l = use_blocksize;
|
||||
"| e dir.magic # defaults to " R_JOIN_2_PATHS ("{R2_PREFIX}", R2_SDB_MAGIC) "\n"
|
||||
"| /m # search for magic signatures\n"
|
||||
);
|
||||
} else if (input[1] == 'j') { // "pmj"
|
||||
if (l > 0) {
|
||||
r_core_magic (core, input + 2, true, true);
|
||||
}
|
||||
} else {
|
||||
// XXX: need cmd_magic header for r_core_magic
|
||||
if (l > 0) {
|
||||
r_core_magic (core, input + 1, true);
|
||||
r_core_magic (core, input + 1, true, false);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user