public object CreateDecoder(MethodDef decoder, CEContext ctx) { var encoding = new x86Encoding(); encoding.Compile(ctx); MutationHelper.ReplacePlaceholder(decoder, arg => { var repl = new List<Instruction>(); repl.AddRange(arg); repl.Add(Instruction.Create(OpCodes.Call, encoding.native)); return repl.ToArray(); }); return encoding; }
public object CreateDecoder(MethodDef decoder, CEContext ctx) { var encoding = new x86Encoding(); encoding.Compile(ctx); MutationHelper.ReplacePlaceholder(decoder, arg => { var repl = new List <Instruction>(); repl.AddRange(arg); repl.Add(Instruction.Create(OpCodes.Call, encoding.native)); return(repl.ToArray()); }); return(encoding); }
public void Init(CilBody body) { if (inited) return; encoding = ctx.Context.Annotations.Get<x86Encoding>(ctx.Method.DeclaringType, Encoding, null); if (encoding == null) { encoding = new x86Encoding(); encoding.Compile(ctx); ctx.Context.Annotations.Set(ctx.Method.DeclaringType, Encoding, encoding); } inited = true; }
public void Init(CilBody body) { if (inited) { return; } encoding = ctx.Context.Annotations.Get <x86Encoding>(ctx.Method.DeclaringType, Encoding, null); if (encoding == null) { encoding = new x86Encoding(); encoding.Compile(ctx); ctx.Context.Annotations.Set(ctx.Method.DeclaringType, Encoding, encoding); } inited = true; }