Skip to content

Commit

Permalink
fileinfo/coff: fix infinity loop in broken binary (#242)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbandzi committed Mar 14, 2018
1 parent 920ea0d commit eb22bc3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/fileformat/file_format/coff/coff_format.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ std::size_t CoffFormat::getBytesPerWord() const
case PELIB_IMAGE_FILE_MACHINE_R3000_LITTLE:
return 4;
case PELIB_IMAGE_FILE_MACHINE_R4000:
return is32BitArchitecture() ? 4 : 8;
return getFileFlags() & IMAGE_FILE_32BIT_MACHINE ? 4 : 8;
case PELIB_IMAGE_FILE_MACHINE_R10000:
return 8;
case PELIB_IMAGE_FILE_MACHINE_WCEMIPSV2:
Expand All @@ -535,7 +535,7 @@ std::size_t CoffFormat::getBytesPerWord() const
// Architecture::POWERPC
case PELIB_IMAGE_FILE_MACHINE_POWERPC:
case PELIB_IMAGE_FILE_MACHINE_POWERPCFP:
return is32BitArchitecture() ? 4 : 8;
return getFileFlags() & IMAGE_FILE_32BIT_MACHINE ? 4 : 8;

// unsupported architecture
default:
Expand Down

0 comments on commit eb22bc3

Please sign in to comment.