コード例 #1
0
ファイル: ILReaderFactory.cs プロジェクト: dadhi/ILReader
        IILReader CreateInstructionReader(MethodBase method, IILReaderConfiguration configuration)
        {
            var context      = configuration.CreateOperandReaderContext(method);
            var binaryReader = configuration.CreateBinaryReader(context.GetIL());

            return(CreateInstructionReader(binaryReader, context));
        }
コード例 #2
0
ファイル: ILReaderFactory.cs プロジェクト: dadhi/ILReader
        IILReader CreateInstructionReader(System.IO.Stream dump, IILReaderConfiguration configuration)
        {
            var context      = configuration.CreateOperandReaderContext(dump);
            var binaryReader = configuration.CreateBinaryReader(context.GetIL());

            return(CreateInstructionReader(binaryReader, context));
        }
コード例 #3
0
        public void Test_ReadInstructions_RTDynamicMethod()
        {
            IILReaderConfiguration cfg = Configuration.Resolve(Sum.Method);

            Assert.IsTrue(cfg is RTDynamicMethodConfiguration);
            var reader = cfg.GetReader(Sum.Method);

            Assert.AreEqual(4, reader.Count());
        }
コード例 #4
0
ファイル: ILReaderFactory.cs プロジェクト: dadhi/ILReader
 public ILReaderFactory(MethodBase method, IILReaderConfiguration configuration)
 {
     reader = method.IsAbstract ?
              new LazyRef <IILReader>(() => InstructionReader.Empty) :
              new LazyRef <IILReader>(() => CreateInstructionReader(method, configuration));
 }
コード例 #5
0
ファイル: ILReaderFactory.cs プロジェクト: dadhi/ILReader
 public ILReaderFactory(System.IO.Stream dump, IILReaderConfiguration configuration)
 {
     reader = (dump == null || dump.Length < (sizeof(byte) + sizeof(int) * 2)) ?
              new LazyRef <IILReader>(() => InstructionReader.Empty) :
              new LazyRef <IILReader>(() => CreateInstructionReader(dump, configuration));
 }