- if len >= 256 then
- sprintf "<%d bytes not printed>" len
- else (
- (* Deal as best we can with printing the value. *)
- match t with
- | Hivex.REG_NONE -> if v = "" then "" else markup_hex_data v
- | Hivex.REG_SZ -> markup_windows_string v
- | Hivex.REG_EXPAND_SZ -> markup_windows_string v
- | Hivex.REG_BINARY -> markup_hex_data v
- | Hivex.REG_DWORD ->
- if len = 4 then
- sprintf "%08lx" (i32_of_string_le v)
- else
- markup_hex_data v
- | Hivex.REG_DWORD_BIG_ENDIAN ->
- if len = 4 then
- sprintf "%08lx" (i32_of_string_be v)
- else
- markup_hex_data v
- | Hivex.REG_LINK -> markup_hex_data v
- | Hivex.REG_MULTI_SZ -> (* XXX could do better with this *)
- markup_hex_data v
- | Hivex.REG_RESOURCE_LIST -> markup_hex_data v
- | Hivex.REG_FULL_RESOURCE_DESCRIPTOR -> markup_hex_data v
- | Hivex.REG_RESOURCE_REQUIREMENTS_LIST -> markup_hex_data v
- | Hivex.REG_QWORD ->
- if len = 8 then
- sprintf "%016Lx" (i64_of_string_le v)
- else
- markup_hex_data v
- | Hivex.REG_UNKNOWN i32 -> markup_hex_data v
- ) in
+ if len >= 512 then sprintf "<%d bytes not printed>" len
+ else markup_escape (printable_hivex_value ~split_long_lines:true t v) in