コード例 #1
0
ファイル: Program.cs プロジェクト: emnh/inspector-vs
        public static void TestFormatContext(Process process)
        {
            var context = new Win32Imports.ContextX64();

            ContextManager.getRip((uint)process.Threads[0].Id, ref context, ContextManager.GetRipAction.ActionGetContext);
            var context2 = new Win32Imports.ContextX64();

            ContextManager.getRip((uint)process.Threads[0].Id, ref context2, ContextManager.GetRipAction.ActionGetContext);
            var instr = AssemblyUtil.ReadOneAndDisassemble(process, context2.Rip);
            var asm   = instr.ToString();

            Console.WriteLine($"0x{context2.Rip:X}: {asm} {AssemblyUtil.FormatContext(context)}");
            Console.WriteLine($"0x{context2.Rip:X}: {asm} {AssemblyUtil.FormatContext(context2)}");
            Console.WriteLine($"0x{context2.Rip:X}: {asm} {AssemblyUtil.FormatContextDiff(context2, context, instr)}");
        }