- 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 ->
- (bitmatch Bitstring.bitstring_of_string v with
- | { i : 32 : littleendian } -> sprintf "%08lx" i
- | { _ } -> markup_hex_data v)
- | Hivex.REG_DWORD_BIG_ENDIAN ->
- (bitmatch Bitstring.bitstring_of_string v with
- | { i : 32 : bigendian } -> sprintf "%08lx" i
- | { _ } -> 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 ->
- (bitmatch Bitstring.bitstring_of_string v with
- | { i : 64 : littleendian } -> sprintf "%016Lx" i
- | { _ } -> markup_hex_data v)
- | Hivex.REG_UNKNOWN i32 -> markup_hex_data v
- ) in