示例#1
0
 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;
 }
示例#2
0
 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;
 }
示例#3
0
 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();
 }
示例#4
0
 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();
 }
示例#5
0
        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);
        }
示例#6
0
        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);
        }
示例#7
0
 public MSILDisassembler(Stream stream, MetaDataTokenResolver tokenResolver)
 {
     TokenResolver = tokenResolver;
     _reader = new BinaryReader(stream);
 }
示例#8
0
 public MSILDisassembler(byte[] bytes, MetaDataTokenResolver tokenResolver)
     : this(new MemoryStream(bytes), tokenResolver)
 {
 }
示例#9
0
 public MSILDisassembler(Stream stream, MetaDataTokenResolver tokenResolver)
 {
     TokenResolver = tokenResolver;
     _reader       = new BinaryReader(stream);
 }
示例#10
0
 public MSILDisassembler(byte[] bytes, MetaDataTokenResolver tokenResolver)
     : this(new MemoryStream(bytes), tokenResolver)
 {
 }