diff options
-rw-r--r-- | src/headers/pe_get_image_opt_hdr_addr.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/headers/pe_get_image_opt_hdr_addr.c b/src/headers/pe_get_image_opt_hdr_addr.c index d784aed..7fcd0ad 100644 --- a/src/headers/pe_get_image_opt_hdr_addr.c +++ b/src/headers/pe_get_image_opt_hdr_addr.c @@ -11,10 +11,12 @@ pe_api union pe_raw_opt_hdr * pe_get_image_opt_hdr_addr(const void * base) { - struct pe_raw_coff_file_hdr * coff; + struct pe_raw_coff_file_hdr * coff; + void * addr; if (!(coff = pe_get_image_coff_hdr_addr(base))) return 0; - else - return (union pe_raw_opt_hdr *)pe_va_from_rva(coff, sizeof(*coff)); + + addr = pe_va_from_rva(coff,sizeof(*coff)); + return (union pe_raw_opt_hdr *)addr; } |