From 424833a3541a6c8be2d2791f89beca09f08423b2 Mon Sep 17 00:00:00 2001 From: tomvita <68505331+tomvita@users.noreply.github.com> Date: Tue, 15 Sep 2020 19:36:20 +0800 Subject: [PATCH] direct transfer --- PointerSearcher/Form1.Designer.cs | 62 +++++++++++++++---------------- PointerSearcher/Form1.cs | 51 +++++++++++++++++++------ PointerSearcher/Form1.resx | 10 ++--- 3 files changed, 76 insertions(+), 47 deletions(-) diff --git a/PointerSearcher/Form1.Designer.cs b/PointerSearcher/Form1.Designer.cs index 08276a6..6818d13 100644 --- a/PointerSearcher/Form1.Designer.cs +++ b/PointerSearcher/Form1.Designer.cs @@ -28,7 +28,7 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); this.buttonRead = new System.Windows.Forms.Button(); this.textBox1 = new System.Windows.Forms.TextBox(); this.dataGridView1 = new System.Windows.Forms.DataGridView(); @@ -79,6 +79,9 @@ private void InitializeComponent() this.label8 = new System.Windows.Forms.Label(); this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabPage2 = new System.Windows.Forms.TabPage(); + this.label25 = new System.Windows.Forms.Label(); + this.timeusedBox = new System.Windows.Forms.TextBox(); + this.progressBar2 = new System.Windows.Forms.ProgressBar(); this.label24 = new System.Windows.Forms.Label(); this.RecSizeBox = new System.Windows.Forms.TextBox(); this.label23 = new System.Windows.Forms.Label(); @@ -121,9 +124,6 @@ private void InitializeComponent() this.radioButton5 = new System.Windows.Forms.RadioButton(); this.radioButton4 = new System.Windows.Forms.RadioButton(); this.tabPage1 = new System.Windows.Forms.TabPage(); - this.progressBar2 = new System.Windows.Forms.ProgressBar(); - this.timeusedBox = new System.Windows.Forms.TextBox(); - this.label25 = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); this.tabControl1.SuspendLayout(); this.tabPage2.SuspendLayout(); @@ -167,8 +167,8 @@ private void InitializeComponent() this.ColumnTargetAddress3}); this.dataGridView1.Location = new System.Drawing.Point(6, 6); this.dataGridView1.Name = "dataGridView1"; - dataGridViewCellStyle2.NullValue = null; - this.dataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle3.NullValue = null; + this.dataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle3; this.dataGridView1.RowTemplate.Height = 21; this.dataGridView1.Size = new System.Drawing.Size(1094, 163); this.dataGridView1.TabIndex = 2; @@ -638,6 +638,29 @@ private void InitializeComponent() this.tabPage2.Text = "Memory Search"; this.tabPage2.UseVisualStyleBackColor = true; // + // label25 + // + this.label25.AutoSize = true; + this.label25.Location = new System.Drawing.Point(644, 69); + this.label25.Name = "label25"; + this.label25.Size = new System.Drawing.Size(82, 13); + this.label25.TabIndex = 82; + this.label25.Text = "Time used in ms"; + // + // timeusedBox + // + this.timeusedBox.Location = new System.Drawing.Point(647, 85); + this.timeusedBox.Name = "timeusedBox"; + this.timeusedBox.Size = new System.Drawing.Size(89, 21); + this.timeusedBox.TabIndex = 81; + // + // progressBar2 + // + this.progressBar2.Location = new System.Drawing.Point(647, 119); + this.progressBar2.Name = "progressBar2"; + this.progressBar2.Size = new System.Drawing.Size(89, 11); + this.progressBar2.TabIndex = 80; + // // label24 // this.label24.AutoSize = true; @@ -1048,37 +1071,14 @@ private void InitializeComponent() this.tabPage1.Text = "Pointer Search"; this.tabPage1.UseVisualStyleBackColor = true; // - // progressBar2 - // - this.progressBar2.Location = new System.Drawing.Point(647, 119); - this.progressBar2.Name = "progressBar2"; - this.progressBar2.Size = new System.Drawing.Size(89, 11); - this.progressBar2.TabIndex = 80; - // - // timeusedBox - // - this.timeusedBox.Location = new System.Drawing.Point(647, 85); - this.timeusedBox.Name = "timeusedBox"; - this.timeusedBox.Size = new System.Drawing.Size(89, 21); - this.timeusedBox.TabIndex = 81; - // - // label25 - // - this.label25.AutoSize = true; - this.label25.Location = new System.Drawing.Point(644, 69); - this.label25.Name = "label25"; - this.label25.Size = new System.Drawing.Size(82, 13); - this.label25.TabIndex = 82; - this.label25.Text = "Time used in ms"; - // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1114, 472); + this.ClientSize = new System.Drawing.Size(1111, 467); this.Controls.Add(this.tabControl1); this.Name = "Form1"; - this.Text = "EdiZon SE PointerSearcher 0.4a"; + this.Text = "EdiZon SE PointerSearcher 0.5 beta 1"; this.Load += new System.EventHandler(this.Form1_Load); ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); this.tabControl1.ResumeLayout(false); diff --git a/PointerSearcher/Form1.cs b/PointerSearcher/Form1.cs index 2246e36..ab2df40 100644 --- a/PointerSearcher/Form1.cs +++ b/PointerSearcher/Form1.cs @@ -61,7 +61,6 @@ private async void buttonRead_Click(object sender, EventArgs e) reader.readsetup(); dataGridView1.Rows[0].Cells[1].Value = "0x" + Convert.ToString(reader.mainStartAddress(), 16); dataGridView1.Rows[0].Cells[2].Value = "0x" + Convert.ToString(reader.mainEndAddress(), 16); - dataGridView1.Rows[0].Cells[2].Value = "0x" + Convert.ToString(reader.mainEndAddress(), 16); dataGridView1.Rows[0].Cells[3].Value = "0x" + Convert.ToString(reader.heapStartAddress(), 16); dataGridView1.Rows[0].Cells[4].Value = "0x" + Convert.ToString(reader.heapEndAddress(), 16); // dataGridView1.Rows[0].Cells[5].Value = "0x" + Convert.ToString(reader.TargetAddress(), 16); @@ -682,12 +681,12 @@ private int receivedata(ref byte[] dataset) dataset = new byte[2048*32]; while (s.Available < size) ; int dc = s.Receive(datasetc); - size = LZ_Uncompress(datasetc,ref dataset, size); + size = LZ_Uncompress(datasetc, ref dataset, size); } //else dataset = null; return size; } - private long[][] pointer_candidate; + private long[,] pointer_candidate; private void button3_Click(object sender, EventArgs e) { RecSizeBox.BackColor = System.Drawing.Color.White; @@ -710,8 +709,14 @@ private void button3_Click(object sender, EventArgs e) MainEndBox.Text = "0x" + Convert.ToString(address2, 16); HeapStartBox.Text = "0x" + Convert.ToString(address3, 16); HeapEndBox.Text = "0x" + Convert.ToString(address4, 16); - - + dataGridView1.Rows[0].Cells[0].Value = "DirectTransfer.dmp1"; + dataGridView1.Rows[0].Cells[1].Value = "0x" + Convert.ToString(address1, 16); + dataGridView1.Rows[0].Cells[2].Value = "0x" + Convert.ToString(address2, 16); + dataGridView1.Rows[0].Cells[3].Value = "0x" + Convert.ToString(address3, 16); + dataGridView1.Rows[0].Cells[4].Value = "0x" + Convert.ToString(address4, 16); + + //pointer_candidate = new long[30000000, 2]; + info = new PointerInfo(); new Thread(() => { Stopwatch sw = Stopwatch.StartNew(); @@ -721,25 +726,48 @@ private void button3_Click(object sender, EventArgs e) do { c1 = receivedata(ref dataset); - totaldata += c1; this.RecSizeBox.Invoke((MethodInvoker)delegate { - RecSizeBox.Text = Convert.ToString(totaldata); - progressBar2.Value =(int)(100*(BitConverter.ToInt64(dataset,0)- address1) /(address2-address1)); + for (int i = 0; i < c1; i +=16) + { + //pointer_candidate[(totaldata+i)/16, 0] = BitConverter.ToInt64(dataset, i); + //pointer_candidate[(totaldata+i)/16, 1] = BitConverter.ToInt64(dataset, i + 8); + Address from = new Address(MemoryType.MAIN, BitConverter.ToInt64(dataset, i ) - address1); + Address to = new Address(MemoryType.HEAP, BitConverter.ToInt64(dataset, i + 8) - address3); + info.AddPointer(from, to); + } + RecSizeBox.Text = Convert.ToString(totaldata+c1); + progressBar2.Value = (int)(100 * (BitConverter.ToInt64(dataset, 0) - address1) / (address2 - address1)); + progressBar1.Value = progressBar2.Value; timeusedBox.Text = Convert.ToString(sw.ElapsedMilliseconds); }); + totaldata += c1; } while (c1 > 0); do { c1 = receivedata(ref dataset); - totaldata += c1; this.RecSizeBox.Invoke((MethodInvoker)delegate { - RecSizeBox.Text = Convert.ToString(totaldata); - progressBar2.Value = (int)(100*(BitConverter.ToInt64(dataset, 0)- address3) / (address4-address3)); + for (int i = 0; i < c1 ; i+=16) + { + //pointer_candidate[(totaldata+i)/16, 0] = BitConverter.ToInt64(dataset, i); + //pointer_candidate[(totaldata+i)/16, 1] = BitConverter.ToInt64(dataset, i + 8); + Address from = new Address(MemoryType.HEAP, BitConverter.ToInt64(dataset, i ) - address3); + Address to = new Address(MemoryType.HEAP, BitConverter.ToInt64(dataset, i + 8) - address3); + info.AddPointer(from, to); + } + RecSizeBox.Text = Convert.ToString(totaldata+c1); + progressBar2.Value = (int)(100 * (BitConverter.ToInt64(dataset, 0) - address3) / (address4 - address3)); + progressBar1.Value = progressBar2.Value; timeusedBox.Text = Convert.ToString(sw.ElapsedMilliseconds); }); + totaldata += c1; } while (c1 > 0); + info.MakeList(); + this.RecSizeBox.Invoke((MethodInvoker)delegate + { + buttonSearch.Enabled = true; + }); while (s.Available < 4) ; b = new byte[s.Available]; s.Receive(b); @@ -747,6 +775,7 @@ private void button3_Click(object sender, EventArgs e) { showerror(b); progressBar2.Value = 100; + progressBar1.Value = progressBar2.Value; RecSizeBox.BackColor = System.Drawing.Color.LightGreen; timeusedBox.Text = Convert.ToString(sw.ElapsedMilliseconds); }); diff --git a/PointerSearcher/Form1.resx b/PointerSearcher/Form1.resx index 271b8f3..f82426d 100644 --- a/PointerSearcher/Form1.resx +++ b/PointerSearcher/Form1.resx @@ -150,19 +150,19 @@ True - + True - + True - + True - + True - + True