Exemplo n.º 1
0
 public Main(
     RemoteHooking.IContext context,
     string channelName
     , HookParameter parameter
     )
 {
 }
Exemplo n.º 2
0
        public void Run(
            RemoteHooking.IContext context,
            string channelName
            , HookParameter parameter
            )
        {
            frameCount    = 0;
            server        = RemoteHooking.IpcConnectClient <HookServer>(channelName);
            server.isHook = false;
            try
            {
                var process = Process.GetCurrentProcess();
                var modules = process.Modules;
                foreach (ProcessModule item in modules)
                {
                    string moduleName = item.ModuleName;
                    try
                    {
                        if (LocalHook.GetProcAddress(moduleName, "luaL_newstate") != IntPtr.Zero)
                        {
                            HookAllLuaFun(moduleName);
                            break;
                        }
                    }
                    catch
                    {
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return;
            }

            server.isHook = true;
            while (true)
            {
                Thread.Sleep(10);
                frameCount++;
                if (!server.isHook)
                {
                    Uninstall();
                    break;
                }
            }
        }