示例#1
0
		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;
		}
示例#2
0
        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);
        }
示例#3
0
		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;
		}
示例#4
0
        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;
        }