Skip to content

Commit

Permalink
Fixed address display.
Browse files Browse the repository at this point in the history
  • Loading branch information
KN4CK3R committed Nov 25, 2016
1 parent e6ecf63 commit fd23a62
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 40 deletions.
48 changes: 18 additions & 30 deletions Forms/ProcessMemoryViewForm.Designer.cs

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

14 changes: 7 additions & 7 deletions Forms/ProcessMemoryViewForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,22 @@ public ProcessMemoryViewer(RemoteProcess process, ClassNodeView classesView)
if (process.IsValid)
{
DataTable dt = new DataTable();
dt.Columns.Add("address", typeof(long));
dt.Columns.Add("size", typeof(long));
dt.Columns.Add("address", typeof(string));
dt.Columns.Add("address_val", typeof(IntPtr));
dt.Columns.Add("size", typeof(ulong));
dt.Columns.Add("name", typeof(string));
dt.Columns.Add("protection", typeof(string));
dt.Columns.Add("state", typeof(string));
dt.Columns.Add("type", typeof(string));
dt.Columns.Add("module", typeof(string));

process.NativeHelper.EnumerateRemoteSectionsAndModules(process.Process.Handle, delegate (IntPtr baseAddress, IntPtr regionSize, string name, NativeMethods.StateEnum state, NativeMethods.AllocationProtectEnum protection, NativeMethods.TypeEnum type, string modulePath)
{
var row = dt.NewRow();
row["address"] = baseAddress.ToInt64();
row["size"] = regionSize.ToInt64();
row["address"] = baseAddress.ToString("X");
row["address_val"] = baseAddress;
row["size"] = (ulong)regionSize.ToInt64();
row["name"] = name;
row["protection"] = protection.ToString();
row["state"] = state.ToString();
row["type"] = type.ToString();
row["module"] = Path.GetFileName(modulePath);
dt.Rows.Add(row);
Expand Down Expand Up @@ -122,7 +122,7 @@ private IntPtr GetSelectedRegionAddress()
var row = sectionsDataGridView.SelectedRows.Cast<DataGridViewRow>().FirstOrDefault()?.DataBoundItem as DataRowView;
if (row != null)
{
return (IntPtr)(long)row["address"];
return (IntPtr)row["address_val"];
}
return IntPtr.Zero;
}
Expand Down
3 changes: 0 additions & 3 deletions Forms/ProcessMemoryViewForm.resx
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,6 @@
<metadata name="protectionColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="stateColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="typeColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
Expand Down

0 comments on commit fd23a62

Please sign in to comment.