VirtualBox

Changeset 64891 in vbox


Ignore:
Timestamp:
Dec 15, 2016 9:22:05 PM (8 years ago)
Author:
vboxsync
Message:

RTLdrQueryProp: Added RTLDRPROP_FILE_OFF_HEADER, implementing it for PE.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/ldr.h

    r62473 r64891  
    10141014    /** Import module by index (32-bit) stored in the buffer. */
    10151015    RTLDRPROP_IMPORT_MODULE,
     1016    /** The file offset of the main executable header.
     1017     * This is mainly for PE, NE and LX headers, but also Mach-O FAT. */
     1018    RTLDRPROP_FILE_OFF_HEADER,
    10161019
    10171020    /** End of valid properties.  */
  • trunk/src/VBox/Runtime/common/ldr/ldrEx.cpp

    r62477 r64891  
    636636            AssertReturn(cbBuf >= sizeof(uint32_t), VERR_INVALID_PARAMETER);
    637637            break;
     638        case RTLDRPROP_FILE_OFF_HEADER:
     639            *pcbRet = sizeof(uint64_t);
     640            AssertReturn(cbBuf == sizeof(uint32_t) || cbBuf == sizeof(uint64_t), VERR_INVALID_PARAMETER);
     641            break;
    638642
    639643        default:
  • trunk/src/VBox/Runtime/common/ldr/ldrPE.cpp

    r64204 r64891  
    19601960            break;
    19611961
    1962 
    19631962        case RTLDRPROP_IMPORT_MODULE:
    19641963            Assert(cbBuf >= sizeof(uint32_t));
    19651964            return rtLdrPE_QueryImportModule(pModPe, pvBits, *(uint32_t *)pvBuf, pvBuf, cbBuf, pcbRet);
     1965
     1966        case RTLDRPROP_FILE_OFF_HEADER:
     1967            Assert(cbBuf == sizeof(uint32_t) || cbBuf == sizeof(uint64_t));
     1968            if (cbBuf == sizeof(uint32_t))
     1969                *(uint32_t *)pvBuf = pModPe->offNtHdrs;
     1970            else
     1971                *(uint64_t *)pvBuf = pModPe->offNtHdrs;
     1972            return VINF_SUCCESS;
    19661973
    19671974        default:
Note: See TracChangeset for help on using the changeset viewer.

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