Exemplo n.º 1
0
        private void Execute(AThread Thread)
        {
            AutoResetEvent Wait = new AutoResetEvent(false);

            Thread.ThreadState.Break += (sender, e) => Thread.StopExecution();
            Thread.WorkFinished      += (sender, e) => Wait.Set();

            Wait.Reset();
            Thread.Execute();
            Wait.WaitOne();
        }
Exemplo n.º 2
0
        protected void ExecuteOpcodes()
        {
            using (ManualResetEvent Wait = new ManualResetEvent(false))
            {
                Thread.ThreadState.Break += (sender, e) => Thread.StopExecution();
                Thread.WorkFinished      += (sender, e) => Wait.Set();

                Thread.Execute();
                Wait.WaitOne();
            }
        }
Exemplo n.º 3
0
        protected void ExecuteOpcodes()
        {
            using (ManualResetEvent Wait = new ManualResetEvent(false))
            {
                Thread.ThreadState.Break += (sender, e) => Thread.StopExecution();
                Thread.WorkFinished      += (sender, e) => Wait.Set();

                Thread.Execute();
                Wait.WaitOne();
            }

            if (UnicornAvailable)
            {
                UnicornEmu.RunForCount((ulong)(Position - EntryPoint - 8) / 4);
            }
        }
Exemplo n.º 4
0
        public void StopAllThreads()
        {
            if (MainThread != null)
            {
                while (MainThread.IsAlive)
                {
                    MainThread.StopExecution();
                }
            }

            foreach (AThread Thread in TlsSlots.Values)
            {
                while (Thread.IsAlive)
                {
                    Thread.StopExecution();
                }
            }
        }