summaryrefslogtreecommitdiffhomepage
path: root/src/headers
diff options
context:
space:
mode:
Diffstat (limited to 'src/headers')
-rw-r--r--src/headers/pe_get_image_coff_hdr_addr.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/headers/pe_get_image_coff_hdr_addr.c b/src/headers/pe_get_image_coff_hdr_addr.c
index 1a2d9cf..516c30b 100644
--- a/src/headers/pe_get_image_coff_hdr_addr.c
+++ b/src/headers/pe_get_image_coff_hdr_addr.c
@@ -9,7 +9,7 @@
#include <pemagine/pe_structs.h>
#include <pemagine/pemagine.h>
-pe_api
+
struct pe_raw_coff_file_hdr * pe_get_image_coff_hdr_addr(const void * base)
{
struct pe_raw_image_dos_hdr * dos;
@@ -19,12 +19,12 @@ struct pe_raw_coff_file_hdr * pe_get_image_coff_hdr_addr(const void * base)
if (!(dos = pe_get_image_dos_hdr_addr(base)))
return 0;
- offset = (uint32_t *)(dos->dos_lfanew);
- coff = (struct pe_raw_coff_file_hdr *)pe_va_from_rva(base,*offset);
+ offset = (uint32_t *)(dos->dos_lfanew);
+ coff = (struct pe_raw_coff_file_hdr *)pe_va_from_rva(base,*offset);
- if ((coff->signature[0] == 'P') && (coff->signature[1] == 'E')
- && (coff->signature[2] == '\0') && (coff->signature[3] == '\0'))
- return coff;
- else
- return 0;
+ return ((coff->signature[0] == 'P')
+ && (coff->signature[1] == 'E')
+ && (coff->signature[2] == '\0')
+ && (coff->signature[3] == '\0'))
+ ? coff : 0;
}