private void DisplayMemory(DebugMessage message) { cbSelect.Enabled = Enabled; int start = message.GetInt32(0); int lines = message.GetInt32(4) / 16; uint at = (uint)start; try { string[] newlines = new string[lines]; for (int line = 0; line < lines; line++) { string l = at.ToString("X").PadLeft(8, '0') + ':'; string d = string.Empty; for (int x = 0; x < 16; x++) { byte mem = message.ResponseData[at - start + 8]; if (x % 4 == 0) { l = l + ' '; } l = l + mem.ToString("X").PadLeft(2, '0'); char b = (char)mem; d = d + (char.IsLetterOrDigit(b) ? b : '.'); at++; } newlines[line] = l + ' ' + d; } lbMemory.Lines = newlines; Status = string.Empty; } catch (Exception e) { Status = "Error: " + e.ToString(); } }