示例#1
0
        public void Run(RemoteHooking.IContext context, String channelName, HookParameter parameter)
        {
            var id        = NativeAPI.GetCurrentProcessId();
            var libHandle = NativeAPI.GetCurrentThreadId();

            try
            {
                MessageBoxWHook = LocalHook.Create(
                    LocalHook.GetProcAddress("user32.dll", "MessageBoxW"),
                    new DMessageBoxW(MessageBoxW_Hooked),
                    this);
                MessageBoxWHook.ThreadACL.SetExclusiveACL(new Int32[1]);

                MessageBoxAHook = LocalHook.Create(
                    LocalHook.GetProcAddress("user32.dll", "MessageBoxA"),
                    new DMessageBoxW(MessageBoxA_Hooked),
                    this);
                MessageBoxAHook.ThreadACL.SetExclusiveACL(new Int32[1]);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return;
            }

            try
            {
                while (true)
                {
                    Thread.Sleep(10);
                }
            }
            catch
            {
            }
        }
示例#2
0
 public Main(RemoteHooking.IContext context, String channelName, HookParameter parameter)
 {
     MessageBox.Show(parameter.Msg, "Hooked");
 }