summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cmds/pe_cmd_ranlib.c15
-rw-r--r--src/cmds/pe_cmd_strings.c15
-rw-r--r--src/cmds/pe_cmd_strip.c15
-rw-r--r--src/driver/pe_amain.c12
-rw-r--r--src/driver/pe_driver_ctx.c34
-rw-r--r--src/internal/perk_driver_impl.h3
-rw-r--r--src/internal/perk_synopsis_impl.h31
-rw-r--r--src/skin/pe_skin_default.c2
-rw-r--r--src/skin/pe_skin_ranlib.c13
-rw-r--r--src/skin/pe_skin_strings.c13
-rw-r--r--src/skin/pe_skin_strip.c13
11 files changed, 164 insertions, 2 deletions
diff --git a/src/cmds/pe_cmd_ranlib.c b/src/cmds/pe_cmd_ranlib.c
new file mode 100644
index 0000000..5d6f078
--- /dev/null
+++ b/src/cmds/pe_cmd_ranlib.c
@@ -0,0 +1,15 @@
+/***************************************************************/
+/* perk: PE Resource Kit */
+/* Copyright (C) 2015--2025 SysDeer Technologies, LLC */
+/* Released under GPLv2 and GPLv3; see COPYING.PERK. */
+/***************************************************************/
+
+#include <perk/perk.h>
+#include "perk_driver_impl.h"
+
+int pe_cmd_ranlib(const struct pe_driver_ctx * dctx, const char * path)
+{
+ (void)dctx;
+ (void)path;
+ return 0;
+}
diff --git a/src/cmds/pe_cmd_strings.c b/src/cmds/pe_cmd_strings.c
new file mode 100644
index 0000000..b4ccf68
--- /dev/null
+++ b/src/cmds/pe_cmd_strings.c
@@ -0,0 +1,15 @@
+/***************************************************************/
+/* perk: PE Resource Kit */
+/* Copyright (C) 2015--2025 SysDeer Technologies, LLC */
+/* Released under GPLv2 and GPLv3; see COPYING.PERK. */
+/***************************************************************/
+
+#include <perk/perk.h>
+#include "perk_driver_impl.h"
+
+int pe_cmd_strings(const struct pe_driver_ctx * dctx, const char * path)
+{
+ (void)dctx;
+ (void)path;
+ return 0;
+}
diff --git a/src/cmds/pe_cmd_strip.c b/src/cmds/pe_cmd_strip.c
new file mode 100644
index 0000000..10e70d4
--- /dev/null
+++ b/src/cmds/pe_cmd_strip.c
@@ -0,0 +1,15 @@
+/***************************************************************/
+/* perk: PE Resource Kit */
+/* Copyright (C) 2015--2025 SysDeer Technologies, LLC */
+/* Released under GPLv2 and GPLv3; see COPYING.PERK. */
+/***************************************************************/
+
+#include <perk/perk.h>
+#include "perk_driver_impl.h"
+
+int pe_cmd_strip(const struct pe_driver_ctx * dctx, const char * path)
+{
+ (void)dctx;
+ (void)path;
+ return 0;
+}
diff --git a/src/driver/pe_amain.c b/src/driver/pe_amain.c
index 5b85bef..63cec52 100644
--- a/src/driver/pe_amain.c
+++ b/src/driver/pe_amain.c
@@ -105,6 +105,18 @@ int pe_main(char ** argv, char ** envp, const struct pe_fd_ctx * fdctx)
pe_cmd_common(dctx,pe_cmd_size);
break;
+ case PERK_CMD_STRIP:
+ pe_cmd_common(dctx,pe_cmd_strip);
+ break;
+
+ case PERK_CMD_RANLIB:
+ pe_cmd_common(dctx,pe_cmd_ranlib);
+ break;
+
+ case PERK_CMD_STRINGS:
+ pe_cmd_common(dctx,pe_cmd_strings);
+ break;
+
case PERK_CMD_AR:
arflags = dctx->cctx->drvflags;
diff --git a/src/driver/pe_driver_ctx.c b/src/driver/pe_driver_ctx.c
index b99ee7f..955484a 100644
--- a/src/driver/pe_driver_ctx.c
+++ b/src/driver/pe_driver_ctx.c
@@ -31,6 +31,9 @@ static const char * const perk_cmd_name[PERK_CMD_CAP] = {
[PERK_CMD_AR] = "ar",
[PERK_CMD_NM] = "nm",
[PERK_CMD_SIZE] = "size",
+ [PERK_CMD_STRIP] = "strip",
+ [PERK_CMD_RANLIB] = "ranlib",
+ [PERK_CMD_STRINGS] = "strings",
};
/* perk command options */
@@ -40,6 +43,9 @@ static const struct argv_option * perk_cmd_options[PERK_CMD_CAP] = {
[PERK_CMD_AR] = pe_ar_options,
[PERK_CMD_NM] = pe_nm_options,
[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 */
@@ -114,6 +120,25 @@ static int pe_driver_usage(
cmdname,cmdname);
break;
+ case PERK_CMD_STRIP:
+ snprintf(header,sizeof(header),
+ PERK_STRIP_CMD_SYNOPSIS,
+ cmdname,cmdname,cmdname,cmdname,
+ cmdname,cmdname,cmdname);
+ break;
+
+ case PERK_CMD_RANLIB:
+ snprintf(header,sizeof(header),
+ PERK_RANLIB_CMD_SYNOPSIS,
+ 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,
@@ -507,6 +532,15 @@ int pe_lib_get_driver_ctx(
} else if (cctx.cmd == PERK_CMD_SIZE) {
argv_optv_init(pe_size_options,optv);
+
+ } else if (cctx.cmd == PERK_CMD_STRIP) {
+ argv_optv_init(pe_strip_options,optv);
+
+ } 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 */
diff --git a/src/internal/perk_driver_impl.h b/src/internal/perk_driver_impl.h
index 453a032..db0ffc7 100644
--- a/src/internal/perk_driver_impl.h
+++ b/src/internal/perk_driver_impl.h
@@ -17,6 +17,9 @@ extern const struct argv_option pe_perk_options[];
extern const struct argv_option pe_ar_options[];
extern const struct argv_option pe_nm_options[];
extern const struct argv_option pe_size_options[];
+extern const struct argv_option pe_strip_options[];
+extern const struct argv_option pe_ranlib_options[];
+extern const struct argv_option pe_strings_options[];
enum app_tags {
TAG_HELP,
diff --git a/src/internal/perk_synopsis_impl.h b/src/internal/perk_synopsis_impl.h
index 921a1db..1c53f52 100644
--- a/src/internal/perk_synopsis_impl.h
+++ b/src/internal/perk_synopsis_impl.h
@@ -44,8 +44,37 @@
+#define PERK_STRIP_CMD_SYNOPSIS \
+ "%s — PE/COFF Fluff Removal Utility\n\n" \
+ "Synopsis:\n" \
+ " %s [-V] [-v] [-p] [-o output] <file> \n" \
+ " %s [-X] [-x] <file> ... \n" \
+ " %s [-s] [-g|-d|-S] <file> ... \n" \
+ " %s [-w] [-R secname] ... <file> ... \n" \
+ " %s [-w] [-K symname] ... <file> ... \n" \
+ " %s [-w] [-N symname] ... <file> ... \n\n" \
+ "Options:\n"
+
+
+
+#define PERK_RANLIB_CMD_SYNOPSIS \
+ "%s — PE/COFF Archive Indexer\n\n" \
+ "Synopsis:\n" \
+ " %s [-V] [-D|-U] [-t] <file> ...\n\n" \
+ "Options:\n"
+
+
+
+#define PERK_STRINGS_CMD_SYNOPSIS \
+ "%s — PE/COFF String Finder\n\n" \
+ "Synopsis:\n" \
+ " %s [-V] [-a] [-t format] [-n number] <file> ...\n\n" \
+ "Options:\n"
+
+
+
#define PERK_AR_CMD_SYNOPSIS \
- "%s — the PE/COFF Resource Kit Archiver\n\n" \
+ "%s — the PE/COFF Archive Manipulator\n\n" \
"Synopsis:\n" \
" %s -d [-v] <archive> <file> ...\n" \
" %s -p [-v] [-s] <archive> <file> ...\n" \
diff --git a/src/skin/pe_skin_default.c b/src/skin/pe_skin_default.c
index 5e1ec12..85c420c 100644
--- a/src/skin/pe_skin_default.c
+++ b/src/skin/pe_skin_default.c
@@ -10,7 +10,7 @@ const perk_hidden struct argv_option pe_default_options[] = {
"show usage information [listing %s options only]"},
{"cmd", 0,TAG_CMD,ARGV_OPTARG_REQUIRED,0,
- "perk|ar|nm|size",0,
+ "perk|ar|nm|size|strip|ranlib|strings",0,
"invoke one of the following perk commands: {%s}"},
{0,0,0,0,0,0,0,0}
diff --git a/src/skin/pe_skin_ranlib.c b/src/skin/pe_skin_ranlib.c
new file mode 100644
index 0000000..f928983
--- /dev/null
+++ b/src/skin/pe_skin_ranlib.c
@@ -0,0 +1,13 @@
+#include "perk_driver_impl.h"
+#include "perk_visibility_impl.h"
+#include "argv/argv.h"
+
+const perk_hidden struct argv_option pe_ranlib_options[] = {
+ {"version", 'V',TAG_VERSION,ARGV_OPTARG_NONE,0,0,0,
+ "show version information"},
+
+ {"help", 'h',TAG_HELP,ARGV_OPTARG_OPTIONAL,0,"short|long",0,
+ "show usage information [listing %s options only]"},
+
+ {0,0,0,0,0,0,0,0}
+};
diff --git a/src/skin/pe_skin_strings.c b/src/skin/pe_skin_strings.c
new file mode 100644
index 0000000..3a1e69d
--- /dev/null
+++ b/src/skin/pe_skin_strings.c
@@ -0,0 +1,13 @@
+#include "perk_driver_impl.h"
+#include "perk_visibility_impl.h"
+#include "argv/argv.h"
+
+const perk_hidden struct argv_option pe_strings_options[] = {
+ {"version", 'V',TAG_VERSION,ARGV_OPTARG_NONE,0,0,0,
+ "show version information"},
+
+ {"help", 'h',TAG_HELP,ARGV_OPTARG_OPTIONAL,0,"short|long",0,
+ "show usage information [listing %s options only]"},
+
+ {0,0,0,0,0,0,0,0}
+};
diff --git a/src/skin/pe_skin_strip.c b/src/skin/pe_skin_strip.c
new file mode 100644
index 0000000..d225f12
--- /dev/null
+++ b/src/skin/pe_skin_strip.c
@@ -0,0 +1,13 @@
+#include "perk_driver_impl.h"
+#include "perk_visibility_impl.h"
+#include "argv/argv.h"
+
+const perk_hidden struct argv_option pe_strip_options[] = {
+ {"version", 'V',TAG_VERSION,ARGV_OPTARG_NONE,0,0,0,
+ "show version information"},
+
+ {"help", 'h',TAG_HELP,ARGV_OPTARG_OPTIONAL,0,"short|long",0,
+ "show usage information [listing %s options only]"},
+
+ {0,0,0,0,0,0,0,0}
+};