VirtualBox

Ignore:
Timestamp:
May 25, 2020 12:49:55 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
138225
Message:

SUPDrv-win.cpp: Relax the ImageBase check when comparing NT loaded and IPRT loaded image bits. This broke on older windows versions after we updated the compiler to 14.2. Perhaps some linker version check there. Saw addresses like 0x000007fef3c20000 and 0x000007fddf250000 rather than the linker base address or actual kernel load address. Weird. bugref:8489

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp

    r84394 r84497  
    22972297         * On Windows 10 the ImageBase member of the optional header is sometimes
    22982298         * updated with the actual load address and sometimes not.
     2299         * On older windows versions (builds <= 9200?), a user mode address is
     2300         * sometimes found in the image base field after upgrading to VC++ 14.2.
    22992301         */
    23002302        uint32_t const  offNtHdrs = *(uint16_t *)pbImageBits == IMAGE_DOS_SIGNATURE
     
    23082310        uint32_t const  cbImageBase  = RT_SIZEOFMEMB(IMAGE_NT_HEADERS, OptionalHeader.ImageBase);
    23092311        if (   pNtHdrsNtLd->OptionalHeader.ImageBase != pNtHdrsIprt->OptionalHeader.ImageBase
    2310             && (   pNtHdrsNtLd->OptionalHeader.ImageBase == (uintptr_t)pImage->pvImage
    2311                 || pNtHdrsIprt->OptionalHeader.ImageBase == (uintptr_t)pImage->pvImage)
    23122312            && pNtHdrsIprt->Signature == IMAGE_NT_SIGNATURE
    23132313            && pNtHdrsIprt->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR_MAGIC
     
    23382338
    23392339            /* ImageBase: */
    2340             if (   pNtHdrsNtLd->OptionalHeader.ImageBase != pNtHdrsIprt->OptionalHeader.ImageBase
    2341                 && (   pNtHdrsNtLd->OptionalHeader.ImageBase == (uintptr_t)pImage->pvImage
    2342                     || pNtHdrsIprt->OptionalHeader.ImageBase == (uintptr_t)pImage->pvImage) )
     2340            if (pNtHdrsNtLd->OptionalHeader.ImageBase != pNtHdrsIprt->OptionalHeader.ImageBase)
    23432341                supdrvNtAddExclRegion(&ExcludeRegions, offImageBase, cbImageBase);
    23442342
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