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

◆ GetSectionData() [1/2]

PEMemoryBlock System.Reflection.PortableExecutable.PEReader.GetSectionData ( int relativeVirtualAddress)
inline

Definition at line 263 of file PEReader.cs.

264 {
265 if (relativeVirtualAddress < 0)
266 {
267 Throw.ArgumentOutOfRange("relativeVirtualAddress");
268 }
269 int containingSectionIndex = PEHeaders.GetContainingSectionIndex(relativeVirtualAddress);
270 if (containingSectionIndex < 0)
271 {
272 return default(PEMemoryBlock);
273 }
274 AbstractMemoryBlock pESectionBlock = GetPESectionBlock(containingSectionIndex);
275 int num = relativeVirtualAddress - PEHeaders.SectionHeaders[containingSectionIndex].VirtualAddress;
276 if (num > pESectionBlock.Size)
277 {
278 return default(PEMemoryBlock);
279 }
280 return new PEMemoryBlock(pESectionBlock, num);
281 }
ImmutableArray< SectionHeader > SectionHeaders
Definition PEHeaders.cs:51
int GetContainingSectionIndex(int relativeVirtualAddress)
Definition PEHeaders.cs:195
AbstractMemoryBlock GetPESectionBlock(int index)
Definition PEReader.cs:229

References System.Reflection.Throw.ArgumentOutOfRange(), System.Reflection.PortableExecutable.PEHeaders.GetContainingSectionIndex(), System.Reflection.PortableExecutable.PEReader.GetPESectionBlock(), System.Reflection.PortableExecutable.PEHeaders.SectionHeaders, and System.Reflection.Internal.AbstractMemoryBlock.Size.

Referenced by System.Reflection.Metadata.PEReaderExtensions.GetMethodBody().