Ejemplo n.º 1
0
 public Main(RemoteHooking.IContext InContext, string LogChannelName)
 {
     Logger = RemoteHooking.IpcConnectClient<SystemLog>(LogChannelName);
     LogMessage("LUAHost Main");
 }
Ejemplo n.º 2
0
        private string InjectLUAHost()
        {
            string logChannelName = null;
            string res = "";

            try
            {
                if (IsInjected)
                {
                    return "WoW is already injected.";
                }

                IpcServerChannel ipcLogChannel = RemoteHooking.IpcCreateServer<SystemLog>(ref logChannelName,
                                                                                          WellKnownObjectMode.Singleton);
                remoteLog = RemoteHooking.IpcConnectClient<SystemLog>(logChannelName);
                remoteLog.OnServerEvent += EventShim.Create(prov_OnServerEvent);

                int outprocessid;
                RemoteHooking.CreateAndInject(WoWHelper.GetWowInstallationPath(),
                                              "",
                                              (int) WoWHelper.CreationFlags.NewConsole |
                                              (int) WoWHelper.CreationFlags.Suspended,
                                              "LUAHost.dll",
                                              "LUAHost.dll",
                                              out outprocessid,
                                              logChannelName);

                IPCObject = RemoteHooking.IpcConnectClient<IPCInterface>(remoteLog.InjectedDLLChannelName);
                res = "Injection has been completed";

                IsInjected = true;
            }
            catch (Exception e)
            {
                res = e.Message;
                IsInjected = false;
            }

            return res;
        }