summaryrefslogtreecommitdiffhomepage
path: root/src/driver/pe_driver_ctx.c
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2025-06-19 08:04:02 +0000
committermidipix <writeonce@midipix.org>2025-06-19 08:04:02 +0000
commit9026146d6d20c072dd93ff4f76de620fda673333 (patch)
tree30b003fe4b3d27e95e0e6b559d96b47be9d7dd15 /src/driver/pe_driver_ctx.c
parent9e61fe4e018817c889b8897324d9fd25eccc409a (diff)
downloadperk-9026146d6d20c072dd93ff4f76de620fda673333.tar.bz2
perk-9026146d6d20c072dd93ff4f76de620fda673333.tar.xz
driver: added --cmd=strings support, pe_cmd_strings() stub, and perk-strings symlink.
Diffstat (limited to 'src/driver/pe_driver_ctx.c')
-rw-r--r--src/driver/pe_driver_ctx.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/driver/pe_driver_ctx.c b/src/driver/pe_driver_ctx.c
index 8e652af..955484a 100644
--- a/src/driver/pe_driver_ctx.c
+++ b/src/driver/pe_driver_ctx.c
@@ -33,6 +33,7 @@ static const char * const perk_cmd_name[PERK_CMD_CAP] = {
[PERK_CMD_SIZE] = "size",
[PERK_CMD_STRIP] = "strip",
[PERK_CMD_RANLIB] = "ranlib",
+ [PERK_CMD_STRINGS] = "strings",
};
/* perk command options */
@@ -44,6 +45,7 @@ static const struct argv_option * perk_cmd_options[PERK_CMD_CAP] = {
[PERK_CMD_SIZE] = pe_size_options,
[PERK_CMD_STRIP] = pe_strip_options,
[PERK_CMD_RANLIB] = pe_ranlib_options,
+ [PERK_CMD_STRINGS] = pe_strings_options,
};
/* default fd context */
@@ -131,6 +133,12 @@ static int pe_driver_usage(
cmdname,cmdname);
break;
+ case PERK_CMD_STRINGS:
+ snprintf(header,sizeof(header),
+ PERK_STRINGS_CMD_SYNOPSIS,
+ cmdname,cmdname);
+ break;
+
case PERK_CMD_PERK:
snprintf(header,sizeof(header),
PERK_PERK_CMD_SYNOPSIS,
@@ -530,6 +538,9 @@ int pe_lib_get_driver_ctx(
} else if (cctx.cmd == PERK_CMD_RANLIB) {
argv_optv_init(pe_ranlib_options,optv);
+
+ } else if (cctx.cmd == PERK_CMD_STRINGS) {
+ argv_optv_init(pe_strings_options,optv);
}
/* process the selected tool's command-line arguments */