Exemple #1
0
        private static void CreateProcessAHooker_ProcessCreated(object sender, HookedEventArgs e)
        {
            Console.WriteLine("Process ID (PID): " + e.Entries["DwProcessId"]);
            Console.WriteLine("Process Handle : " + e.Entries["HProcess"]);
            Console.WriteLine("Process Thread : " + e.Entries["HThread"]);
            var threadHandle = (IntPtr)e.Entries["HThread"];

            Win32Utility.ResumeThread(threadHandle);
        }
Exemple #2
0
        public static void CreateProcessWHooker_ProcessCreated(object sender, HookedEventArgs e)
        {
            var processId = Convert.ToInt32(e.Entries["DwProcessId"]);

            Console.WriteLine($"Process ID (PID): {processId}");
            Console.WriteLine($"Process Handle: {e.Entries["HProcess"]}");
            Console.WriteLine("Process Thread : " + e.Entries["HThread"]);
            IntPtr threadHandle = (IntPtr)e.Entries["HThread"];
            var    dllToInject  = _dllWithHook;
            var    notifyClient = new NotifyClient();
            string channelName;
            var    formattableString =
                RemoteInjector.InjectDll(dllToInject, "", ref processId, out channelName, notifyClient);

            if (!string.IsNullOrEmpty(formattableString))
            {
                Console.WriteLine(formattableString);
            }
        }
        public virtual void NotifyMethodHooked(params Tuple <string, object>[] args)
        {
            var e = new HookedEventArgs(args);

            MethodHookedEvent?.Invoke(this, e);
        }
Exemple #4
0
 protected virtual void OnMethodHooked(HookedEventArgs e)
 {
     MethodHookedEvent?.Invoke(this, e);
 }