From 71ed2fda0285acf148a38f443490435350df6b4e Mon Sep 17 00:00:00 2001 From: midipix Date: Sun, 11 Nov 2018 22:31:47 -0500 Subject: output: header dump: added pe_hdrdump_image_dos_hdr(). --- src/internal/perk_hdrdump_impl.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/internal') diff --git a/src/internal/perk_hdrdump_impl.h b/src/internal/perk_hdrdump_impl.h index 41528ad..5adb63d 100644 --- a/src/internal/perk_hdrdump_impl.h +++ b/src/internal/perk_hdrdump_impl.h @@ -46,4 +46,18 @@ size_t pe_output_raw_element( uint32_t moffset, uint32_t msize); +static inline int pe_image_bits(const struct pe_image_meta * m) +{ + switch (m->m_abi) { + case PE_ABI_PE32: + return 32; + + case PE_ABI_PE64: + return 64; + + default: + return -1; + } +} + #endif -- cgit v1.2.3