VirtualBox

Changeset 70313 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Dec 22, 2017 12:15:47 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
119910
Message:

IPRT/ldr: Made RTLdrEnumSymbols report forwards with value RTLDR_ENUM_SYMBOL_FWD_ADDRESS instead of skipping them.

File:
1 edited

Legend:

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

    r70312 r70313  
    12381238                 * Get address.
    12391239                 */
    1240                 uintptr_t   uRVAExport = paAddress[uOrdinal];
     1240                uint32_t  uRVAExport = paAddress[uOrdinal];
    12411241                RTUINTPTR Value;
    1242                 if (  uRVAExport - (uintptr_t)pThis->ExportDir.VirtualAddress
    1243                     < pThis->ExportDir.Size)
    1244                 {
    1245                     if (!(fFlags & RTLDR_ENUM_SYMBOL_FLAGS_NO_FWD))
    1246                     {
    1247                         /* Resolve forwarder. */
    1248                         AssertMsgFailed(("Forwarders are not supported!\n"));
    1249                     }
     1242                if (uRVAExport - pThis->ExportDir.VirtualAddress >= pThis->ExportDir.Size)
     1243                    Value = PE_RVA2TYPE(BaseAddress, uRVAExport, RTUINTPTR);
     1244                else if (!(fFlags & RTLDR_ENUM_SYMBOL_FLAGS_NO_FWD))
     1245                    Value = RTLDR_ENUM_SYMBOL_FWD_ADDRESS;
     1246                else
    12501247                    continue;
    1251                 }
    1252 
    1253                 /* Get plain export address */
    1254                 Value = PE_RVA2TYPE(BaseAddress, uRVAExport, RTUINTPTR);
    12551248
    12561249                /* Read in the name if found one. */
     
    13361329    uint32_t   *paRVANames = PE_RVA2TYPE(pvBits, pExpDir->AddressOfNames, uint32_t *);
    13371330    uint16_t   *paOrdinals = PE_RVA2TYPE(pvBits, pExpDir->AddressOfNameOrdinals, uint16_t *);
    1338     uint32_t    uNamePrev = 0;
    1339     unsigned    cOrdinals = RT_MAX(pExpDir->NumberOfNames, pExpDir->NumberOfFunctions);
     1331    uint32_t    uNamePrev  = 0;
     1332    unsigned    cOrdinals  = RT_MAX(pExpDir->NumberOfNames, pExpDir->NumberOfFunctions);
    13401333    for (unsigned uOrdinal = 0; uOrdinal < cOrdinals; uOrdinal++)
    13411334    {
     
    13761369             * Get address.
    13771370             */
    1378             uintptr_t   uRVAExport = paAddress[uOrdinal];
     1371            uint32_t  uRVAExport = paAddress[uOrdinal];
    13791372            RTUINTPTR Value;
    1380             if (  uRVAExport - (uintptr_t)pModPe->ExportDir.VirtualAddress
    1381                 < pModPe->ExportDir.Size)
    1382             {
    1383                 if (!(fFlags & RTLDR_ENUM_SYMBOL_FLAGS_NO_FWD))
    1384                 {
    1385                     /* Resolve forwarder. */
    1386                     AssertMsgFailed(("Forwarders are not supported!\n"));
    1387                 }
     1373            if (uRVAExport - pModPe->ExportDir.VirtualAddress >= pModPe->ExportDir.Size)
     1374                Value = PE_RVA2TYPE(BaseAddress, uRVAExport, RTUINTPTR);
     1375            else if (!(fFlags & RTLDR_ENUM_SYMBOL_FLAGS_NO_FWD))
     1376                Value = RTLDR_ENUM_SYMBOL_FWD_ADDRESS;
     1377            else
    13881378                continue;
    1389             }
    1390 
    1391             /* Get plain export address */
    1392             Value = PE_RVA2TYPE(BaseAddress, uRVAExport, RTUINTPTR);
    13931379
    13941380            /*
Note: See TracChangeset for help on using the changeset viewer.

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