Пример #1
0
        /// <summary>
        /// Starts executable and attaches spy to it.
        /// </summary>
        /// <param name="filePath">Path to executable.</param>
        public void Start(string filePath)
        {
            Spy            = ClientSpyStarter.Initialize(filePath, out _Client);
            Spy.OnPacket  += new Action <byte[], bool>(Spy_OnPacket);
            Spy.OnStopped += new Action <SpyStoppedArgs>(Spy_OnStopped);
            Spy.AttachAsync(_Client);

            Active    = true;
            CanStart  = false;
            CanAttach = false;
            CanPause  = true;
            CanStop   = true;
            Path      = filePath;
        }
Пример #2
0
        /// <summary>
        /// Attaches spy to process.
        /// </summary>
        /// <param name="process">Process to attach.</param>
        public void Attach(Process process)
        {
            Spy            = ClientSpyStarter.Initialize(process);
            Spy.OnPacket  += new Action <byte[], bool>(Spy_OnPacket);
            Spy.OnStopped += new Action <SpyStoppedArgs>(Spy_OnStopped);
            Spy.AttachAsync(process);

            Active    = true;
            CanStart  = false;
            CanAttach = false;
            CanPause  = true;
            CanStop   = true;
            Path      = process.MainModule.FileName;
        }