Beispiel #1
0
        private static void WatcherThread()
        {
            while (_watching)
            {
                // Check current process
                if (_gameProcess != null)
                {
                    try
                    {
                        if (_gameProcess.HasExited || !IsWindow(_gameProcess.MainWindowHandle))
                        {
                            Logger.Write("WoW process invalidated, clearing!");
                            ResetProcess();
                        }
                    }
                    catch
                    {
                        ResetProcess();
                    }
                }

                // Find game process
                if (_gameProcess == null)
                {
                    var     wowProcess    = GetWowProcesses();
                    Process activeProcess = null;
                    try
                    {
                        activeProcess =
                            wowProcess.FirstOrDefault(proc => proc.HasExited == false && proc.MainWindowHandle != IntPtr.Zero);
                        if (activeProcess != null)
                        {
                            Logger.Write("Found WoW process! Handle is {0}", activeProcess.Handle);
                        }
                    } catch { }


                    if (activeProcess != null)
                    {
                        if (Settings.Default.EnableAdvancedFeatures)
                        {
                            MemoryManager.Attach(activeProcess);
                        }


                        _gameProcess = activeProcess;
                    }
                }

                Thread.Sleep(1000);
            }
        }
Beispiel #2
0
 private int getUserGold()
 {
     MemoryManager x = new MemoryManager();
         x.Attach("League of Legends");
         var GoldLv1Adress = (IntPtr)(x.ReadInteger(LeagueAdressesOffsets.PlayerObject.BaseAdress) + LeagueAdressesOffsets.PlayerObject.Attributes.Offset);
         var GoldAdress = (IntPtr)(x.ReadInteger(GoldLv1Adress.ToInt32()) + LeagueAdressesOffsets.PlayerObject.Attributes.Gold.Offset);
         var gold = x.ReadInteger(GoldAdress.ToInt32());
         x.Disconnect();
         return gold;
 }
Beispiel #3
0
 private int getMoveSpeed()
 {
     MemoryManager x = new MemoryManager();
     x.Attach("League of Legends");
     var GoldLv1Adress = (IntPtr)(x.ReadInteger(LeagueAdressesOffsets.PlayerObject.BaseAdress) + LeagueAdressesOffsets.PlayerObject.Attributes.Offset);
     var GoldAdress = (IntPtr)(x.ReadInteger(GoldLv1Adress.ToInt32()) + LeagueAdressesOffsets.PlayerObject.Attributes.MoveSpeed.Offset);
     var gold = x.ReadFloat(GoldAdress.ToInt32());
     x.Disconnect();
     return Convert.ToInt32(Math.Round(gold));
 }
Beispiel #4
0
 private int getMaximumHealth()
 {
     MemoryManager x = new MemoryManager();
         x.Attach("League of Legends");
         var GoldLv1Adress = (IntPtr)(x.ReadInteger(LeagueAdressesOffsets.PlayerObject.BaseAdress) + LeagueAdressesOffsets.PlayerObject.Stats.Offset);
         var GoldAdress = (IntPtr)(x.ReadInteger(GoldLv1Adress.ToInt32()) + LeagueAdressesOffsets.PlayerObject.Stats.MaxHealth.Offset);
         var gold = x.ReadInteger(GoldAdress.ToInt32());
         x.Disconnect();
         return gold;
 }
Beispiel #5
0
 public string getName()
 {
     MemoryManager x = new MemoryManager();
     x.Attach("League of Legends");
     var name = x.ReadString(LeagueAdressesOffsets.PlayerObject.Name, 16);
     x.Disconnect();
     return name;
 }