I am making a trainer for Modern Warfare 2. The problem I am having is the conversion of hex to string, I am fairly new to this but I do look around before I try anything. I have also looked around before posting this question. Here is my code:
private void button1_Click(object sender, EventArgs e)
{
int xbytesRead = 0;
byte[] myXuid = new byte[15];
ReadProcessMemory((int)processHandle, xuidADR, myXuid, myXuid.Length, ref xbytesRead);
string xuid = ByteArrayToString(myXuid);
textBox2.Text = xuid;
}
public static string ByteArrayToString(byte[] ba)
{
string hex = BitConverter.ToString(ba);
return hex.Replace("-", "");
}
The return value I am getting is: 330400000100100100000000000000
But I need it to return this: 110000100000433
Any suggestions?
I think this is a Little-Endian vs Big-Endian issue. Please try the following:
References: