Beispiel #1
0
        private void Watcher_ProcessStarted(object sender, ProcessEventArgs e)
        {
            //byte[] multipatch = new byte[] { 0xE3, 0xA8, 0x8E };
            //byte[] epc = new byte[] { 0x03, 0xC4, 0x8F };
            //byte[] ukbox = new byte[] { 0x7F, 0x76, 0x6A };
            //byte[] german = new byte[] { 0x54, 0xC3, 0x8F };
            //byte[] soul = new byte[] { 0x70, 0x7C, 0x6A };
            //byte[] jpn = new byte[] { 0x6F, 0xB6, 0xA3 };

            AbstractTomp2Exe exe = Tomp2ExeFactory.Get(e.Process.ReadBytes(_exeIDAddress, 3));

            if (exe != null)
            {
                if (!LoadScriptLevels(e.Process))
                {
                    return;
                }

                TrackingChanged?.Invoke(this, new TrackingEventArgs
                {
                    Exe    = (_trackingExe = exe),
                    Status = TrackingStatus.ExeStarted,
                    Levels = _scriptLevels
                });

                _trackingProcess = e.Process;
                _tracking        = true;
                new Thread(TrackLevels).Start();
            }
        }
Beispiel #2
0
        private void Watcher_ProcessStopped(object sender, ProcessEventArgs e)
        {
            if (_trackingExe != null)
            {
                TrackingChanged?.Invoke(this, new TrackingEventArgs
                {
                    Exe    = _trackingExe,
                    Status = TrackingStatus.ExeStopped
                });

                _trackingProcess = null;
                _tracking        = false;
                _trackingExe     = null;
            }
        }