VirtualBox

Ignore:
Timestamp:
Jul 14, 2022 2:44:12 AM (2 years ago)
Author:
vboxsync
Message:

IPRT/ldrPE: Tested and fixed the page hash generation code. bugref:8691

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/ldr/ldrPE.cpp

    r95635 r95638  
    24752475        for (uint32_t iPage = 0; iPage < cPagesInSection; iPage++)
    24762476        {
    2477             uint32_t const offPageInFile = offRawData + iPage * cbPage;
    2478             uint32_t const cbPageInFile  = RT_MIN(cbPage, offPageInFile - cbRawData);
     2477            uint32_t const offPageInSect = iPage * cbPage;
     2478            uint32_t const offPageInFile = offRawData + offPageInSect;
     2479            uint32_t const cbPageInFile  = RT_MIN(cbPage, cbRawData - offPageInSect);
    24792480            offLastPage = offPageInFile;
    24802481
     
    25782579     * Add the terminator entry.
    25792580     */
    2580     *(uint32_t *)pbDst = offLastPage;
     2581    *(uint32_t *)pbDst = offLastPage + cbPage;
    25812582    RT_BZERO(&pbDst[sizeof(uint32_t)], cbHash);
    25822583
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette