public MSILAssembler(MethodBody methodBody) { this.MethodBody = methodBody; _disassembler = new MSILDisassembler(methodBody); _image = methodBody.Method._netheader._assembly.Image; _offsetConverter = new OffsetConverter(Section.GetSectionByRva(methodBody.Method._netheader._assembly, methodBody.Method.RVA)); _bodyOffset = _offsetConverter.RvaToFileOffset(methodBody.Method.RVA) + methodBody.HeaderSize; _tokenResolver = methodBody.Method._netheader.TokenResolver; }
internal NETMethodReader(PeImage peImage, MethodBody methodbody) { tokenResolver = new MetaDataTokenResolver(peImage.ParentAssembly._netHeader); this.peImage = peImage; this.rva = methodbody.Method.RVA; this.methodbody = methodbody; peImage.SetOffset(Offset.FromRva(rva, peImage.ParentAssembly).FileOffset); rawoffset = (uint)peImage.Stream.Position; signature = peImage.Reader.ReadByte(); }
public MSILDisassembler(MethodBody body) { MethodBody = body; Section section = Section.GetSectionByRva(body.Method._netheader._assembly, body.Method.RVA); _ilOffset = new OffsetConverter(section).RvaToFileOffset(body.Method.RVA) + (uint)body.HeaderSize; _reader = section.ParentAssembly._peImage.Reader; TokenResolver = new MetaDataTokenResolver(body.Method._netheader); }
public MSILDisassembler(Stream stream, MetaDataTokenResolver tokenResolver) { TokenResolver = tokenResolver; _reader = new BinaryReader(stream); }
public MSILDisassembler(byte[] bytes, MetaDataTokenResolver tokenResolver) : this(new MemoryStream(bytes), tokenResolver) { }