public string ReadStringsHeap(uint offset, uint maxLen = 0x200) { if (offset == 0) { return(string.Empty); } ulong offs = stringsStartOffset + offset; var bytes = new List <byte>(); bool tooLongString = false; while (offs <= stringsEndOffset) { int b = doc.ReadByte(offs); if (b <= 0) { break; } if (bytes.Count >= maxLen) { tooLongString = true; break; } bytes.Add((byte)b); offs++; } var s = Encoding.UTF8.GetString(bytes.ToArray()); return(tooLongString ? s + "..." : s); }
public ByteHexField(HexDocument doc, string parentName, string name, ulong start, bool useDecimal = false) : base(doc, parentName, name, start, 1) { var val = (byte)doc.ReadByte(start); this.data = new ByteVM(val, a => UpdateValue()); if (useDecimal) { this.data.Value = val; } }
public ByteFlagsHexField(HexDocument doc, string parentName, string name, ulong start) : base(doc, parentName, name, start, 1) { this.data = new ByteVM((byte)doc.ReadByte(start), a => UpdateValue(), false); }
public ByteHexField(HexDocument doc, string parentName, string name, ulong start, bool useDecimal = false) : base(doc, parentName, name, start, 1) { this.data = new ByteVM((byte)doc.ReadByte(start), a => UpdateValue(), useDecimal); }