Skip to content

Commit

Permalink
v0.04
Browse files Browse the repository at this point in the history
  • Loading branch information
Takumi4685 committed Dec 23, 2019
1 parent 20a0ed5 commit 88d26d4
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 10 deletions.
7 changes: 7 additions & 0 deletions PointerSearcher.sln
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,20 @@ EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{47E47974-1D5F-40EB-87ED-4BF3AFA8D4BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{47E47974-1D5F-40EB-87ED-4BF3AFA8D4BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{47E47974-1D5F-40EB-87ED-4BF3AFA8D4BE}.Debug|x64.ActiveCfg = Debug|x64
{47E47974-1D5F-40EB-87ED-4BF3AFA8D4BE}.Debug|x64.Build.0 = Debug|x64
{47E47974-1D5F-40EB-87ED-4BF3AFA8D4BE}.Debug|x64.Build.2 = Release64bit|x64
{47E47974-1D5F-40EB-87ED-4BF3AFA8D4BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{47E47974-1D5F-40EB-87ED-4BF3AFA8D4BE}.Release|Any CPU.Build.0 = Release|Any CPU
{47E47974-1D5F-40EB-87ED-4BF3AFA8D4BE}.Release|x64.ActiveCfg = Release|x64
{47E47974-1D5F-40EB-87ED-4BF3AFA8D4BE}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
2 changes: 1 addition & 1 deletion PointerSearcher/Form1.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 PointerSearcher/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private async void buttonRead_Click(object sender, EventArgs e)
buttonRead.Enabled = false;


IDumpDataReader reader = CreateDumpDataReader(dataGridView1.Rows[0],false);
IDumpDataReader reader = CreateDumpDataReader(dataGridView1.Rows[0], false);
if (reader == null)
{
throw new Exception("Invalid input" + Environment.NewLine + "Check highlighted cell");
Expand All @@ -60,7 +60,7 @@ private async void buttonRead_Click(object sender, EventArgs e)

buttonSearch.Enabled = true;
}
catch (System.OperationCanceledException ex)
catch (System.OperationCanceledException)
{
SetProgressBar(0);
System.Media.SystemSounds.Asterisk.Play();
Expand Down Expand Up @@ -127,7 +127,7 @@ await Task.Run(() =>
buttonNarrowDown.Enabled = true;
}
}
catch (System.OperationCanceledException ex)
catch (System.OperationCanceledException)
{
SetProgressBar(0);
System.Media.SystemSounds.Asterisk.Play();
Expand Down Expand Up @@ -204,7 +204,7 @@ private async void buttonNarrowDown_Click(object sender, EventArgs e)
{
continue;
}
IDumpDataReader reader = CreateDumpDataReader(row,true);
IDumpDataReader reader = CreateDumpDataReader(row, true);
if (reader != null)
{
long target = Convert.ToInt64(row.Cells[5].Value.ToString(), 16);
Expand All @@ -231,7 +231,7 @@ private async void buttonNarrowDown_Click(object sender, EventArgs e)
SetProgressBar(100);
System.Media.SystemSounds.Asterisk.Play();
}
catch (System.OperationCanceledException ex)
catch (System.OperationCanceledException)
{
SetProgressBar(0);
System.Media.SystemSounds.Asterisk.Play();
Expand Down Expand Up @@ -277,7 +277,7 @@ private void ClearRowBackColor(DataGridViewRow row)
row.Cells[i].Style.BackColor = Color.White;
}
}
private IDumpDataReader CreateDumpDataReader(DataGridViewRow row,bool allowUnknownTarget)
private IDumpDataReader CreateDumpDataReader(DataGridViewRow row, bool allowUnknownTarget)
{
bool canCreate = true;
String path = "";
Expand Down Expand Up @@ -370,7 +370,7 @@ private IDumpDataReader CreateDumpDataReader(DataGridViewRow row,bool allowUnkno
row.Cells[4].Style.BackColor = Color.Red;
canCreate = false;
}
if(allowUnknownTarget && (target == 0))
if (allowUnknownTarget && (target == 0))
{
//if target address is set to 0,it means unknown address.
}
Expand Down
2 changes: 1 addition & 1 deletion PointerSearcher/NoexsDumpDataReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ private Int64 ReadLittleEndianInt64(long address)

private void ReadIndicate()
{
if(indices != null)
if (indices != null)
{
//if already read indices,skip reading
return;
Expand Down
66 changes: 66 additions & 0 deletions PointerSearcher/PointerSearcher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,72 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release64bit|AnyCPU'">
<OutputPath>bin\Release64bit\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release64bit|x64'">
<OutputPath>bin\x64\Release64bit\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release x64|AnyCPU'">
<OutputPath>bin\Release x64\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release x64|x64'">
<OutputPath>bin\x64\Release x64\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down
9 changes: 8 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ For example,If Offset Num=1,you will find`[[main+B000]+10]+100` in the case belo
And if Offset Num=2,you will find`[[main+A000]+20]+200` in addition
![num](https://user-images.githubusercontent.com/59052622/71303971-1b50bf80-2403-11ea-87f0-478df77e75c7.png)
calculating cost will be O(N<sup>N*D</sup>) (D:Max Depth,N:Offset Num)
1. If too many results,get another dump data and fill out 2nd and subsequent row,select `Narrow Down Result`
1. If too many results,get another dump data and fill out 2nd and subsequent row,select `Narrow Down Result`
If narrow down results with target address 0,tool only checks if pointer code can reaches heap region
If narrow down results with target address not 0,tool checks if pointer code can reaches target address

# link
* tutorial(Japanese)
Expand All @@ -37,6 +39,11 @@ https://zit866.hatenablog.com/entry/2019/12/17/012933
* ZiT866 : thanks to making tutorial.

# change log
*v0.04*
[improve]change offset expression at least 2 digits to avoid noexs exception
[improve]support narrow down results with target address 0 to only checks if pointer code can reaches heap region
[improve]narrowing down results become faster

*v0.03*
[bugfix]actual search depth was MaxDepth+1 by mistake
[improve]change UI to show progress
Expand Down

0 comments on commit 88d26d4

Please sign in to comment.