Changeset 46118 in vbox
- Timestamp:
- May 16, 2013 9:51:42 AM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 85806
- Location:
- trunk/src/VBox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Debugger/DBGPlugInWinNt.cpp
r46108 r46118 427 427 /* Check that sizes are within the same range and that both sizes and 428 428 addresses are within reasonable limits. */ 429 if ( RT_ALIGN(paShs[i].Misc.VirtualSize, _64K) >RT_ALIGN(paShs[i].SizeOfRawData, _64K)429 if ( RT_ALIGN(paShs[i].Misc.VirtualSize, _64K) < RT_ALIGN(paShs[i].SizeOfRawData, _64K) 430 430 || paShs[i].Misc.VirtualSize >= _1G 431 431 || paShs[i].SizeOfRawData >= _1G) … … 969 969 && !(u.MzHdr.e_lfanew & 0x7) 970 970 && u.MzHdr.e_lfanew >= 0x080 971 && u.MzHdr.e_lfanew <= 0x 200)971 && u.MzHdr.e_lfanew <= 0x400) /* W8 is at 0x288*/ 972 972 { 973 973 IMAGE_NT_HEADERS32 const *pHdrs = (IMAGE_NT_HEADERS32 const *)&u.au8[u.MzHdr.e_lfanew]; -
trunk/src/VBox/Runtime/common/ldr/ldrPE.cpp
r46115 r46118 1705 1705 return VERR_LDRPE_CERT_MALFORMED; 1706 1706 } 1707 /* When using the in-memory reader with a debugger, we may get 1708 into trouble here since we might not have access to the whole 1709 physical file. So skip the tests below. Makes VBoxGuest.sys 1710 load and check out just fine, for instance. */ 1711 if (fFlags & RTLDR_O_FOR_DEBUG) 1712 continue; 1707 1713 break; 1708 1714 … … 1727 1733 return VERR_BAD_EXE_FORMAT; 1728 1734 } 1729 if ( pDir->VirtualAddress >= cb 1730 && ( !(fFlags & RTLDR_O_FOR_DEBUG) /* Happens with signed drivers like VBoxGuest.sys. :-) */ 1731 || i != IMAGE_DIRECTORY_ENTRY_SECURITY) ) 1735 if (pDir->VirtualAddress >= cb) 1732 1736 { 1733 1737 Log(("rtldrPEOpen: %s: dir no. %d VirtualAddress=%#x is invalid (limit %#x)!!!\n", … … 1939 1943 * @param pModPe The PE module instance. 1940 1944 * @param pOptHdr Pointer to the optional header (valid). 1945 * @param fFlags Loader flags, RTLDR_O_XXX. 1941 1946 */ 1942 int rtldrPEValidateDirectories(PRTLDRMODPE pModPe, const IMAGE_OPTIONAL_HEADER64 *pOptHdr)1947 static int rtldrPEValidateDirectories(PRTLDRMODPE pModPe, const IMAGE_OPTIONAL_HEADER64 *pOptHdr, uint32_t fFlags) 1943 1948 { 1944 1949 const char *pszLogName = pModPe->Core.pReader->pfnLogName(pModPe->Core.pReader); NOREF(pszLogName); … … 2008 2013 2009 2014 /* 2010 * If the image is signed, take a look at the signature. 2015 * If the image is signed and we're not doing this for debug purposes, 2016 * take a look at the signature. 2011 2017 */ 2012 2018 Dir = pOptHdr->DataDirectory[IMAGE_DIRECTORY_ENTRY_SECURITY]; 2013 if (Dir.Size )2019 if (Dir.Size && !(fFlags & RTLDR_O_FOR_DEBUG)) 2014 2020 { 2015 2021 PWIN_CERTIFICATE pFirst = (PWIN_CERTIFICATE)RTMemTmpAlloc(Dir.Size); … … 2163 2169 * inspection of the actual data. 2164 2170 */ 2165 rc = rtldrPEValidateDirectories(pModPe, &OptHdr );2171 rc = rtldrPEValidateDirectories(pModPe, &OptHdr, fFlags); 2166 2172 if (RT_SUCCESS(rc)) 2167 2173 {
Note:
See TracChangeset
for help on using the changeset viewer.