VirtualBox

Changeset 61936 in vbox


Ignore:
Timestamp:
Jun 29, 2016 4:08:10 PM (8 years ago)
Author:
vboxsync
Message:

nits

File:
1 edited

Legend:

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

    r60715 r61936  
    528528        PIMAGE_SECTION_HEADER pSH = pModPe->paSections;
    529529        for (unsigned cLeft = pModPe->cSections; cLeft > 0; cLeft--, pSH++)
    530             if (pSH->SizeOfRawData && pSH->Misc.VirtualSize)
    531             {
    532                 rc = pReader->pfnRead(pReader, (uint8_t *)pvBits + pSH->VirtualAddress, pSH->SizeOfRawData, pSH->PointerToRawData);
     530            if (   pSH->SizeOfRawData
     531                && pSH->Misc.VirtualSize
     532                && !(pSH->Characteristics & IMAGE_SCN_TYPE_NOLOAD))
     533            {
     534                uint32_t const cbToRead = RT_MIN(pSH->SizeOfRawData, pModPe->cbImage - pSH->VirtualAddress);
     535                Assert(pSH->VirtualAddress <= pModPe->cbImage);
     536
     537                rc = pReader->pfnRead(pReader, (uint8_t *)pvBits + pSH->VirtualAddress, cbToRead, pSH->PointerToRawData);
    533538                if (RT_FAILURE(rc))
    534539                {
     
    16531658        else
    16541659        {
    1655             SegInfo.LinkAddress = pSh->VirtualAddress + pModPe->uImageBase ;
     1660            SegInfo.LinkAddress = pSh->VirtualAddress + pModPe->uImageBase;
    16561661            SegInfo.RVA         = pSh->VirtualAddress;
    16571662            SegInfo.cbMapped    = RT_ALIGN(SegInfo.cb, SegInfo.Alignment);
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