rendered paste bodyprivate string getName(byte[] packet)
{
string string1;
byte[] byteArray1;
int i1;
int i2;
byte[] byteArray2;
byte[] byteArray3;
byte[] byteArray4;
Exception exception1;
string string2;
byte[] byteArray5;
try
{
byteArray5 = new byte[1];
byteArray1 = byteArray5;
i1 = 24;
i2 = 0;
byteArray2 = new byte[1];
byteArray3 = new byte[24];
byteArray2[0] = packet[i1];
while (!byteArray2[0].Equals(byteArray1[0]))
{
byteArray3[i2] = byteArray2[0];
i1++;
i2++;
byteArray2[0] = packet[i1];
}
byteArray4 = new byte[i2];
for (i1 = 0; (i1 < i2); i1++)
{
byteArray4[i1] = byteArray3[i1];
}
string1 = Encoding.ASCII.GetString(byteArray4);
string2 = string1;
}
catch (Exception exception2)
{
exception1 = exception2;
Console.WriteLine(exception1.ToString());
string2 = ((string)null);
}
return string2;
}