Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ SkipDosHeader()

void System.Reflection.PortableExecutable.PEHeaders.SkipDosHeader ( ref PEBinaryReader reader,
out bool isCOFFOnly )
inlineprivate

Definition at line 129 of file PEHeaders.cs.

130 {
131 ushort num = reader.ReadUInt16();
132 if (num != 23117)
133 {
134 if (num == 0 && reader.ReadUInt16() == ushort.MaxValue)
135 {
136 throw new BadImageFormatException(System.SR.UnknownFileFormat);
137 }
138 isCOFFOnly = true;
139 reader.Seek(0);
140 }
141 else
142 {
143 isCOFFOnly = false;
144 }
145 if (!isCOFFOnly)
146 {
147 reader.Seek(60);
148 int offset = reader.ReadInt32();
149 reader.Seek(offset);
150 uint num2 = reader.ReadUInt32();
151 if (num2 != 17744)
152 {
153 throw new BadImageFormatException(System.SR.InvalidPESignature);
154 }
155 }
156 }
static string InvalidPESignature
Definition SR.cs:32
static string UnknownFileFormat
Definition SR.cs:54
Definition SR.cs:7

References System.SR.InvalidPESignature, System.offset, and System.SR.UnknownFileFormat.

Referenced by System.Reflection.PortableExecutable.PEHeaders.PEHeaders().