From 9d75af02d905f6005b9cee7f79615569d7d14dd4 Mon Sep 17 00:00:00 2001 From: midipix Date: Tue, 15 Nov 2016 00:07:23 -0500 Subject: driver: added --sections support (print image sections). --- include/perk/perk_output.h | 1 + src/driver/pe_driver_ctx.c | 4 ++++ src/internal/perk_driver_impl.h | 1 + src/skin/pe_skin_default.c | 3 +++ 4 files changed, 9 insertions(+) diff --git a/include/perk/perk_output.h b/include/perk/perk_output.h index b5ad5c5..ab91f87 100644 --- a/include/perk/perk_output.h +++ b/include/perk/perk_output.h @@ -10,6 +10,7 @@ #define PERK_OUTPUT_IMPORT_LIBS 0x00000002 #define PERK_OUTPUT_IMPORT_SYMS 0x00000004 #define PERK_OUTPUT_IMAGE_TYPE 0x00000008 +#define PERK_OUTPUT_IMAGE_SECTIONS 0x00000010 /* pretty-printer flags */ diff --git a/src/driver/pe_driver_ctx.c b/src/driver/pe_driver_ctx.c index 021a7fb..8ca3ba6 100644 --- a/src/driver/pe_driver_ctx.c +++ b/src/driver/pe_driver_ctx.c @@ -164,6 +164,10 @@ int pe_get_driver_ctx( cctx.fmtflags |= PERK_OUTPUT_IMAGE_TYPE; break; + case TAG_SECTIONS: + cctx.fmtflags |= PERK_OUTPUT_IMAGE_SECTIONS; + break; + case TAG_EXPSYMS: cctx.fmtflags |= PERK_OUTPUT_EXPORT_SYMS; break; diff --git a/src/internal/perk_driver_impl.h b/src/internal/perk_driver_impl.h index 9581210..5ca0bc3 100644 --- a/src/internal/perk_driver_impl.h +++ b/src/internal/perk_driver_impl.h @@ -17,6 +17,7 @@ enum app_tags { TAG_OUTPUT, TAG_PRETTY, TAG_IMGTYPE, + TAG_SECTIONS, TAG_EXPSYMS, TAG_IMPLIBS, TAG_IMPSYMS, diff --git a/src/skin/pe_skin_default.c b/src/skin/pe_skin_default.c index 56fbd14..8bf40e1 100644 --- a/src/skin/pe_skin_default.c +++ b/src/skin/pe_skin_default.c @@ -17,6 +17,9 @@ const struct argv_option pe_default_options[] = { {"type", 't',TAG_IMGTYPE,ARGV_OPTARG_NONE,0,0,0, "print image type"}, + {"sections", 's',TAG_SECTIONS,ARGV_OPTARG_NONE,0,0,0, + "print image sections"}, + {"expsyms", 'e',TAG_EXPSYMS,ARGV_OPTARG_NONE,0,0,0, "print exported symbols" }, -- cgit v1.2.3