1- Coller ceci dans le : "main event public partial class" de votre tool
Code:
public uint ZeroOffset;
public int NumberOffsets = 0;
2- Coller ce code quelque part dans votre tool avant le button button "Search Offset" ! //c'est le "Search Event" qui va gérer votre recherche
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;
}
}
Explication :
Uint Start = L'emplacement du début sur la mémoire, cela signifie un JUMP de manière aléatoire à partir de l'adresse de 32500000 vers une adresse supérieure.
int Length = Où S'arreter, cela signifie l'adresse de début est 32500000, et sa apparaît de façon aléatoire entre 32500000 et 32700000 , on utilise comme ceci 32500000 200000 + pour définir la longueur (Length)
int bytes = Sur quel type d'octets sa va rechercher
3- Créer un button et coller ce codage dedans :
Code:
byte[] bytes = { 0x25, 0xFE, 0x27, 0xE0 }; //Just random Bytes as an example you use yours
ulong Found = Search(bytes, 0x32500000, 0x200000, 4); //bytes, Uint start , int Length, what bytes type to search
if (Found == ZeroOffset)
{
this.YourTextlabel.Text = "NOT FOUND";
}
else
{
this.YourTextlabel.Text = "FOUND : " + string.Format("0x{0:X}", Found); // ("0x{0:X}", Found) defines the result and return it into text label // using that ulong Found = Search(bytes, 0x32500000, 0x200000, 4);
}
Aussi on peut définir combien de octet à ajouter au résultat constaté en changeant le code comme ceci
Code:
byte[] bytes = { 0x25, 0xFE, 0x27, 0xE0 }; //Just random Bytes as an example you use yours
ulong Found = Search(bytes, 0x32500000, 0x200000, 4) + 0x20; //bytes, Uint start , int Length, what bytes type to search ) + 0x20 will give you your result + 20 bytes froward same you do for minus insert (-)
if (Found == ZeroOffset)
{
this.YourTextlabel.Text = "NOT FOUND";
}
else
{
this.YourTextlabel.Text = "FOUND : " + string.Format("0x{0:X}", Found); // ("0x{0:X}", Found) defines the result and return it into text label // using that ulong Found = Search(bytes, 0x32500000, 0x200000, 4);
}
J'espère que cela pour vous aidé à votre codage