/// <summary> /// Gets the 64 bit optional header by specifing a 64 bit assembly. /// </summary> /// <param name="assembly">The assembly to read the optional header</param> /// <returns></returns> public static OptionalHeader64 FromAssembly(LWin32 assembly) { OptionalHeader64 a = new OptionalHeader64(); a.assembly = assembly; a.header = assembly._headerReader; return(a); }
private void ReadOptionalHeader() { optionalheaderoffset = image.Stream.Position; optionalheadersig = image.Reader.ReadUInt16(); image.Stream.Seek(-2, SeekOrigin.Current); if (optionalheadersig == 0x10b) { optionalHeader32 = image.ReadStructure <Structures.IMAGE_OPTIONAL_HEADER32>(); optionalHeader = OptionalHeader32.FromAssembly(assembly); } else { optionalHeader64 = image.ReadStructure <Structures.IMAGE_OPTIONAL_HEADER64>(); optionalHeader = OptionalHeader64.FromAssembly(assembly); } }
/// <summary> /// Gets the 64 bit optional header by specifing a 64 bit assembly. /// </summary> /// <param name="assembly">The assembly to read the optional header</param> /// <returns></returns> public static OptionalHeader64 FromAssembly(LWin32 assembly) { OptionalHeader64 a = new OptionalHeader64(); a.assembly = assembly; a.header = assembly._headerReader; return a; }