VirtualBox

Changeset 106732 in vbox for trunk/src/VBox/Runtime/common


Ignore:
Timestamp:
Oct 27, 2024 10:54:55 PM (6 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
165615
Message:

IPRT/ldrPE.cpp,pecoff.h: Added IMAGE_LOAD_CONFIG_DIRECTORY64_V14 / IMAGE_LOAD_CONFIG_DIRECTORY32_V13 for the windows 11 22h2 structure update (added GuardMemcpyFunctionPointer). jiraref:VBP-1253

File:
1 edited

Legend:

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

    r106726 r106732  
    41314131     * volatile everywhere! Trying to prevent the compiler being a smarta$$ and reorder stuff.
    41324132     */
    4133     IMAGE_LOAD_CONFIG_DIRECTORY32_V13 volatile *pLoadCfg32 = (IMAGE_LOAD_CONFIG_DIRECTORY32_V13 volatile *)pLoadCfg;
    4134     IMAGE_LOAD_CONFIG_DIRECTORY64_V13 volatile *pLoadCfg64 = pLoadCfg;
    4135 
     4133    IMAGE_LOAD_CONFIG_DIRECTORY32_V14 volatile *pLoadCfg32 = (IMAGE_LOAD_CONFIG_DIRECTORY32_V14 volatile *)pLoadCfg;
     4134    IMAGE_LOAD_CONFIG_DIRECTORY64_V14 volatile *pLoadCfg64 = pLoadCfg;
     4135
     4136    pLoadCfg64->GuardMemcpyFunctionPointer               = pLoadCfg32->GuardMemcpyFunctionPointer;
    41364137    pLoadCfg64->CastGuardOsDeterminedFailureMode         = pLoadCfg32->CastGuardOsDeterminedFailureMode;
    41374138    pLoadCfg64->GuardXFGTableDispatchFunctionPointer     = pLoadCfg32->GuardXFGTableDispatchFunctionPointer;
     
    47724773    if (Dir.Size)
    47734774    {
     4775        const size_t cbExpectV14 = !pModPe->f64Bit
     4776                                 ? sizeof(IMAGE_LOAD_CONFIG_DIRECTORY32_V14)
     4777                                 : sizeof(IMAGE_LOAD_CONFIG_DIRECTORY64_V14);
    47744778        const size_t cbExpectV13 = !pModPe->f64Bit
    47754779                                 ? sizeof(IMAGE_LOAD_CONFIG_DIRECTORY32_V13)
     
    48154819
    48164820        bool fNewerStructureHack = false;
    4817         if (   Dir.Size != cbExpectV13
     4821        if (   Dir.Size != cbExpectV14
     4822            && Dir.Size != cbExpectV13
    48184823            && Dir.Size != cbExpectV12
    48194824            && Dir.Size != cbExpectV11
     
    48314836            fNewerStructureHack = Dir.Size > cbNewHack /* These structure changes are slowly getting to us! More futher down. */
    48324837                               && Dir.Size <= sizeof(u);
    4833             Log(("rtldrPEOpen: %s: load cfg dir: unexpected dir size of %u bytes, expected %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, or %zu.%s\n",
    4834                  pszLogName, Dir.Size, cbExpectV13, cbExpectV12, cbExpectV11, cbExpectV10, cbExpectV9, cbExpectV8, cbExpectV7, cbExpectV6, cbExpectV5, cbExpectV4, cbExpectV3, cbExpectV2, cbExpectV1,
     4838            Log(("rtldrPEOpen: %s: load cfg dir: unexpected dir size of %u bytes, expected %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, or %zu.%s\n",
     4839                 pszLogName, Dir.Size, cbExpectV14, cbExpectV13, cbExpectV12, cbExpectV11, cbExpectV10, cbExpectV9, cbExpectV8, cbExpectV7, cbExpectV6, cbExpectV5, cbExpectV4, cbExpectV3, cbExpectV2, cbExpectV1,
    48354840                 fNewerStructureHack ? " Will try ignore extra bytes if all zero." : ""));
    48364841            if (!fNewerStructureHack)
    48374842                return RTErrInfoSetF(pErrInfo, VERR_LDRPE_LOAD_CONFIG_SIZE,
    4838                                      "Unexpected load config dir size of %u bytes; supported sized: %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, or %zu",
    4839                                      Dir.Size, cbExpectV13, cbExpectV12, cbExpectV11, cbExpectV10, cbExpectV9, cbExpectV8, cbExpectV7, cbExpectV6, cbExpectV5, cbExpectV4, cbExpectV3, cbExpectV2, cbExpectV1);
     4843                                     "Unexpected load config dir size of %u bytes; supported sized: %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, %zu, or %zu",
     4844                                     Dir.Size, cbExpectV14, cbExpectV13, cbExpectV12, cbExpectV11, cbExpectV10, cbExpectV9, cbExpectV8, cbExpectV7, cbExpectV6, cbExpectV5, cbExpectV4, cbExpectV3, cbExpectV2, cbExpectV1);
    48404845        }
    48414846
     
    48764881            /* Kludge #2: This happens a lot. Structure changes, but the linker doesn't get
    48774882               updated and stores some old size in the directory.  Use the header size. */
    4878             else if (   u.Cfg64.Size == cbExpectV13
     4883            else if (   u.Cfg64.Size == cbExpectV14
     4884                     || u.Cfg64.Size == cbExpectV13
    48794885                     || u.Cfg64.Size == cbExpectV12
    48804886                     || u.Cfg64.Size == cbExpectV11
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