diff options
author | midipix <writeonce@midipix.org> | 2025-05-30 22:16:01 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2025-05-30 23:44:08 +0000 |
commit | 9e2275f12aea1d90c206ea597f42cdd82f9a38ae (patch) | |
tree | 51c582d37514aa079818f8f845353910a5b08cd5 /src | |
parent | 77fbc135fe043aa259c264ba60088491d1a4bbfc (diff) | |
download | perk-9e2275f12aea1d90c206ea597f42cdd82f9a38ae.tar.bz2 perk-9e2275f12aea1d90c206ea597f42cdd82f9a38ae.tar.xz |
library api: _hexdump_ (header and section pretty printing) namespace overhaul.
Diffstat (limited to 'src')
-rw-r--r-- | src/cmds/pe_cmd_perk.c | 14 | ||||
-rw-r--r-- | src/hexdump/pe_hexdump_coff_image_hdr.c (renamed from src/hdrdump/pe_hdrdump_coff_image_hdr.c) | 4 | ||||
-rw-r--r-- | src/hexdump/pe_hexdump_coff_object_hdr.c (renamed from src/hdrdump/pe_hdrdump_coff_object_hdr.c) | 4 | ||||
-rw-r--r-- | src/hexdump/pe_hexdump_coff_opt_hdr.c (renamed from src/hdrdump/pe_hdrdump_coff_opt_hdr.c) | 12 | ||||
-rw-r--r-- | src/hexdump/pe_hexdump_export_hdr.c (renamed from src/hdrdump/pe_hdrdump_export_hdr.c) | 4 | ||||
-rw-r--r-- | src/hexdump/pe_hexdump_image_dos_hdr.c (renamed from src/hdrdump/pe_hdrdump_image_dos_hdr.c) | 4 | ||||
-rw-r--r-- | src/hexdump/pe_hexdump_import_tbl.c (renamed from src/hdrdump/pe_hdrdump_import_tbl.c) | 8 | ||||
-rw-r--r-- | src/hexdump/pe_hexdump_sec_tbl.c (renamed from src/hdrdump/pe_hdrdump_sec_tbl.c) | 8 | ||||
-rw-r--r-- | src/internal/perk_hexdump_impl.c (renamed from src/internal/perk_hdrdump_impl.c) | 2 | ||||
-rw-r--r-- | src/internal/perk_hexdump_impl.h (renamed from src/internal/perk_hdrdump_impl.h) | 0 |
10 files changed, 30 insertions, 30 deletions
diff --git a/src/cmds/pe_cmd_perk.c b/src/cmds/pe_cmd_perk.c index 0ae6656..5b6f371 100644 --- a/src/cmds/pe_cmd_perk.c +++ b/src/cmds/pe_cmd_perk.c @@ -16,25 +16,25 @@ static void pe_perform_hdrdump_actions( const struct pe_unit_ctx * uctx) { if (dctx->cctx->hdrdump & PERK_HDRDUMP_IMAGE_DOS_HEADER) - pe_hdrdump_image_dos_hdr(dctx,uctx->meta); + pe_hexdump_image_dos_hdr(dctx,uctx->meta); if (dctx->cctx->hdrdump & PERK_HDRDUMP_COFF_IMAGE_HEADER) - pe_hdrdump_coff_image_hdr(dctx,uctx->meta); + pe_hexdump_coff_image_hdr(dctx,uctx->meta); if (dctx->cctx->hdrdump & PERK_HDRDUMP_COFF_OBJECT_HEADER) - pe_hdrdump_coff_object_hdr(dctx,uctx->meta); + pe_hexdump_coff_object_hdr(dctx,uctx->meta); if (dctx->cctx->hdrdump & PERK_HDRDUMP_COFF_OPT_HEADER) - pe_hdrdump_coff_opt_hdr(dctx,uctx->meta); + pe_hexdump_coff_opt_hdr(dctx,uctx->meta); if (dctx->cctx->hdrdump & PERK_HDRDUMP_SECTION_TABLE) - pe_hdrdump_sec_tbl(dctx,uctx->meta); + pe_hexdump_sec_tbl(dctx,uctx->meta); if (dctx->cctx->hdrdump & PERK_HDRDUMP_EXPORT_HEADER) - pe_hdrdump_export_hdr(dctx,uctx->meta); + pe_hexdump_export_hdr(dctx,uctx->meta); if (dctx->cctx->hdrdump & PERK_HDRDUMP_IMPORT_TABLE) - pe_hdrdump_import_tbl(dctx,uctx->meta); + pe_hexdump_import_tbl(dctx,uctx->meta); } static void pe_perform_unit_actions( diff --git a/src/hdrdump/pe_hdrdump_coff_image_hdr.c b/src/hexdump/pe_hexdump_coff_image_hdr.c index 3ce0e2c..c52d8d7 100644 --- a/src/hdrdump/pe_hdrdump_coff_image_hdr.c +++ b/src/hexdump/pe_hexdump_coff_image_hdr.c @@ -11,7 +11,7 @@ #include <perk/perk_structs.h> #include <perk/perk_output.h> #include "perk_driver_impl.h" -#include "perk_hdrdump_impl.h" +#include "perk_hexdump_impl.h" #include "perk_dprintf_impl.h" #include "perk_errinfo_impl.h" @@ -19,7 +19,7 @@ #define PE_RAW_STRUCT coff_image_hdr #define PE_OUTPUT(x) PE_OUTPUT_TABLE(x) -int pe_hdrdump_coff_image_hdr( +int pe_hexdump_coff_image_hdr( const struct pe_driver_ctx * dctx, const struct pe_image_meta * meta) { diff --git a/src/hdrdump/pe_hdrdump_coff_object_hdr.c b/src/hexdump/pe_hexdump_coff_object_hdr.c index 0011a34..083d85d 100644 --- a/src/hdrdump/pe_hdrdump_coff_object_hdr.c +++ b/src/hexdump/pe_hexdump_coff_object_hdr.c @@ -11,7 +11,7 @@ #include <perk/perk_structs.h> #include <perk/perk_output.h> #include "perk_driver_impl.h" -#include "perk_hdrdump_impl.h" +#include "perk_hexdump_impl.h" #include "perk_dprintf_impl.h" #include "perk_errinfo_impl.h" @@ -19,7 +19,7 @@ #define PE_RAW_STRUCT coff_object_hdr #define PE_OUTPUT(x) PE_OUTPUT_TABLE(x) -int pe_hdrdump_coff_object_hdr( +int pe_hexdump_coff_object_hdr( const struct pe_driver_ctx * dctx, const struct pe_image_meta * meta) { diff --git a/src/hdrdump/pe_hdrdump_coff_opt_hdr.c b/src/hexdump/pe_hexdump_coff_opt_hdr.c index fbec549..e6a1e5f 100644 --- a/src/hdrdump/pe_hdrdump_coff_opt_hdr.c +++ b/src/hexdump/pe_hexdump_coff_opt_hdr.c @@ -11,7 +11,7 @@ #include <perk/perk_structs.h> #include <perk/perk_output.h> #include "perk_driver_impl.h" -#include "perk_hdrdump_impl.h" +#include "perk_hexdump_impl.h" #include "perk_dprintf_impl.h" #include "perk_errinfo_impl.h" @@ -19,7 +19,7 @@ #define PE_RAW_STRUCT opt_hdr_32 #define PE_OUTPUT(x) PE_OUTPUT_TABLE(x) -static int pe_hdrdump_opt_hdr_32( +static int pe_hexdump_opt_hdr_32( const struct pe_driver_ctx * dctx, const struct pe_image_meta * meta) { @@ -109,7 +109,7 @@ static int pe_hdrdump_opt_hdr_32( #define PE_RAW_STRUCT opt_hdr_64 #define PE_OUTPUT(x) PE_OUTPUT_TABLE(x) -static int pe_hdrdump_opt_hdr_64( +static int pe_hexdump_opt_hdr_64( const struct pe_driver_ctx * dctx, const struct pe_image_meta * meta) { @@ -190,7 +190,7 @@ static int pe_hdrdump_opt_hdr_64( return 0; } -int pe_hdrdump_coff_opt_hdr( +int pe_hexdump_coff_opt_hdr( const struct pe_driver_ctx * dctx, const struct pe_image_meta * meta) { @@ -199,10 +199,10 @@ int pe_hdrdump_coff_opt_hdr( switch (pe_image_bits(meta)) { case 32: - return pe_hdrdump_opt_hdr_32(dctx,meta); + return pe_hexdump_opt_hdr_32(dctx,meta); case 64: - return pe_hdrdump_opt_hdr_64(dctx,meta); + return pe_hexdump_opt_hdr_64(dctx,meta); default: return PERK_CUSTOM_ERROR( diff --git a/src/hdrdump/pe_hdrdump_export_hdr.c b/src/hexdump/pe_hexdump_export_hdr.c index a413097..d1e3a33 100644 --- a/src/hdrdump/pe_hdrdump_export_hdr.c +++ b/src/hexdump/pe_hexdump_export_hdr.c @@ -11,7 +11,7 @@ #include <perk/perk_structs.h> #include <perk/perk_output.h> #include "perk_driver_impl.h" -#include "perk_hdrdump_impl.h" +#include "perk_hexdump_impl.h" #include "perk_dprintf_impl.h" #include "perk_errinfo_impl.h" @@ -19,7 +19,7 @@ #define PE_RAW_STRUCT export_hdr #define PE_OUTPUT(x) PE_OUTPUT_TABLE(x) -int pe_hdrdump_export_hdr( +int pe_hexdump_export_hdr( const struct pe_driver_ctx * dctx, const struct pe_image_meta * meta) { diff --git a/src/hdrdump/pe_hdrdump_image_dos_hdr.c b/src/hexdump/pe_hexdump_image_dos_hdr.c index c290079..9579279 100644 --- a/src/hdrdump/pe_hdrdump_image_dos_hdr.c +++ b/src/hexdump/pe_hexdump_image_dos_hdr.c @@ -11,7 +11,7 @@ #include <perk/perk_structs.h> #include <perk/perk_output.h> #include "perk_driver_impl.h" -#include "perk_hdrdump_impl.h" +#include "perk_hexdump_impl.h" #include "perk_dprintf_impl.h" #include "perk_errinfo_impl.h" @@ -19,7 +19,7 @@ #define PE_RAW_STRUCT image_dos_hdr #define PE_OUTPUT(x) PE_OUTPUT_TABLE(x) -int pe_hdrdump_image_dos_hdr( +int pe_hexdump_image_dos_hdr( const struct pe_driver_ctx * dctx, const struct pe_image_meta * meta) { diff --git a/src/hdrdump/pe_hdrdump_import_tbl.c b/src/hexdump/pe_hexdump_import_tbl.c index f7cdb24..41c7fe9 100644 --- a/src/hdrdump/pe_hdrdump_import_tbl.c +++ b/src/hexdump/pe_hexdump_import_tbl.c @@ -11,7 +11,7 @@ #include <perk/perk_structs.h> #include <perk/perk_output.h> #include "perk_driver_impl.h" -#include "perk_hdrdump_impl.h" +#include "perk_hexdump_impl.h" #include "perk_dprintf_impl.h" #include "perk_errinfo_impl.h" @@ -19,7 +19,7 @@ #define PE_RAW_STRUCT import_hdr #define PE_OUTPUT(x) PE_OUTPUT_TABLE(x) -static int pe_hdrdump_import_hdr_impl( +static int pe_hexdump_import_hdr_impl( const struct pe_driver_ctx * dctx, const struct pe_image_meta * meta, int32_t idx) @@ -92,7 +92,7 @@ static int pe_hdrdump_import_hdr_impl( return 0; } -int pe_hdrdump_import_tbl( +int pe_hexdump_import_tbl( const struct pe_driver_ctx * dctx, const struct pe_image_meta * meta) { @@ -102,7 +102,7 @@ int pe_hdrdump_import_tbl( return 0; for (idx=0; idx<=meta->m_stats.t_nimplibs; idx++) - if (pe_hdrdump_import_hdr_impl(dctx,meta,idx) < 0) + if (pe_hexdump_import_hdr_impl(dctx,meta,idx) < 0) return PERK_NESTED_ERROR(dctx); return 0; diff --git a/src/hdrdump/pe_hdrdump_sec_tbl.c b/src/hexdump/pe_hexdump_sec_tbl.c index 8379d6d..a9c74b0 100644 --- a/src/hdrdump/pe_hdrdump_sec_tbl.c +++ b/src/hexdump/pe_hexdump_sec_tbl.c @@ -11,7 +11,7 @@ #include <perk/perk_structs.h> #include <perk/perk_output.h> #include "perk_driver_impl.h" -#include "perk_hdrdump_impl.h" +#include "perk_hexdump_impl.h" #include "perk_dprintf_impl.h" #include "perk_errinfo_impl.h" @@ -19,7 +19,7 @@ #define PE_RAW_STRUCT sec_hdr #define PE_OUTPUT(x) PE_OUTPUT_TABLE(x) -static int pe_hdrdump_sec_hdr_impl( +static int pe_hexdump_sec_hdr_impl( const struct pe_driver_ctx * dctx, const struct pe_image_meta * meta, uint32_t idx) @@ -69,14 +69,14 @@ static int pe_hdrdump_sec_hdr_impl( return 0; } -int pe_hdrdump_sec_tbl( +int pe_hexdump_sec_tbl( const struct pe_driver_ctx * dctx, const struct pe_image_meta * meta) { uint32_t idx; for (idx=0; idx<meta->m_coff.cfh_num_of_sections; idx++) - if (pe_hdrdump_sec_hdr_impl(dctx,meta,idx) < 0) + if (pe_hexdump_sec_hdr_impl(dctx,meta,idx) < 0) return PERK_NESTED_ERROR(dctx); return 0; diff --git a/src/internal/perk_hdrdump_impl.c b/src/internal/perk_hexdump_impl.c index 314edef..01effe0 100644 --- a/src/internal/perk_hdrdump_impl.c +++ b/src/internal/perk_hexdump_impl.c @@ -10,7 +10,7 @@ #include <perk/perk.h> #include <perk/perk_consts.h> #include <perk/perk_structs.h> -#include "perk_hdrdump_impl.h" +#include "perk_hexdump_impl.h" #include "perk_visibility_impl.h" #define PE_TABWIDTH 8 diff --git a/src/internal/perk_hdrdump_impl.h b/src/internal/perk_hexdump_impl.h index 379d427..379d427 100644 --- a/src/internal/perk_hdrdump_impl.h +++ b/src/internal/perk_hexdump_impl.h |