Menu ▾ ▴

#826 Big-Endian issue in ResourceEditor

2.0 Series
closed-fixed
General (291)
5
2008-11-07
2008-10-15
No

This didn't manifest itself as an error except that the created Setup.exe files were not identical when build on big- or little-endian systems.

The following (and attached) patch, together with the patch in #2166401 leads to perfectly byte-for-byte matching executables no matter if they are built on big- or little-endian systems.

--- ResourceEditor.cpp.orig 2008-10-15 10:49:09.000000000 +0200
+++ ResourceEditor.cpp 2008-10-15 10:49:12.000000000 +0200
@@ -478,7 +478,7 @@
// Set the new BaseOfData if needed
if (ntHeaders->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
DWORD* pdwBaseOfData = &((PIMAGE_OPTIONAL_HEADER32)&ntHeaders->OptionalHeader)->BaseOfData;
- if (*pdwBaseOfData > m_dwResourceSectionVA)
+ if (ConvertEndianness(*pdwBaseOfData) > m_dwResourceSectionVA)
*pdwBaseOfData = AdjustVA(*pdwBaseOfData, dwVAAdjustment);
}

Discussion

  • Bernd Heller

    Bernd Heller - 2008-10-15
     
  • Amir Szekely

    Amir Szekely - 2008-11-07
    • assigned_to: nobody --> kichik
    • status: open --> closed-fixed
     
  • Amir Szekely

    Amir Szekely - 2008-11-07

    Thanks, fixed.

     

Log in to post a comment.