Ejemplo n.º 1
0
        private bool AttachWithTries(Process process, int times)
        {
            bool result;

            try
            {
                LaunchInjector(process);

                Thread.Sleep(500);

                result = Insider.IsAlive();
            }
            catch (Exception)
            {
                result = false;
            }

            if (result)
            {
                return(true);
            }

            if (times > 0)
            {
                Thread.Sleep(1000);

                return(AttachWithTries(process, times - 1));
            }

            return(false);
        }