Skip to content

Commit

Permalink
_resolvepointers
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvita committed Dec 3, 2020
1 parent 9130bb1 commit 30fc6c9
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 51 deletions.
39 changes: 26 additions & 13 deletions PointerSearcher/Form1.Designer.cs

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

52 changes: 45 additions & 7 deletions PointerSearcher/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ private void getstatus_Click( object sender, EventArgs e )
c = s.Receive( b );
count = BitConverter.ToInt32( k, 0 );
statusBox.Text = Convert.ToString( b[0] ) + " . " + Convert.ToString( b[1] ) + " . " + Convert.ToString( b[2] ) + " . " + Convert.ToString( b[3] );
if ( b[3] >= 152 ) { statusBox.BackColor = System.Drawing.Color.LightGreen; }
if ( b[3] >= 153 ) { statusBox.BackColor = System.Drawing.Color.LightGreen; }
else
{
statusBox.BackColor = System.Drawing.Color.Red;
Expand Down Expand Up @@ -1054,6 +1054,20 @@ private bool noerror()
s.Receive( b );
return !showerror( b );
}
private bool resolvepointers( ref byte[] inbuf, ref byte[] outbuf )
{
if ( !command_available() )
{
return false;
}
int a = SendMessage( NoexsCommands.ResolvePointers );
a = SendData( inbuf );
int size = BitConverter.ToInt32( inbuf, 0 );
outbuf = new byte[size*22];
while ( s.Available < size*22 ) { }
s.Receive( outbuf );
return noerror();
}
private bool readmemblock(ref byte[] outbuf, long address, int size)
{
if ( !command_available() )
Expand All @@ -1069,14 +1083,14 @@ private bool readmemblock(ref byte[] outbuf, long address, int size)
a = SendData( BitConverter.GetBytes( size ) );
if ( noerror() )
{
while (size >0)
while ( size > 0 )
{
if ( noerror() )
{
while ( s.Available < 5 ) { }
s.Receive( k );
len = BitConverter.ToInt32( k, 1 );
if (k[0] == 0) // no compression
if ( k[0] == 0 ) // no compression
{
inbuf = new byte[len];
while ( s.Available < len ) { }
Expand Down Expand Up @@ -1105,11 +1119,12 @@ private bool readmemblock(ref byte[] outbuf, long address, int size)
pos += urlesize;
size -= urlesize;
}
}
}
} else return false;

}

}
else return false;
return noerror();
}
private int SendMessage( NoexsCommands cmd )
Expand Down Expand Up @@ -2088,5 +2103,28 @@ private void button11_Click_1( Object sender, EventArgs e )
readmemblock( ref outbuf, targetAddress, size );
int a = 1;
}

private void button12_Click( Object sender, EventArgs e )
{
byte[] inbuf= { }, outbuf= { };
UInt32 size = 1;
Int16 depth = 6;
UInt32 offset1=0x487FEB0, offset2=0xb8, offset3=8, offset4=0xA0, offset5=0x78, offset6=0xb4;
inbuf = inbuf.Concat(BitConverter.GetBytes( size )).ToArray();
inbuf = inbuf.Concat( BitConverter.GetBytes( depth ) ).ToArray();
inbuf = inbuf.Concat( BitConverter.GetBytes( offset1 ) ).ToArray();
inbuf = inbuf.Concat( BitConverter.GetBytes( offset2 ) ).ToArray();
inbuf = inbuf.Concat( BitConverter.GetBytes( offset3 ) ).ToArray();
inbuf = inbuf.Concat( BitConverter.GetBytes( offset4 ) ).ToArray();
inbuf = inbuf.Concat( BitConverter.GetBytes( offset5 ) ).ToArray();
inbuf = inbuf.Concat( BitConverter.GetBytes( offset6 ) ).ToArray();
resolvepointers( ref inbuf, ref outbuf );
int idx = BitConverter.ToInt32( outbuf, 0 ) + 1; // index to the list of candidates
depth = BitConverter.ToInt16( outbuf, 4 ); //last depth, match set depth means good otherwise at the depth the value is probably no good so can't continue
long address = BitConverter.ToInt64( outbuf, 6 ); // last address
long value = BitConverter.ToInt64( outbuf, 14 ); // value at last address if the read was successful otherwise the value of last successful read

int a = 1;
}
}
}
30 changes: 0 additions & 30 deletions PointerSearcher/Form1.resx
Original file line number Diff line number Diff line change
Expand Up @@ -153,18 +153,6 @@
<metadata name="Label.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="lblRow.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Address1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Label.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataSet1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="dataSet1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
Expand All @@ -177,30 +165,12 @@
<metadata name="LastValue.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Address.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Value.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="LastValue.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="From.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="To.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="From.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="To.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Search.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>116, 17</value>
</metadata>
<metadata name="Search.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>116, 17</value>
</metadata>
Expand Down
3 changes: 2 additions & 1 deletion PointerSearcher/NoexsCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public enum NoexsCommands
AttachDmnt = 0x1A,
GetBookmark = 0x1B,
PutBookmark = 0x1C,
DmntResume = 0x1D
DmntResume = 0x1D,
ResolvePointers = 0x1E
}
}

0 comments on commit 30fc6c9

Please sign in to comment.