mirror of
https://github.com/radareorg/radare2.git
synced 2025-02-10 00:02:39 +00:00
Implement pcV command to print byte array in Vlang
This commit is contained in:
parent
2a20689969
commit
32d8fd8dc9
@ -295,6 +295,7 @@ static const char *help_msg_pc[] = {
|
||||
"pcS", "", "shellscript that reconstructs the bin",
|
||||
"pcs", "", "string",
|
||||
"pcv", "", "JaVa",
|
||||
"pcV", "", "V (vlang.io)",
|
||||
"pcw", "", "C words (4 byte)",
|
||||
"pcy", "", "yara",
|
||||
"pcz", "", "Swift",
|
||||
@ -4767,6 +4768,18 @@ R_API void r_print_code(RPrint *p, ut64 addr, const ut8 *buf, int len, char lang
|
||||
}
|
||||
p->cb_printf ("};\n");
|
||||
break;
|
||||
case 'V': // "pcV" // vlang.io
|
||||
p->cb_printf ("data := [ byte(%d),\n ", buf[0]);
|
||||
for (i = 1; !p->interrupt && i < len; i++) {
|
||||
r_print_cursor (p, i, 1, 1);
|
||||
p->cb_printf ("%d%s", buf[i], (i + 1 < len)? ", ": "");
|
||||
r_print_cursor (p, i, 1, 0);
|
||||
if ((i %10) == 0) {
|
||||
p->cb_printf ("\n ");
|
||||
}
|
||||
}
|
||||
p->cb_printf ("\n]\n");
|
||||
break;
|
||||
case 'y': // "pcy"
|
||||
p->cb_printf ("$hex_%"PFMT64x" = {");
|
||||
for (i = 0; !p->interrupt && i < len; i++) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user