Beispiel #1
0
        /// <summary>
        /// Use to obfuscate control flow
        /// This method only schedules the operation and returns immediately. The operation itself will be performed at
        /// the appropriate time, after the <see cref="IContext.Run()"/> method is called.
        /// </summary>
        /// <param name="ctx">Netfuser context</param>
        /// <param name="options">Obfuscation options</param>
        /// <returns>Netfuser context</returns>
        public static IContext MangleControlFlow(this IContext ctx, CFMangleOptions options = null)
        {
            var c = (IContextImpl)ctx;

            c.Register <ICFMangler>(new CFManglerPlugin(c, options ?? new CFMangleOptions()));
            c.Register <ICFMangleMethod>(new Jump(c));
            c.Register <ICFMangleMethod>(new Switch(c));
            return(ctx);
        }
 internal CFManglerPlugin(IContextImpl context, CFMangleOptions options)
     : base(context)
 {
     Options = options;
     Rng     = context.Plugin <IRngPlugin>().Get(NetfuserFactory.CodeFlowManglerName);
 }