public static string ByteDump(byte[] b)
{
string s = "";
string bs = "";
for (int i = 0; i < b.Length; i++)
{
bs = b[i].ToString("x");
if (b[i] < 16) bs = "" + 0 + bs;
s += "" + bs + " ";
if (i%4 == 0) s += " ";
if (i%16 == 0 && i != b.Length - 1) s += "\n";
}
return s;
}