Logo Search packages:      
Sourcecode: virtualbox-ose version File versions  Download package

static int kLdrModPEDoOptionalHeaderValidation ( PKLDRMODPE  pModPE  )  [static]

Internal worker which validates the section headers.

Todo:
validate more

Definition at line 514 of file kLdrModPE.c.

References KLDRMODPE::Hdrs, and KLDR_ERR_PE_BAD_OPTIONAL_HEADER.

Referenced by kldrModPEDoCreate().

{
    const unsigned fIs32Bit = pModPE->Hdrs.FileHeader.SizeOfOptionalHeader == sizeof(IMAGE_OPTIONAL_HEADER32);

    /* the magic */
    if (    pModPE->Hdrs.OptionalHeader.Magic
        !=  (fIs32Bit ? IMAGE_NT_OPTIONAL_HDR32_MAGIC : IMAGE_NT_OPTIONAL_HDR64_MAGIC))
        return KLDR_ERR_PE_BAD_OPTIONAL_HEADER;

    /** @todo validate more */
    return 0;
}


Generated by  Doxygen 1.6.0   Back to index