/// <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; } }
/// <summary> /// Free resources /// </summary> public override void Dispose() { base.Dispose(); // Clean engine if (Engine != null) { Engine.Dispose(); Engine = null; } }