summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-03-02 12:01:40 -0500
committermidipix <writeonce@midipix.org>2016-11-10 23:35:38 -0500
commit08a8944a7ecd8faa1fbe09e4bb0abbd3970735a6 (patch)
tree8f0d4091d24fd11e934b7bfbe85a53420912ad52
parent951ee88a077c949e4eb3c5a7d4489f57443cf081 (diff)
downloadperk-08a8944a7ecd8faa1fbe09e4bb0abbd3970735a6.tar.bz2
perk-08a8944a7ecd8faa1fbe09e4bb0abbd3970735a6.tar.xz
output: implemented --pretty=dlltool for exported symbols.
-rw-r--r--include/perk/perk_output.h1
-rw-r--r--src/driver/pe_driver_ctx.c2
-rw-r--r--src/output/pe_output_export_symbols.c8
-rw-r--r--src/skin/pe_skin_default.c2
4 files changed, 9 insertions, 4 deletions
diff --git a/include/perk/perk_output.h b/include/perk/perk_output.h
index 91c8aee..0d03181 100644
--- a/include/perk/perk_output.h
+++ b/include/perk/perk_output.h
@@ -17,5 +17,6 @@
#define PERK_PRETTY_READOBJ PERK_PRETTY(0x00000004)
#define PERK_PRETTY_OBJDUMP PERK_PRETTY(0x00000008)
#define PERK_PRETTY_YAML PERK_PRETTY(0x00000010)
+#define PERK_PRETTY_DLLTOOL PERK_PRETTY(0x00000020)
#endif
diff --git a/src/driver/pe_driver_ctx.c b/src/driver/pe_driver_ctx.c
index bf55e5e..6d02c69 100644
--- a/src/driver/pe_driver_ctx.c
+++ b/src/driver/pe_driver_ctx.c
@@ -169,6 +169,8 @@ int pe_get_driver_ctx(
if (pretty && !strcmp(pretty,"yaml"))
cctx.fmtflags |= PERK_PRETTY_YAML;
+ else if (pretty && !strcmp(pretty,"dlltool"))
+ cctx.fmtflags |= PERK_PRETTY_DLLTOOL;
if (!(ctx = pe_driver_ctx_alloc(meta,&cctx,nunits)) && cctx.output)
close(fdout);
diff --git a/src/output/pe_output_export_symbols.c b/src/output/pe_output_export_symbols.c
index 642d539..0ab3539 100644
--- a/src/output/pe_output_export_symbols.c
+++ b/src/output/pe_output_export_symbols.c
@@ -16,9 +16,11 @@
static int pretty_header(const struct pe_common_ctx * cctx, FILE * fout)
{
- return (cctx->fmtflags & PERK_PRETTY_YAML)
- ? fputs("exports:\n",fout)
- : 0;
+ if (cctx->fmtflags & PERK_PRETTY_YAML)
+ return fputs("exports:\n",fout);
+ else if (cctx->fmtflags & PERK_PRETTY_DLLTOOL)
+ return fputs("EXPORTS\n",fout);
+ return 0;
}
static int pretty_export_item(const struct pe_common_ctx * cctx, const char * name, FILE * fout)
diff --git a/src/skin/pe_skin_default.c b/src/skin/pe_skin_default.c
index c9e374d..21fab05 100644
--- a/src/skin/pe_skin_default.c
+++ b/src/skin/pe_skin_default.c
@@ -11,7 +11,7 @@ const struct argv_option pe_default_options[] = {
{"output", 'o',TAG_OUTPUT,ARGV_OPTARG_REQUIRED,0,0,"<file>",
"write output to %s"},
- {"pretty", 'p',TAG_PRETTY,ARGV_OPTARG_REQUIRED,0,"yaml",0,
+ {"pretty", 'p',TAG_PRETTY,ARGV_OPTARG_REQUIRED,0,"yaml|dlltool",0,
"format output for parsing by %s"},
{"expsyms", 'e',TAG_EXPSYMS,ARGV_OPTARG_NONE,0,0,0,