Ejemplo n.º 1
0
        public object PullData()
        {
            try
            {
                if (!gameMemoryScanner.ProcessRunning)
                {
                    //hostDelegates.Exit();
                    processId = GetProcessId();
                    if (processId != null)
                    {
                        gameMemoryScanner.Initialize(processId.Value); // re-initialize and attempt to continue
                    }
                    else if (!gameMemoryScanner.ProcessRunning)
                    {
                        stopwatch.Restart();
                        return(null);
                    }
                }

                if (stopwatch.ElapsedMilliseconds >= 2000L)
                {
                    gameMemoryScanner.UpdatePointers();
                    stopwatch.Restart();
                }
                return(gameMemoryScanner.Refresh());
            }
            catch (Exception ex)
            {
                hostDelegates.OutputMessage("[{0}] {1} {2}", ex.GetType().Name, ex.Message, ex.StackTrace);
                return(null);
            }
        }
Ejemplo n.º 2
0
        public object PullData()
        {
            if (stopwatch == null || gameMemoryScanner == null)
            {
                return(null);
            }

            try
            {
                if (!GameRunning)
                {
                    return(null);
                }
                if (!gameMemoryScanner.ProcessRunning)
                {
                    //hostDelegates.Exit();
                    processId = GetProcessId();
                    if (processId != null)
                    {
                        gameMemoryScanner.Initialize(processId.Value); // re-initialize and attempt to continue
                    }
                    else if (!gameMemoryScanner.ProcessRunning)
                    {
                        stopwatch.Restart();
                        return(null);
                    }
                }

                if (stopwatch.ElapsedMilliseconds >= 2000L)
                {
                    gameMemoryScanner.UpdatePointers();
                    stopwatch.Restart();
                }
                return(gameMemoryScanner.Refresh());
            }
            catch (Exception ex)
            {
                // Log ostDelegates.OutputMessage("[{0}] {1} {2}", ex.GetType().Name, ex.Message, ex.StackTrace);
                return(null);

                exCount++;
                if (exCount > 10)
                {
                    exCount = 0;
                    Dispose();
                    Init();
                    logger.Verbose("Memory reader estarted because pointers were created while the game was not ready.");
                }
            }
        }