VirtualBox

忽略:
時間撮記:
2014-7-4 下午02:19:18 (10 年 以前)
作者:
vboxsync
訊息:

Another page has fix, this time for VBoxREM w/ debug info. (debug info isn't hashed by w2k8)

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Runtime/common/ldr/ldrPE.cpp

    r51868 r51870  
    21702170#endif
    21712171    uint8_t const  *pbHashTab  = pAttrib->u.pPageHashes->RawData.Asn1Core.uData.pu8;
    2172     for (uint32_t iPage = 0; iPage < cPages; iPage++)
     2172    for (uint32_t iPage = 0; iPage < cPages - 1; iPage++)
    21732173    {
    21742174        /* Decode the page offset. */
    21752175        uint32_t const offPageInFile = RT_MAKE_U32_FROM_U8(pbHashTab[0], pbHashTab[1], pbHashTab[2], pbHashTab[3]);
    2176         if (offPageInFile >= SpecialPlaces.cbToHash)
    2177         {
    2178             /* The last entry is zero. */
    2179             if (   offPageInFile == SpecialPlaces.cbToHash
    2180                 && iPage + 1 == cPages
    2181                 && ASMMemIsAll8(pbHashTab + 4, cbHash, 0) == NULL)
    2182                 return VINF_SUCCESS;
     2176        if (RT_UNLIKELY(offPageInFile >= SpecialPlaces.cbToHash))
    21832177            return RTErrInfoSetF(pErrInfo, VERR_LDRVI_PAGE_HASH_TAB_TOO_LONG,
    21842178                                 "Page hash entry #%u is beyond the signature table start: %#x, %#x",
    21852179                                 iPage, offPageInFile, SpecialPlaces.cbToHash);
    2186         }
    2187         if (offPageInFile < offPrev)
     2180        if (RT_UNLIKELY(offPageInFile < offPrev))
    21882181            return RTErrInfoSetF(pErrInfo, VERR_LDRVI_PAGE_HASH_TAB_NOT_STRICTLY_SORTED,
    21892182                                 "Page hash table is not strictly sorted: entry #%u @%#x, previous @%#x\n",
     
    23272320    }
    23282321
     2322    /*
     2323     * Check that the last table entry has a hash value of zero.
     2324     */
     2325    if (ASMMemIsAll8(pbHashTab + 4, cbHash, 0) != NULL)
     2326        return RTErrInfoSetF(pErrInfo, VERR_LDRVI_PAGE_HASH_TAB_TOO_LONG,
     2327                             "Maltform final page hash table entry: #%u %#010x %.*Rhxs",
     2328                             cPages - 1, RT_MAKE_U32_FROM_U8(pbHashTab[0], pbHashTab[1], pbHashTab[2], pbHashTab[3]),
     2329                             (size_t)cbHash, pbHashTab + 4);
    23292330    return VINF_SUCCESS;
    23302331}
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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