public static MDbgEngine invoke_Method(this MethodInfo methodInfo, MDbgEngine engine, CorValue[] parameters) { // var methodInfo = debugger.module("mscorlib").type("System.Console").method("Write"); var module = engine.process().ResolveClass(methodInfo.DeclaringType.FullName).Module; var corFunction = module.GetFunctionFromToken(methodInfo.MetadataToken); return(engine.invoke_Method(corFunction, parameters)); }
public static MDbgEngine detach(this MDbgEngine engine) { if (engine.hasActiveProcess()) { engine.process().Detach().WaitOne(); } return(engine); }
public static CorGenericValue create_Object(this MDbgEngine engine, CorElementType elementType, object value) { var corEval = engine.corEval(); var corClass = engine.process().ResolveClass(value.typeFullName()); var corValue = corEval.CreateValue(elementType, corClass); var genericValue = corValue.CastToGenericValue(); return(genericValue.value(value)); }