Ejemplo n.º 1
0
 public RuntimeHelpers(RTConstants constants, DarksVMRuntime rt, ModuleDef rtModule)
 {
     this.rt           = rt;
     this.rtModule     = rtModule;
     this.constants    = constants;
     this.rtHelperType = new TypeDefUser("KoiVM.Runtime", "Helpers");
     this.AllocateHelpers();
 }
Ejemplo n.º 2
0
        public ILPostTransformer(MethodDef method, ScopeBlock rootScope, DarksVMRuntime runtime)
        {
            this.RootScope = rootScope;
            this.Method    = method;
            this.Runtime   = runtime;

            this.Annotations = new Dictionary <object, object>();
            this.pipeline    = this.InitPipeline();
        }
Ejemplo n.º 3
0
        public IRTransformer(ScopeBlock rootScope, IRContext ctx, DarksVMRuntime runtime)
        {
            RootScope = rootScope;
            Context   = ctx;
            Runtime   = runtime;

            Annotations = new Dictionary <object, object>();
            InitPipeline();
        }
Ejemplo n.º 4
0
        public ILASTTransformer(MethodDef method, ScopeBlock rootScope, DarksVMRuntime runtime)
        {
            RootScope = rootScope;
            Method    = method;
            Runtime   = runtime;

            Annotations = new Dictionary <object, object>();
            InitPipeline();
        }
Ejemplo n.º 5
0
        public virtual uint Resolve(DarksVMRuntime runtime)
        {
            uint relBase = this.Base.Offset;

            if (this.Base is ILInstruction)
            {
                relBase += runtime.serializer.ComputeLength((ILInstruction)this.Base);
            }
            return(this.Target.Offset - relBase);
        }
Ejemplo n.º 6
0
        public RuntimeMutator(ModuleDef module, DarksVMRuntime rt)
        {
            this.RTModule      = module;
            this.rt            = rt;
            this.methodPatcher = new MethodPatcher(module);

            this.constants = new RTConstants();
            this.helpers   = new RuntimeHelpers(this.constants, rt, module);
            this.constants.InjectConstants(module, rt.Descriptor, this.helpers);
            this.helpers.AddHelpers();
        }
Ejemplo n.º 7
0
 public IRTranslator(IRContext ctx, DarksVMRuntime runtime)
 {
     this.Context = ctx;
     this.Runtime = runtime;
 }
Ejemplo n.º 8
0
 public override uint Resolve(DarksVMRuntime runtime)
 {
     return(base.Resolve(runtime) ^ Key);
 }
Ejemplo n.º 9
0
 public override IKoiChunk CreateChunk(DarksVMRuntime rt, MethodDef method)
 {
     return(new SMCBlockChunk(rt, method, this));
 }
Ejemplo n.º 10
0
 public SMCBlockChunk(DarksVMRuntime rt, MethodDef method, SMCBlock block)
     : base(rt, method, block)
 {
     block.CounterOperand.Value = Length + 1;
 }
Ejemplo n.º 11
0
 public IRTranslator(IRContext ctx, DarksVMRuntime runtime)
 {
     Context = ctx;
     Runtime = runtime;
 }
Ejemplo n.º 12
0
 public void Initialize(ModuleDef runtimeLib)
 {
     Runtime     = new DarksVMRuntime(this, runtimeLib);
     runtimeName = runtimeLib.Assembly.Name;
     vr          = new MethodVirtualizer(Runtime);
 }
Ejemplo n.º 13
0
 public void Resolve(DarksVMRuntime runtime)
 {
     runtime.LookupMethod(Target, out methodEntry);
 }
Ejemplo n.º 14
0
 public virtual IKoiChunk CreateChunk(DarksVMRuntime rt, MethodDef method)
 {
     return(new BasicBlockChunk(rt, method, this));
 }
Ejemplo n.º 15
0
 public MethodVirtualizer(DarksVMRuntime runtime) => this.Runtime = runtime;
Ejemplo n.º 16
0
 public void Initialize(ILPostTransformer tr)
 {
     runtime    = tr.Runtime;
     methodInfo = tr.Runtime.Descriptor.Data.LookupInfo(tr.Method);
     ComputeBlockKeys(tr.RootScope);
 }
Ejemplo n.º 17
0
 public MethodVirtualizer(DarksVMRuntime runtime)
 {
     Runtime = runtime;
 }
Ejemplo n.º 18
0
 public ILTranslator(DarksVMRuntime runtime) => this.Runtime = runtime;
Ejemplo n.º 19
0
 public ILTranslator(DarksVMRuntime runtime)
 {
     Runtime = runtime;
 }