Skip to content

Commit

Permalink
Merge pull request VirusTotal#178 from wxsBSD/IMAGE_FILE_MACHINE_AMD64
Browse files Browse the repository at this point in the history
Use IMAGE_FILE_MACHINE_AMD64 appropriately.
  • Loading branch information
plusvic committed Sep 18, 2014
2 parents 86ec8c7 + f4b2c31 commit 6a1c56a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libyara/modules/pe.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ PIMAGE_DATA_DIRECTORY pe_get_directory_entry(
{
PIMAGE_DATA_DIRECTORY result;

if (pe->header->FileHeader.Machine == 0x8664) // is a 64-bit PE ?
if (pe->header->FileHeader.Machine == IMAGE_FILE_MACHINE_AMD64)
result = &((PIMAGE_NT_HEADERS64) pe->header)->
OptionalHeader.DataDirectory[entry];
else
Expand Down Expand Up @@ -414,7 +414,7 @@ void pe_parse(
char section_name[IMAGE_SIZEOF_SHORT_NAME + 1];

#define OptionalHeader(field) \
(pe->header->FileHeader.Machine == 0x8664 ? \
(pe->header->FileHeader.Machine == IMAGE_FILE_MACHINE_AMD64 ? \
((PIMAGE_NT_HEADERS64) pe->header)->OptionalHeader.field : \
pe->header->OptionalHeader.field)

Expand Down

0 comments on commit 6a1c56a

Please sign in to comment.