summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2025-06-18 04:47:07 +0000
committermidipix <writeonce@midipix.org>2025-06-18 04:47:07 +0000
commit733dcf7478d466eac6bfef09efee476d43679787 (patch)
treebb6cf0ebcfd723ebb5d844796f3ef20549bf5259 /src
parentc5998808867bf8209722357c745508c592d337cf (diff)
downloadperk-733dcf7478d466eac6bfef09efee476d43679787.tar.bz2
perk-733dcf7478d466eac6bfef09efee476d43679787.tar.xz
driver: added the --relocs switch (image base relocations).
Diffstat (limited to 'src')
-rw-r--r--src/cmds/pe_cmd_perk.c3
-rw-r--r--src/driver/pe_driver_ctx.c4
-rw-r--r--src/internal/perk_driver_impl.h1
-rw-r--r--src/skin/pe_skin_perk.c4
4 files changed, 12 insertions, 0 deletions
diff --git a/src/cmds/pe_cmd_perk.c b/src/cmds/pe_cmd_perk.c
index bdb6364..37b80ee 100644
--- a/src/cmds/pe_cmd_perk.c
+++ b/src/cmds/pe_cmd_perk.c
@@ -64,6 +64,9 @@ static void pe_perform_unit_actions_impl(
if ((flags & PERK_OUTPUT_MDSO_LIBS) || (flags & PERK_OUTPUT_MDSO_SYMS))
pe_output_mdso_libraries(dctx,meta);
+ if (flags & PERK_OUTPUT_BASE_RELOCS)
+ pe_output_base_relocs(dctx,meta);
+
if (dctx->cctx->hdrdump)
pe_perform_hdrdump_actions(dctx,meta);
}
diff --git a/src/driver/pe_driver_ctx.c b/src/driver/pe_driver_ctx.c
index 6a260bd..9e6a17e 100644
--- a/src/driver/pe_driver_ctx.c
+++ b/src/driver/pe_driver_ctx.c
@@ -251,6 +251,10 @@ static int pe_cctx_update(
cctx->fmtflags |= PERK_OUTPUT_IMAGE_STRINGS;
break;
+ case TAG_RELOCS:
+ cctx->fmtflags |= PERK_OUTPUT_BASE_RELOCS;
+ 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 5cd0d73..fdf75c3 100644
--- a/src/internal/perk_driver_impl.h
+++ b/src/internal/perk_driver_impl.h
@@ -32,6 +32,7 @@ enum app_tags {
TAG_IMPSYMS,
TAG_DSOLIBS,
TAG_DSOSYMS,
+ TAG_RELOCS,
TAG_HDRDUMP,
TAG_AR_LIST_MEMBERS,
TAG_AR_PRINT_MEMBERS,
diff --git a/src/skin/pe_skin_perk.c b/src/skin/pe_skin_perk.c
index 3678341..fd891c8 100644
--- a/src/skin/pe_skin_perk.c
+++ b/src/skin/pe_skin_perk.c
@@ -44,6 +44,10 @@ const perk_hidden struct argv_option pe_perk_options[] = {
"list .dsometa (mdso) dependency libraries "
"along with referenced symbols"},
+ {"relocs", 'r',TAG_RELOCS,ARGV_OPTARG_NONE,0,0,0,
+ "list image base relocations found "
+ "in the .reloc section"},
+
{"hdrdump", 'X',TAG_HDRDUMP,ARGV_OPTARG_OPTIONAL,0,
"dos|image.dos|"
"coff|coff.image|coff.object|coff.optional|"