Skip to content

Commit

Permalink
support three sets of target addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvita committed Aug 25, 2020
1 parent c4966af commit fc73079
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 15 deletions.
84 changes: 73 additions & 11 deletions PointerSearcher/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 19 additions & 3 deletions PointerSearcher/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public partial class Form1 : Form
public Form1()
{
InitializeComponent();

int targetselect = 0;
int maxDepth = 4;
int maxOffsetNum = 1;
long maxOffsetAddress = 0x800;
Expand All @@ -29,6 +29,7 @@ public Form1()
}
private PointerInfo info;
private int maxDepth;
private int targetselect = 0;
private int maxOffsetNum;
private long maxOffsetAddress;
private List<List<IReverseOrderPath>> result;
Expand Down Expand Up @@ -108,7 +109,7 @@ private async void buttonSearch_Click(object sender, EventArgs e)
maxOffsetNum = Convert.ToInt32(textBoxOffsetNum.Text);
maxOffsetAddress = Convert.ToInt32(textBoxOffsetAddress.Text, 16);
long heapStart = Convert.ToInt64(dataGridView1.Rows[0].Cells[3].Value.ToString(), 16);
long targetAddress = Convert.ToInt64(dataGridView1.Rows[0].Cells[5].Value.ToString(), 16);
long targetAddress = Convert.ToInt64(dataGridView1.Rows[0].Cells[5+targetselect].Value.ToString(), 16);
Address address = new Address(MemoryType.HEAP, targetAddress - heapStart);

if (maxOffsetNum <= 0)
Expand Down Expand Up @@ -297,7 +298,7 @@ private async void buttonNarrowDown_Click(object sender, EventArgs e)
dataGridView1.Rows[i].Cells[3].Value = "0x" + Convert.ToString(reader.heapStartAddress(), 16);
dataGridView1.Rows[i].Cells[4].Value = "0x" + Convert.ToString(reader.heapEndAddress(), 16);
// dataGridView1.Rows[i].Cells[5].Value = "0x" + Convert.ToString(reader.TargetAddress(), 16);
long target = Convert.ToInt64(row.Cells[5].Value.ToString(), 16);
long target = Convert.ToInt64(row.Cells[5+targetselect].Value.ToString(), 16);

dumps.Add(reader, target);
}
Expand Down Expand Up @@ -462,5 +463,20 @@ private void button1_Click(object sender, EventArgs e)
{
PrintPath();
}

private void radioButton1_CheckedChanged(object sender, EventArgs e)
{
targetselect = 0;
}

private void radioButton2_CheckedChanged(object sender, EventArgs e)
{
targetselect = 1;
}

private void radioButton3_CheckedChanged(object sender, EventArgs e)
{
targetselect = 2;
}
}
}
8 changes: 7 additions & 1 deletion PointerSearcher/Form1.resx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,13 @@
<metadata name="ColumnHeapEnd.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ColumnTargetAddress.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="ColumnTargetAddress1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ColumnTargetAddress2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ColumnTargetAddress3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

0 comments on commit fc73079

Please sign in to comment.