can't reasign byte[] array :S
-
public ArrayList listcht = new ArrayList(); byte[] comparar = new byte[10]; //W3XVisionHack comparar[0] = 0x57; comparar[1] = 0x33; comparar[2] = 0x58; comparar[3] = 0x20; comparar[4] = 0x56; comparar[5] = 0x69; comparar[6] = 0x73; comparar[7] = 0x69; comparar[8] = 0x6f; comparar[9] = 0x6e; listcht.Add(comparar); //W3X1vs1Hack comparar[0] = 0x57; comparar[1] = 0x33; comparar[2] = 0x58; comparar[3] = 0x31; comparar[4] = 0x76; comparar[5] = 0x73; comparar[6] = 0x31; comparar[7] = 0x48; comparar[8] = 0x61; comparar[9] = 0x63; listcht.Add(comparar); //W3XCustomKick comparar[0] = 0x57; comparar[1] = 0x33; comparar[2] = 0x58; comparar[3] = 0x43; comparar[4] = 0x75; comparar[5] = 0x73; comparar[6] = 0x74; comparar[7] = 0x6f; comparar[8] = 0x6d; comparar[9] = 0x4b; listcht.Add(comparar); }
The problem here is the comparar[] array byte can't assign the new values why? they maintaine the old values. well, the sort soluction is redeclare the array -
public ArrayList listcht = new ArrayList(); byte[] comparar = new byte[10]; //W3XVisionHack comparar[0] = 0x57; comparar[1] = 0x33; comparar[2] = 0x58; comparar[3] = 0x20; comparar[4] = 0x56; comparar[5] = 0x69; comparar[6] = 0x73; comparar[7] = 0x69; comparar[8] = 0x6f; comparar[9] = 0x6e; listcht.Add(comparar); //W3X1vs1Hack comparar[0] = 0x57; comparar[1] = 0x33; comparar[2] = 0x58; comparar[3] = 0x31; comparar[4] = 0x76; comparar[5] = 0x73; comparar[6] = 0x31; comparar[7] = 0x48; comparar[8] = 0x61; comparar[9] = 0x63; listcht.Add(comparar); //W3XCustomKick comparar[0] = 0x57; comparar[1] = 0x33; comparar[2] = 0x58; comparar[3] = 0x43; comparar[4] = 0x75; comparar[5] = 0x73; comparar[6] = 0x74; comparar[7] = 0x6f; comparar[8] = 0x6d; comparar[9] = 0x4b; listcht.Add(comparar); }
The problem here is the comparar[] array byte can't assign the new values why? they maintaine the old values. well, the sort soluction is redeclare the arrayWhen you add the array to the list, it's not copied. The list is just a list of references, and you add the reference to the array, not a copy of the array. You add the same array three times to the list, so all the items in the list will be the same actual array. When you change the contents of the array, it will change the contents of all items in the list, as they are all the same object.
--- single minded; short sighted; long gone;