[Tutorial] How To Find/Locate Dynamic Offsets For/With RTM Tools (C# Code) "Method 1"

KranK

✮ ズ丂ム刀ズ ✮
RG Prime
May 27, 2015
346
388
73
29
Israel
www.csc-xsc.tk
There is lots of ways to do it , but ill just stick to the most simple one. so lets get started http://www.*************.com/forums/images/smilies/newset1/biggrin.gif
this tutorial return one offset as result !
What is this used for ? - used to create Find Offset Button / obviosly it can be used for much more http://www.*************.com/forums/images/smilies/newset1/wink.gif

[HIDE]1.past this into your main event public partial class of your tool
Code:
public uint ZeroOffset;
public int NumberOffsets = 0;
2.past this code some where in your tool before the button you going to use to find offset ! // this is the whole search event that will handle your search

Code:
public uint ContainsSequence(byte[] toSearch, byte[] toFind, uint StartOffset, int bytes)
{
for (int i = 0; (i + toFind.Length) < toSearch.Length; i += bytes)
{
bool flag = true;
for (int j = 0; j < toFind.Length; j++)
{
if (toSearch[i + j] != toFind[j])
{
flag = false;
break;
}
}
if (flag)
{
NumberOffsets++;
int num3 = ((int)StartOffset) + i;
return (uint)num3;
}
}
return 0;
}

private ulong Search(byte[] Search, uint Start, int Length, int bytes)
{
byte[] ReadBytes = PS3.Extension.ReadBytes(Start, Length);
uint num = this.ContainsSequence(ReadBytes, Search, Start, bytes);
if (num.Equals(this.ZeroOffset))
{
return 0;
//not found
}
else
{
int counter = 0;
foreach (int value in Search)
if (value == 1) ++counter;
uint num2 = num + ((uint)counter);
return num2;
}
}
Explanation of main search event params:

byte[] Search = bytes to search ( example: { 0x25, 0xFE, 0x27, 0xE0 }

Uint Start = the start of the location on the memory it means if randomly it jump from adress 32500000 and higher you put 0x32500000 as Uint Start


int Length = where to stop it means if start adress (Uint Start) 32500000 and its randomly appears between 32500000 and 32700000 you put 0x200000 as int Length cause 32700000 - 32500000 = 200000

int bytes = on what type of bytes to search "usualy we put 4 bytes"

3.Now create a button and put this code inside it

Code:
//Just random Bytes as an example, you will use yours "the bytes you want to search for"
byte[] bytes = { 0x25, 0xFE, 0x27, 0xE0 };

//search function call             //Uint Start    //int Length
ulong Found = Search(bytes, 0x32500000, 0x200000, 4);

if (Found == ZeroOffset)
{
this.YourTextlabel.Text = "NOT FOUND";
}
else
{
this.YourTextlabel.Text = "FOUND : " + string.Format("0x{0:X}", Found);
}
Also u can define how much byte to add to the found result by changing the code like this
Code:
//Just random Bytes as an example, you will use yours "the bytes you want to search for"
byte[] bytes = { 0x25, 0xFE, 0x27, 0xE0 }; /

//search function call             //Uint Start    //int Length      //add bytes
ulong Found = Search(bytes, 0x32500000, 0x200000, 4) + 0x20;

if (Found == ZeroOffset)
{
this.YourTextlabel.Text = "NOT FOUND";
}
else
{
this.YourTextlabel.Text = "FOUND : " + string.Format("0x{0:X}", Found);
}
[/HIDE]

Go to "Method 2"

I hope It helped you guys and have happy coddinghttp://www.*************.com/forums/images/smilies/newset1/wink.gif
 
Last edited:

Cain532

Happy Modding
RG Admin
Feb 23, 2015
1,302
684
123
USA
There is lots of ways to do it , but ill just stick to the most simple one. so lets get started http://www.*************.com/forums/images/smilies/newset1/biggrin.gif

What is this used for ? - used to create Find Offset Button / obviosly it can be used for much more http://www.*************.com/forums/images/smilies/newset1/wink.gif

1.past this into your main event public partial class of your tool
Code:
public uint ZeroOffset;
public int NumberOffsets = 0;
2.past this code some where in your tool before the button you going to use to find offset ! // this is the whole search event that will handle your search

Code:
public uint ContainsSequence(byte[] toSearch, byte[] toFind, uint StartOffset, int bytes)
{
for (int i = 0; (i + toFind.Length) < toSearch.Length; i += bytes)
{
bool flag = true;
for (int j = 0; j < toFind.Length; j++)
{
if (toSearch[i + j] != toFind[j])
{
flag = false;
break;
}
}
if (flag)
{
NumberOffsets++;
int num3 = ((int)StartOffset) + i;
return (uint)num3;
}
}
return 0;
}

private ulong Search(byte[] Search, uint Start, int Length, int bytes)
{
byte[] ReadBytes = PS3.Extension.ReadBytes(Start, Length);
uint num = this.ContainsSequence(ReadBytes, Search, Start, bytes);
if (num.Equals(this.ZeroOffset))
{
return 0;
//not found
}
else
{
int counter = 0;
foreach (int value in Search)
if (value == 1) ++counter;
uint num2 = num + ((uint)counter);
return num2;
}
}
Explanation of main search event params:

byte[] Search = bytes to search ( example: { 0x25, 0xFE, 0x27, 0xE0 }

Uint Start = the start of the location on the memory it means if randomly it jump from adress 32500000 and higher you put 0x32500000 as Uint Start


int Length = where to stop it means if start adress (Uint Start) 32500000 and its randomly appears between 32500000 and 32700000 you put 0x200000 as int Length cause 32700000 - 32500000 = 200000

int bytes = on what type of bytes to search "usualy we put 4 bytes"

3.Now create a button and put this code inside it

Code:
//Just random Bytes as an example, you will use yours "the bytes you want to search for"
byte[] bytes = { 0x25, 0xFE, 0x27, 0xE0 };

//search function call             //Uint Start    //int Length 
ulong Found = Search(bytes, 0x32500000, 0x200000, 4);

if (Found == ZeroOffset)
{
this.YourTextlabel.Text = "NOT FOUND";
}
else
{
this.YourTextlabel.Text = "FOUND : " + string.Format("0x{0:X}", Found);
}
Also u can define how much byte to add to the found result by changing the code like this
Code:
//Just random Bytes as an example, you will use yours "the bytes you want to search for"
byte[] bytes = { 0x25, 0xFE, 0x27, 0xE0 }; /

//search function call             //Uint Start    //int Length      //add bytes
ulong Found = Search(bytes, 0x32500000, 0x200000, 4) + 0x20;

if (Found == ZeroOffset)
{
this.YourTextlabel.Text = "NOT FOUND";
}
else
{
this.YourTextlabel.Text = "FOUND : " + string.Format("0x{0:X}", Found);
}
I hope It helped you guys and have happy coddinghttp://www.*************.com/forums/images/smilies/newset1/wink.gif

Big Props To My Bro KillerBoy_001
Any way to make this spit back multiple results?
 
  • Like
Reactions: KranK

KranK

✮ ズ丂ム刀ズ ✮
RG Prime
May 27, 2015
346
388
73
29
Israel
www.csc-xsc.tk
Lovely tuts, But how do you know byte combination you need to search for ??
About the bytes for example your life points , ammo or what ever it will be, also can be any static PPC around anything you search etc than you can move +/- bytes as it said on tutorial 1
 

ime11

Newbie
Nov 4, 2015
4
0
1
39
Please next time try not to use this type of Reply like "thanksss" its inappropriate

Thank you !
ok man , i'm sorry ' i know you work hard and you need reply make you happy and going on on the hard work you do for us ,
sorry for my bad english