Example #1
0
        public void Initialize(ILTransformer tr)
        {
            this.trampoline = null;
            tr.RootScope.ProcessBasicBlocks <ILInstrList>(b =>
            {
                if (b.Content.Any(instr => instr.IR != null && instr.IR.Annotation == SMCBlock.AddressPart2))
                {
                    this.trampoline = (ILBlock)b;
                }
            });
            if (this.trampoline == null)
            {
                return;
            }

            CFG.ScopeBlock scope = tr.RootScope.SearchBlock(this.trampoline).Last();
            this.newTrampoline = new SMCBlock(this.trampoline.Id, this.trampoline.Content);
            scope.Content[scope.Content.IndexOf(this.trampoline)] = this.newTrampoline;

            this.adrKey            = tr.VM.Random.Next();
            this.newTrampoline.Key = (byte)tr.VM.Random.Next();
        }
Example #2
0
 public SMCBlockChunk(DarksVMRuntime rt, MethodDef method, SMCBlock block)
     : base(rt, method, block)
 {
     block.CounterOperand.Value = Length + 1;
 }