示例#1
0
文件: Program.cs 项目: StrixG/MTAEir
        //--------

        static void TestStaticMethodHook()
        {
            object o = cHook.Hook(typeof(MessageBox), "Show", new Type[] { typeof(string), typeof(string), typeof(MessageBoxButtons) },
                                  typeof(Program), "Hooked_MessageBoxShow", new Type[] { typeof(string), typeof(string), typeof(MessageBoxButtons) });

            MessageBox.Show("Static Method Hook\r\rThis should be hooked", "HookTest", MessageBoxButtons.OK);
            cHook.Unhook(o);

            MessageBox.Show("Static Method Hook\r\rThis should NOT be hooked", "HookTest", MessageBoxButtons.OK);
        }