//static Action<int> Test; static void Main2(string[] args) { /* Test = (a) => { }; */ var CpuContext = new CpuContext(); var ThreadContext = new ThreadContext(CpuContext); Console.SetWindowSize(160, 60); var Loader = new Win32PeLoader(); if (args.Length > 0) { Loader.Load(File.OpenRead(args[0]), ThreadContext); } else { //Loader.Load(File.OpenRead(@"..\..\..\Samples\test.exe"), ThreadContext); Loader.Load(@"c:\dev\tcc\test.exe", ThreadContext); } //Console.WriteLine("$$ {0}", ThreadContext); while (true) { var Method = CpuContext.GetMethod(ThreadContext.PC); Method(ThreadContext); } }
public void TestMethod1() { var CpuContext = new CpuContext(); var ThreadContext = new ThreadContext(CpuContext); var MethodGenerator = new MethodGenerator(); var Method = MethodGenerator.GenerateMethod(CpuContext, new MemoryStream(new byte[] { 0x50 })); Method(ThreadContext); }
//public Action<ThreadContext> NextFunction; //public Action<ThreadContext> TestMethod; public ThreadContext(CpuContext CpuContext) { this.CpuContext = CpuContext; /* this.TestMethod = (ThreadContext) => { Console.WriteLine("TestMethod!"); }; */ }