예제 #1
0
        public void Load(Grabber grabber)
        {
            Channels = new List<MemoryChannel>();
            for (int i = 0; i < grabber.Channels.Count;i++)
                Channels.Add(grabber.Channels[i]);
            Data = new Dictionary<int, List<byte[]>>();

            for(int i = 0 ;i < Channels.Count; i++)
            {
                Data.Add(Channels[i].ID, grabber.Waveform[i]);
            }

            // etc.
            Save("tmp");
            TriggerLoaded(0);
        }
예제 #2
0
        public Waveform(Grabber m)
        {
            _mGrabber = m;

            // Prepare.
            for (int ch = 0; ch < _mGrabber.Channels.Count; ch++)
            {
                RingBuffer.Add(new List<byte[]>());
                for (int i = 0; i < _mGrabber.Config.SamplesBeforeTrigger; i++)
                    RingBuffer[ch].Add(new byte[_mGrabber.Channels[ch].DataSize]);
            }
            for (int ch = 0; ch < _mGrabber.Channels.Count; ch++)
            {
                DataBuffer.Add(new List<byte[]>());
                for (int i = 0; i < _mGrabber.Config.Samples; i++)
                    DataBuffer[ch].Add(new byte[_mGrabber.Channels[ch].DataSize]);
            }

            SampleIndex = _mGrabber.Config.SamplesBeforeTrigger;
        }
예제 #3
0
        public Waveform(Grabber m)
        {
            _mGrabber = m;

            // Prepare.
            for (int ch = 0; ch < _mGrabber.Channels.Count; ch++)
            {
                RingBuffer.Add(new List <byte[]>());
                for (int i = 0; i < _mGrabber.Config.SamplesBeforeTrigger; i++)
                {
                    RingBuffer[ch].Add(new byte[_mGrabber.Channels[ch].DataSize]);
                }
            }
            for (int ch = 0; ch < _mGrabber.Channels.Count; ch++)
            {
                DataBuffer.Add(new List <byte[]>());
                for (int i = 0; i < _mGrabber.Config.Samples; i++)
                {
                    DataBuffer[ch].Add(new byte[_mGrabber.Channels[ch].DataSize]);
                }
            }

            SampleIndex = _mGrabber.Config.SamplesBeforeTrigger;
        }
예제 #4
0
        private void bt_load_table_Click(object sender, System.EventArgs e)
        {
            if (_mMemory != null)
            {
                _mMemory.CloseHandle();
            }
            string file = "Test.CT";

            _mMemoryList = new CheatEngineReader();
            _mMemoryList.Read(file);

            lbl_table.Text = "Table:" + file;

            // Update UI.
            _mTable.Items.Clear();

            // Search for the exe
            Process[] p = Process.GetProcessesByName(_mMemoryList.ProcessExe.Substring(0, _mMemoryList.ProcessExe.Length - 4));
            if (p.Length == 1)
            {
                _mProcess = p[0];
                _mMemory = new MemoryReader();
                _mMemory.ReadProcess = p[0];
                _mMemory.OpenProcess();

                lbl_exe.Text = "PID:" + p[0].Id + "\r\n[" + p[0].ProcessName + "]";
            }
            else if (p.Length == 0)
            {
                lbl_exe.Text = "Failed";
                MessageBox.Show("Please load only if the process is already running.");
                // TODO: Wait for process.
                return;
            }
            else
            {
                lbl_exe.Text = "Failed";
                MessageBox.Show("Found multiple exe's running! Cannot figure out what to-do.");
                //TODO: Add dialog.
                return;
            }

            IntPtr base_addr = p[0].MainModule.BaseAddress;

            for (int i = 0; i < _mMemoryList.Channels.Count; i++)
            {
                _mMemoryList.Channels[i].UI_ID = i;
                _mMemoryList.Channels[i].Address = new IntPtr(_mMemoryList.Channels[i].Address.ToInt32() + base_addr.ToInt32());
                MemoryChannel ch = _mMemoryList.Channels[i];
                _mTable.Items.Add(new ListViewItem(new string[5]
                                                       {
                                                           ch.ID.ToString(),
                                                           ch.Name,
                                                           "0x"+String.Format("{0,10:X}", ch.Address.ToInt32()),
                                                           ch.TypeToString(),
                                                           "0.000"
                                                       }));
            }

            _mGrabber = new Grabber(_mMemoryList, _mMemory);
            _mGrabber.Done += new Signal(_mGrabber_Done);
        }
예제 #5
0
 public Triggering(Grabber m)
 {
     IsTriggered = false;
     _mGrabber   = m;
 }
예제 #6
0
 public Triggering(Grabber m)
 {
     IsTriggered = false;
     _mGrabber = m;
 }
예제 #7
0
        public Channels(Grabber m, CheatEngineReader reader)
        {
            _mGrabber = m;

            DataChannels = new List <MemoryChannel>(reader.Channels);
        }