public void RunScriptOnProgramImage(Program program, Script_v2 script) { if (script == null || !script.Enabled) { return; } IScriptInterpreter interpreter; try { //$TODO: should be in the config file, yeah. var type = Type.GetType("Reko.ImageLoaders.OdbgScript.OllyLang,Reko.ImageLoaders.OdbgScript"); interpreter = (IScriptInterpreter)Activator.CreateInstance(type); } catch (Exception ex) { eventListener.Error(new NullCodeLocation(""), ex, string.Format("Unable to load script interpreter {0}.")); return; } try { interpreter.LoadFromString(script.Script, null); interpreter.Run(); } catch (Exception ex) { eventListener.Error(new NullCodeLocation(""), ex, string.Format("An error occurred while running the script.")); } }
public void RunScriptOnProgramImage(Program program, Script_v2 script) { if (script == null || !script.Enabled) return; IScriptInterpreter interpreter; try { //$TODO: should be in the config file, yeah. var type = Type.GetType("Reko.ImageLoaders.OdbgScript.OllyLang,Reko.ImageLoaders.OdbgScript"); interpreter = (IScriptInterpreter) Activator.CreateInstance(type); } catch (Exception ex) { eventListener.Error(new NullCodeLocation(""), ex, string.Format("Unable to load script interpreter {0}.")); return; } try { interpreter.LoadFromString(script.Script, null); interpreter.Run(); } catch (Exception ex) { eventListener.Error(new NullCodeLocation(""), ex, string.Format("An error occurred while running the script.")); } }