vbox的更動 51770 路徑 trunk/src/VBox/Runtime/include
- 時間撮記:
- 2014-7-1 下午06:14:02 (10 年 以前)
- 位置:
- trunk
- 檔案:
-
- 新增 1 筆資料
- 修改 4 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk
- 屬性 svn:mergeinfo 變動
/branches/bird/hardenedwindows (已新增) 已合併: 92692-94610
- 屬性 svn:mergeinfo 變動
-
trunk/src/VBox
- 屬性 svn:mergeinfo 變動
/branches/bird/hardenedwindows/src/VBox (已新增) 已合併: 92692-94610
- 屬性 svn:mergeinfo 變動
-
trunk/src/VBox/Runtime/include/internal/ldr.h
r49044 r51770 323 323 DECLCALLBACKMEMBER(int, pfnReadDbgInfo)(PRTLDRMODINTERNAL pMod, uint32_t iDbgInfo, RTFOFF off, size_t cb, void *pvBuf); 324 324 325 326 327 325 /** 328 326 * Generic method for querying image properties. … … 338 336 * @param cbBuf The size of the return buffer (valid as per 339 337 * property). 340 */ 341 DECLCALLBACKMEMBER(int, pfnQueryProp)(PRTLDRMODINTERNAL pMod, RTLDRPROP enmProp, void *pvBuf, size_t cbBuf); 338 * @param pcbRet The number of bytes actually returned. If 339 * VERR_BUFFER_OVERFLOW is returned, this is set to the 340 * required buffer size. 341 */ 342 DECLCALLBACKMEMBER(int, pfnQueryProp)(PRTLDRMODINTERNAL pMod, RTLDRPROP enmProp, void *pvBuf, size_t cbBuf, size_t *pcbRet); 343 344 /** 345 * Verify the image signature. 346 * 347 * This may permform additional integrity checks on the image structures that 348 * was not done when opening the image. 349 * 350 * @returns IPRT status code. 351 * @retval VERR_LDRVI_NOT_SIGNED if not signed. 352 * 353 * @param pMod Pointer to the loader module structure. 354 * @param pfnCallback Callback that does the signature and certificate 355 * verficiation. 356 * @param pvUser User argument for the callback. 357 * @param pErrInfo Pointer to an error info buffer. Optional. 358 */ 359 DECLCALLBACKMEMBER(int, pfnVerifySignature)(PRTLDRMODINTERNAL pMod, PFNRTLDRVALIDATESIGNEDDATA pfnCallback, void *pvUser, 360 PRTERRINFO pErrInfo); 361 362 /** 363 * Calculate the image hash according the image signing rules. 364 * 365 * @returns IPRT status code. 366 * @param hLdrMod The module handle. 367 * @param enmDigest Which kind of digest. 368 * @param pszDigest Where to store the image digest. 369 * @param cbDigest Size of the buffer @a pszDigest points at. 370 */ 371 DECLCALLBACKMEMBER(int, pfnHashImage)(PRTLDRMODINTERNAL pMod, RTDIGESTTYPE enmDigest, char *pszDigest, size_t cbDigest); 342 372 343 373 /** Dummy entry to make sure we've initialized it all. */ … … 346 376 typedef RTLDROPS *PRTLDROPS; 347 377 typedef const RTLDROPS *PCRTLDROPS; 348 349 350 /** Pointer to a loader reader instance. */351 typedef struct RTLDRREADER *PRTLDRREADER;352 353 /**354 * Loader image reader instance.355 * The reader will have extra data members following this structure.356 */357 typedef struct RTLDRREADER358 {359 /** The name of the image provider. */360 const char *pszName;361 362 /**363 * Reads bytes at a give place in the raw image.364 *365 * @returns iprt status code.366 * @param pReader Pointer to the reader instance.367 * @param pvBuf Where to store the bits.368 * @param cb Number of bytes to read.369 * @param off Where to start reading relative to the start of the raw image.370 */371 DECLCALLBACKMEMBER(int, pfnRead)(PRTLDRREADER pReader, void *pvBuf, size_t cb, RTFOFF off);372 373 /**374 * Tells end position of last read.375 *376 * @returns position relative to start of the raw image.377 * @param pReader Pointer to the reader instance.378 */379 DECLCALLBACKMEMBER(RTFOFF, pfnTell)(PRTLDRREADER pReader);380 381 /**382 * Gets the size of the raw image bits.383 *384 * @returns size of raw image bits in bytes.385 * @param pReader Pointer to the reader instance.386 */387 DECLCALLBACKMEMBER(RTFOFF, pfnSize)(PRTLDRREADER pReader);388 389 /**390 * Map the bits into memory.391 *392 * The mapping will be freed upon calling pfnDestroy() if not pfnUnmap()393 * is called before that. The mapping is read only.394 *395 * @returns iprt status code.396 * @param pReader Pointer to the reader instance.397 * @param ppvBits Where to store the address of the memory mapping on success.398 * The size of the mapping can be obtained by calling pfnSize().399 */400 DECLCALLBACKMEMBER(int, pfnMap)(PRTLDRREADER pReader, const void **ppvBits);401 402 /**403 * Unmap bits.404 *405 * @returns iprt status code.406 * @param pReader Pointer to the reader instance.407 * @param pvBits Memory pointer returned by pfnMap().408 */409 DECLCALLBACKMEMBER(int, pfnUnmap)(PRTLDRREADER pReader, const void *pvBits);410 411 /**412 * Gets the most appropriate log name.413 *414 * @returns Pointer to readonly log name.415 * @param pReader Pointer to the reader instance.416 */417 DECLCALLBACKMEMBER(const char *, pfnLogName)(PRTLDRREADER pReader);418 419 /**420 * Releases all resources associated with the reader instance.421 * The instance is invalid after this call returns.422 *423 * @returns iprt status code.424 * @param pReader Pointer to the reader instance.425 */426 DECLCALLBACKMEMBER(int, pfnDestroy)(PRTLDRREADER pReader);427 428 } RTLDRREADER;429 378 430 379 … … 466 415 } 467 416 468 int rtldrOpenWithReader(PRTLDRREADER pReader, uint32_t fFlags, RTLDRARCH enmArch, PRTLDRMOD phMod);469 470 417 471 418 /** … … 511 458 int rtldrNativeLoadSystem(const char *pszFilename, const char *pszExt, uint32_t fFlags, PRTLDRMOD phLdrMod); 512 459 513 int rtldrPEOpen(PRTLDRREADER pReader, uint32_t fFlags, RTLDRARCH enmArch, RTFOFF offNtHdrs, PRTLDRMOD phLdrMod );514 int rtldrELFOpen(PRTLDRREADER pReader, uint32_t fFlags, RTLDRARCH enmArch, PRTLDRMOD phLdrMod );515 int rtldrkLdrOpen(PRTLDRREADER pReader, uint32_t fFlags, RTLDRARCH enmArch, PRTLDRMOD phLdrMod );460 int rtldrPEOpen(PRTLDRREADER pReader, uint32_t fFlags, RTLDRARCH enmArch, RTFOFF offNtHdrs, PRTLDRMOD phLdrMod, PRTERRINFO pErrInfo); 461 int rtldrELFOpen(PRTLDRREADER pReader, uint32_t fFlags, RTLDRARCH enmArch, PRTLDRMOD phLdrMod, PRTERRINFO pErrInfo); 462 int rtldrkLdrOpen(PRTLDRREADER pReader, uint32_t fFlags, RTLDRARCH enmArch, PRTLDRMOD phLdrMod, PRTERRINFO pErrInfo); 516 463 /*int rtldrLXOpen(PRTLDRREADER pReader, uint32_t fFlags, RTLDRARCH enmArch, RTFOFF offLX, PRTLDRMOD phLdrMod); 517 464 int rtldrMachoOpen(PRTLDRREADER pReader, uint32_t fFlags, RTLDRARCH enmArch, RTFOFF offSomething, PRTLDRMOD phLdrMod);*/ -
trunk/src/VBox/Runtime/include/internal/ldrPE.h
r46278 r51770 73 73 #define IMAGE_SUBSYSTEM_POSIX_CUI 0x7 74 74 75 #define IMAGE_LIBRARY_PROCESS_INIT 0x0001 76 #define IMAGE_LIBRARY_PROCESS_TERM 0x0002 77 #define IMAGE_LIBRARY_THREAD_INIT 0x0004 78 #define IMAGE_LIBRARY_THREAD_TERM 0x0008 79 #define IMAGE_DLLCHARACTERISTICS_NO_ISOLATION 0x0200 80 #define IMAGE_DLLCHARACTERISTICS_NO_SEH 0x0400 81 #define IMAGE_DLLCHARACTERISTICS_NO_BIND 0x0800 82 #define IMAGE_DLLCHARACTERISTICS_WDM_DRIVER 0x2000 83 #define IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE 0x8000 75 #define IMAGE_LIBRARY_PROCESS_INIT 0x0001 76 #define IMAGE_LIBRARY_PROCESS_TERM 0x0002 77 #define IMAGE_LIBRARY_THREAD_INIT 0x0004 78 #define IMAGE_LIBRARY_THREAD_TERM 0x0008 79 #define IMAGE_DLLCHARACTERISTICS_RESERVED 0x0010 80 #define IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA 0x0020 81 #define IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE 0x0040 82 #define IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY 0x0080 83 #define IMAGE_DLLCHARACTERISTICS_NX_COMPAT 0x0100 84 #define IMAGE_DLLCHARACTERISTICS_NO_ISOLATION 0x0200 85 #define IMAGE_DLLCHARACTERISTICS_NO_SEH 0x0400 86 #define IMAGE_DLLCHARACTERISTICS_NO_BIND 0x0800 87 #define IMAGE_DLLCHARACTERISTICS_APPCONTAINER 0x1000 88 #define IMAGE_DLLCHARACTERISTICS_WDM_DRIVER 0x2000 89 #define IMAGE_DLLCHARACTERISTICS_GUARD_CF 0x4000 90 #define IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE 0x8000 84 91 85 92 #define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 0x10 … … 208 215 #define WIN_CERT_TYPE_EFI_GUID UINT16_C(0x0ef1) 209 216 217 /** The alignment of the certificate table. 218 * @remarks Found thru signtool experiments. */ 219 #define WIN_CERTIFICATE_ALIGNMENT 8 210 220 211 221 /* For .DBG files. */ … … 517 527 518 528 519 typedef struct _IMAGE_LOAD_CONFIG_DIRECTORY32 529 530 /* WARNING! NO MORE PRAGMA PACK 4 from here on. Assert size of all new types. */ 531 /* WARNING! NO MORE PRAGMA PACK 4 from here on. Assert size of all new types. */ 532 /* WARNING! NO MORE PRAGMA PACK 4 from here on. Assert size of all new types. */ 533 /* WARNING! NO MORE PRAGMA PACK 4 from here on. Assert size of all new types. */ 534 /* WARNING! NO MORE PRAGMA PACK 4 from here on. Assert size of all new types. */ 535 /* WARNING! NO MORE PRAGMA PACK 4 from here on. Assert size of all new types. */ 536 /* WARNING! NO MORE PRAGMA PACK 4 from here on. Assert size of all new types. */ 537 /* WARNING! NO MORE PRAGMA PACK 4 from here on. Assert size of all new types. */ 538 /* WARNING! NO MORE PRAGMA PACK 4 from here on. Assert size of all new types. */ 539 #pragma pack() 540 541 542 543 typedef struct _IMAGE_LOAD_CONFIG_DIRECTORY32_V1 544 { 545 uint32_t Size; 546 uint32_t TimeDateStamp; 547 uint16_t MajorVersion; 548 uint16_t MinorVersion; 549 uint32_t GlobalFlagsClear; 550 uint32_t GlobalFlagsSet; 551 uint32_t CriticalSectionDefaultTimeout; 552 uint32_t DeCommitFreeBlockThreshold; 553 uint32_t DeCommitTotalFreeThreshold; 554 uint32_t LockPrefixTable; 555 uint32_t MaximumAllocationSize; 556 uint32_t VirtualMemoryThreshold; 557 uint32_t ProcessHeapFlags; 558 uint32_t ProcessAffinityMask; 559 uint16_t CSDVersion; 560 uint16_t Reserved1; 561 uint32_t EditList; 562 uint32_t SecurityCookie; 563 } IMAGE_LOAD_CONFIG_DIRECTORY32_V1; 564 AssertCompileSize(IMAGE_LOAD_CONFIG_DIRECTORY32_V1, 0x40); 565 typedef IMAGE_LOAD_CONFIG_DIRECTORY32_V1 *PIMAGE_LOAD_CONFIG_DIRECTORY32_V1; 566 typedef IMAGE_LOAD_CONFIG_DIRECTORY32_V1 const *PCIMAGE_LOAD_CONFIG_DIRECTORY32_V1; 567 568 typedef struct _IMAGE_LOAD_CONFIG_DIRECTORY32_V2 520 569 { 521 570 uint32_t Size; … … 539 588 uint32_t SEHandlerTable; 540 589 uint32_t SEHandlerCount; 541 } IMAGE_LOAD_CONFIG_DIRECTORY32; 542 typedef IMAGE_LOAD_CONFIG_DIRECTORY32 *PIMAGE_LOAD_CONFIG_DIRECTORY32; 543 typedef IMAGE_LOAD_CONFIG_DIRECTORY32 const *PCIMAGE_LOAD_CONFIG_DIRECTORY32; 544 545 typedef struct _IMAGE_LOAD_CONFIG_DIRECTORY64 590 } IMAGE_LOAD_CONFIG_DIRECTORY32_V2; 591 AssertCompileSize(IMAGE_LOAD_CONFIG_DIRECTORY32_V2, 0x48); 592 typedef IMAGE_LOAD_CONFIG_DIRECTORY32_V2 *PIMAGE_LOAD_CONFIG_DIRECTORY32_V2; 593 typedef IMAGE_LOAD_CONFIG_DIRECTORY32_V2 const *PCIMAGE_LOAD_CONFIG_DIRECTORY32_V2; 594 595 typedef struct _IMAGE_LOAD_CONFIG_DIRECTORY32_V3 596 { 597 uint32_t Size; 598 uint32_t TimeDateStamp; 599 uint16_t MajorVersion; 600 uint16_t MinorVersion; 601 uint32_t GlobalFlagsClear; 602 uint32_t GlobalFlagsSet; 603 uint32_t CriticalSectionDefaultTimeout; 604 uint32_t DeCommitFreeBlockThreshold; 605 uint32_t DeCommitTotalFreeThreshold; 606 uint32_t LockPrefixTable; 607 uint32_t MaximumAllocationSize; 608 uint32_t VirtualMemoryThreshold; 609 uint32_t ProcessHeapFlags; 610 uint32_t ProcessAffinityMask; 611 uint16_t CSDVersion; 612 uint16_t Reserved1; 613 uint32_t EditList; 614 uint32_t SecurityCookie; 615 uint32_t SEHandlerTable; 616 uint32_t SEHandlerCount; 617 uint32_t GuardCFCCheckFunctionPointer; 618 uint32_t Reserved2; 619 uint32_t GuardCFFunctionTable; 620 uint32_t GuardCFFunctionCount; 621 uint32_t GuardFlags; 622 } IMAGE_LOAD_CONFIG_DIRECTORY32_V3; 623 AssertCompileSize(IMAGE_LOAD_CONFIG_DIRECTORY32_V3, 0x5c); 624 typedef IMAGE_LOAD_CONFIG_DIRECTORY32_V3 *PIMAGE_LOAD_CONFIG_DIRECTORY32_V3; 625 typedef IMAGE_LOAD_CONFIG_DIRECTORY32_V3 const *PCIMAGE_LOAD_CONFIG_DIRECTORY32_V3; 626 627 typedef IMAGE_LOAD_CONFIG_DIRECTORY32_V3 IMAGE_LOAD_CONFIG_DIRECTORY32; 628 typedef PIMAGE_LOAD_CONFIG_DIRECTORY32_V3 PIMAGE_LOAD_CONFIG_DIRECTORY32; 629 typedef PCIMAGE_LOAD_CONFIG_DIRECTORY32_V3 PCIMAGE_LOAD_CONFIG_DIRECTORY32; 630 631 /* No _IMAGE_LOAD_CONFIG_DIRECTORY64_V1 exists. */ 632 633 typedef struct _IMAGE_LOAD_CONFIG_DIRECTORY64_V2 546 634 { 547 635 uint32_t Size; … … 565 653 uint64_t SEHandlerTable; 566 654 uint64_t SEHandlerCount; 567 } IMAGE_LOAD_CONFIG_DIRECTORY64; 568 typedef IMAGE_LOAD_CONFIG_DIRECTORY64 *PIMAGE_LOAD_CONFIG_DIRECTORY64; 569 typedef IMAGE_LOAD_CONFIG_DIRECTORY64 const *PCIMAGE_LOAD_CONFIG_DIRECTORY64; 570 655 } IMAGE_LOAD_CONFIG_DIRECTORY64_V2; 656 AssertCompileSize(IMAGE_LOAD_CONFIG_DIRECTORY64_V2, 0x70); 657 typedef IMAGE_LOAD_CONFIG_DIRECTORY64_V2 *PIMAGE_LOAD_CONFIG_DIRECTORY64_V2; 658 typedef IMAGE_LOAD_CONFIG_DIRECTORY64_V2 const *PCIMAGE_LOAD_CONFIG_DIRECTORY64_V2; 659 660 #pragma pack(4) /* Why not 8 byte alignment, baka microsofties?!? */ 661 typedef struct _IMAGE_LOAD_CONFIG_DIRECTORY64_V3 662 { 663 uint32_t Size; 664 uint32_t TimeDateStamp; 665 uint16_t MajorVersion; 666 uint16_t MinorVersion; 667 uint32_t GlobalFlagsClear; 668 uint32_t GlobalFlagsSet; 669 uint32_t CriticalSectionDefaultTimeout; 670 uint64_t DeCommitFreeBlockThreshold; 671 uint64_t DeCommitTotalFreeThreshold; 672 uint64_t LockPrefixTable; 673 uint64_t MaximumAllocationSize; 674 uint64_t VirtualMemoryThreshold; 675 uint64_t ProcessAffinityMask; 676 uint32_t ProcessHeapFlags; 677 uint16_t CSDVersion; 678 uint16_t Reserved1; 679 uint64_t EditList; 680 uint64_t SecurityCookie; 681 uint64_t SEHandlerTable; 682 uint64_t SEHandlerCount; 683 uint64_t GuardCFCCheckFunctionPointer; 684 uint64_t Reserved2; 685 uint64_t GuardCFFunctionTable; 686 uint64_t GuardCFFunctionCount; 687 uint32_t GuardFlags; 688 } IMAGE_LOAD_CONFIG_DIRECTORY64_V3; 689 #pragma pack() 690 AssertCompileSize(IMAGE_LOAD_CONFIG_DIRECTORY64_V3, 0x94); 691 typedef IMAGE_LOAD_CONFIG_DIRECTORY64_V3 *PIMAGE_LOAD_CONFIG_DIRECTORY64_V3; 692 typedef IMAGE_LOAD_CONFIG_DIRECTORY64_V3 const *PCIMAGE_LOAD_CONFIG_DIRECTORY64_V3; 693 694 typedef IMAGE_LOAD_CONFIG_DIRECTORY64_V3 IMAGE_LOAD_CONFIG_DIRECTORY64; 695 typedef PIMAGE_LOAD_CONFIG_DIRECTORY64_V3 PIMAGE_LOAD_CONFIG_DIRECTORY64; 696 typedef PCIMAGE_LOAD_CONFIG_DIRECTORY64_V3 PCIMAGE_LOAD_CONFIG_DIRECTORY64; 571 697 572 698 typedef struct _IMAGE_DEBUG_DIRECTORY … … 581 707 uint32_t PointerToRawData; 582 708 } IMAGE_DEBUG_DIRECTORY; 709 AssertCompileSize(IMAGE_DEBUG_DIRECTORY, 28); 583 710 typedef IMAGE_DEBUG_DIRECTORY *PIMAGE_DEBUG_DIRECTORY; 584 711 typedef IMAGE_DEBUG_DIRECTORY const *PCIMAGE_DEBUG_DIRECTORY; … … 592 719 uint8_t Data[1]; 593 720 } IMAGE_DEBUG_MISC; 721 AssertCompileSize(IMAGE_DEBUG_MISC, 16); 594 722 typedef IMAGE_DEBUG_MISC *PIMAGE_DEBUG_MISC; 595 723 typedef IMAGE_DEBUG_MISC const *PCIMAGE_DEBUG_MISC; … … 603 731 uint8_t bCertificate[8]; 604 732 } WIN_CERTIFICATE; 733 AssertCompileSize(WIN_CERTIFICATE, 16); 605 734 typedef WIN_CERTIFICATE *PWIN_CERTIFICATE; 606 735 typedef WIN_CERTIFICATE const *PCWIN_CERTIFICATE; 607 608 609 610 611 /* WARNING! NO MORE PRAGMA PACK 4 from here on. Assert size of all new types. */612 /* WARNING! NO MORE PRAGMA PACK 4 from here on. Assert size of all new types. */613 /* WARNING! NO MORE PRAGMA PACK 4 from here on. Assert size of all new types. */614 /* WARNING! NO MORE PRAGMA PACK 4 from here on. Assert size of all new types. */615 /* WARNING! NO MORE PRAGMA PACK 4 from here on. Assert size of all new types. */616 /* WARNING! NO MORE PRAGMA PACK 4 from here on. Assert size of all new types. */617 /* WARNING! NO MORE PRAGMA PACK 4 from here on. Assert size of all new types. */618 /* WARNING! NO MORE PRAGMA PACK 4 from here on. Assert size of all new types. */619 /* WARNING! NO MORE PRAGMA PACK 4 from here on. Assert size of all new types. */620 #pragma pack()621 622 623 624 736 625 737
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器