Example #1
0
        internal static bool IsReadyToRunImage(PEReader peReader)
        {
            if (peReader.PEHeaders is null ||
                peReader.PEHeaders.PEHeader is null ||
                peReader.PEHeaders.CorHeader is null)
            {
                return(false);
            }

            if ((peReader.PEHeaders.CorHeader.Flags & CorFlags.ILLibrary) == 0)
            {
                PEExportTable exportTable = peReader.GetExportTable();
                return(exportTable.TryGetValue("RTR_HEADER", out _));
            }
            else
            {
                return(peReader.PEHeaders.CorHeader.ManagedNativeHeaderDirectory.Size != 0);
            }
        }
Example #2
0
 /// <summary>
 /// Parse export table directory for a given PE reader.
 /// </summary>
 /// <param name="reader">PE reader representing the executable image to parse</param>
 public static PEExportTable GetExportTable(this PEReader reader)
 {
     return(PEExportTable.Parse(reader));
 }