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

◆ GetMethodBody()

static MethodBodyBlock System.Reflection.Metadata.PEReaderExtensions.GetMethodBody ( this PEReader peReader,
int relativeVirtualAddress )
inlinestatic

Definition at line 9 of file PEReaderExtensions.cs.

10 {
11 if (peReader == null)
12 {
13 throw new ArgumentNullException("peReader");
14 }
15 PEMemoryBlock sectionData = peReader.GetSectionData(relativeVirtualAddress);
16 if (sectionData.Length == 0)
17 {
18 throw new BadImageFormatException(System.SR.Format(System.SR.InvalidMethodRva, relativeVirtualAddress));
19 }
20 return MethodBodyBlock.Create(sectionData.GetReader());
21 }
static string InvalidMethodRva
Definition SR.cs:100
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
Definition SR.cs:7

References System.Reflection.Metadata.MethodBodyBlock.Create(), System.SR.Format(), System.Reflection.PortableExecutable.PEMemoryBlock.GetReader(), System.Reflection.PortableExecutable.PEReader.GetSectionData(), System.SR.InvalidMethodRva, and System.Reflection.PortableExecutable.PEMemoryBlock.Length.