From 5c9ec638579ef53b923ee23689a417a1698d4381 Mon Sep 17 00:00:00 2001 From: pancake Date: Tue, 8 Nov 2016 14:27:37 +0100 Subject: [PATCH] Add parameter to Sf --- libr/core/cmd_section.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/libr/core/cmd_section.c b/libr/core/cmd_section.c index ebccd4c907..f403cb2ae1 100644 --- a/libr/core/cmd_section.c +++ b/libr/core/cmd_section.c @@ -118,7 +118,7 @@ static int cmd_section(void *data, const char *input) { "Sa","[-] [A] [B] [[off]]","Specify arch and bits for given section", "Sd[a]"," [file]","dump current (all) section to a file (see dmd)", "Sl"," [file]","load contents of file into current section (see dml)", - "Sf","","Alias for S 0 0 $s $s foo mrwx", + "Sf"," [baddr]","Alias for S 0 0 $s $s foo mrwx", "Sj","","list sections in JSON (alias for iSj)", "Sr"," [name]","rename section on current seek", "S"," off va sz vsz name mrwx","add new section (if(!vsz)vsz=sz)", @@ -132,10 +132,15 @@ static int cmd_section(void *data, const char *input) { r_core_cmd_help (core, help_msg); // TODO: add command to resize current section break; - case 'f': - r_core_cmd0 (core, "S 0 0 $s $s foo mrwx"); + case 'f': // "Sf" + if (input[1] == ' ') { + ut64 n = r_num_math (core->num, input + 1); + r_core_cmdf (core, "S 0x%"PFMT64x" 0x%"PFMT64x" $s $s foo mrwx", n, n); + } else { + r_core_cmd0 (core, "S 0 0 $s $s foo mrwx"); + } break; - case 'j': + case 'j': // "Sj" r_core_cmd0 (core, "iSj"); break; case 'a':