public static long StartingPosition(MSDOS20Section msdos20Section)
 {
     return(msdos20Section.OffsetToPEHeader
            + (Int64)Marshal.SizeOf <PESignature>()
            + (Int64)Marshal.SizeOf <COFFHeader>()
            + (Int64)Marshal.SizeOf <COFFOptionalHeaderStandardFields>());
 }
 public static long StartingPosition(MSDOS20Section msdos20Section, COFFOptionalHeaderStandardFields coffOptionalHeaderStandardFields)
 {
     if (coffOptionalHeaderStandardFields.Magic == 0x10b)
     {
         return(msdos20Section.OffsetToPEHeader
                + (Int64)Marshal.SizeOf <PESignature>()
                + (Int64)Marshal.SizeOf <COFFHeader>()
                + (Int64)Marshal.SizeOf <COFFOptionalHeaderStandardFields>()
                + (Int64)Marshal.SizeOf <OptionalHeaderWindowsSpecificPE32>());
     }
     else
     {
         return(msdos20Section.OffsetToPEHeader
                + (Int64)Marshal.SizeOf <PESignature>()
                + (Int64)Marshal.SizeOf <COFFHeader>()
                + (Int64)Marshal.SizeOf <COFFOptionalHeaderStandardFields>()
                + (Int64)Marshal.SizeOf <OptionalHeaderWindowsSpecificPE32Plus>());
     }
 }
Esempio n. 3
0
 public static Int64 StartingPosition(MSDOS20Section msdosSection)
 {
     return(msdosSection.OffsetToPEHeader + (Int64)Marshal.SizeOf <PESignature>());
 }
 public static Int64 StartingPosition(MSDOS20Section msdos20Section)
 {
     return(msdos20Section.OffsetToPEHeader);
 }