Exemple #1
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="result">Result</param>
        /// <param name="config">Configuration</param>
        public NeoDebugger(ReverseResult result, NeoConfig config) : base(result, config)
        {
            // Set config
            if (config == null)
            {
                config = new NeoConfig();
            }

            // Create script
            byte[] script;
            using (MemoryStream ms = new MemoryStream())
            {
                //uint offset = 0;
                foreach (Instruction i in Instructions)
                {
                    //i.Offset = offset;
                    /*offset +=*/
                    i.Write(ms);
                }
                script = ms.ToArray();
            }

            // Prepare engine

            Engine = config.CreateEngine();

            // Load script
            Engine.LoadScript(script, false);
            //Engine.LoadScript(verifiable.Scripts[i].InvocationScript, true); // VerifyScripts

            if (Config == null || Engine == null)
            {
                State |= DebuggerState.Error;
            }
        }
Exemple #2
0
        /// <summary>
        /// Free resources
        /// </summary>
        public override void Dispose()
        {
            base.Dispose();

            // Clean engine
            if (Engine != null)
            {
                Engine.Dispose();
                Engine = null;
            }
        }