Main question is how can i update the values in array?like im getting only 4 bytes instead of all cause its integer.
byte[] iarray = File.ReadAllBytes(path);
uint t;
for (int i = 61; i < 3440; i++)
{
i+=3;
t = BitConverter.ToUInt32(iarray,i);
if (t > 0)
{
t += 96;
}
iarray = BitConverter.GetBytes(t);
}
File.WriteAllBytes(path,iarray);
You are trying to rewrite the whole array instead of updating the only portion of data (4 bytes) inside the existing array. So, after you got the final value of the
t, you can do the following to place this new value back into the array instead of the old value (so, use the same value of 'i' for position)