prettyHeader :: FilePath -> DexHeader -> PP.Doc
prettyHeader fp hdr =
  vsep [ "Opened" <+> PP.quotes (PP.text fp) <> ", DEX version " <> PP.quotes (pSDI (dexVersion hdr))
          , "DEX file header:"
          , prettyField "magic" (PP.quotes (pSDI (escapebs (BS.append (dexMagic hdr) (dexVersion hdr)))))
          , prettyField "checksum" (word32HexFixed (dexChecksum hdr))
          , prettyField "signature" sig
          , prettyField32 "file_size" (dexFileLen hdr)
          , prettyField32 "header_size" (dexHdrLen hdr)
          , prettyField32 "link_size" (dexLinkSize hdr)
          , prettyFieldHex "link_off" (dexLinkOff hdr)
          , prettyField32 "string_ids_size" (dexNumStrings hdr)
          , prettyFieldHex "string_ids_off" (dexOffStrings hdr)
          , prettyField32 "type_ids_size" (dexNumTypes hdr)
          , prettyFieldHex "type_ids_off" (dexOffTypes hdr)
          , prettyField32 "field_ids_size" (dexNumFields hdr)
          , prettyFieldHex "field_ids_off" (dexOffFields hdr)
          , prettyField32 "method_ids_size" (dexNumMethods hdr)
          , prettyFieldHex "method_ids_off" (dexOffMethods hdr)
          , prettyField32 "class_defs_size" (dexNumClassDefs hdr)
          , prettyFieldHex "class_defs_off" (dexOffClassDefs hdr)
          , prettyField32 "data_size" (dexDataSize hdr)
          , prettyFieldHex "data_off" (dexDataOff hdr)
          ]
  where
    sig = M.mconcat [ M.mconcat (take 2 sigStrings), "...", M.mconcat (drop 18 sigStrings) ]
    sigStrings = map word8HexFixed (dexSHA1 hdr)
prettyHeader :: FilePath -> DexHeader -> PP.Doc
prettyHeader fp hdr =
  vsep [ "Opened" <+> PP.quotes (PP.text fp) <> ", DEX version " <> PP.quotes (pSDI (dexVersion hdr))
          , "DEX file header:"
          , prettyField "magic" (PP.quotes (pSDI (escapebs (BS.append (dexMagic hdr) (dexVersion hdr)))))
          , prettyField "checksum" (word32HexFixed (dexChecksum hdr))
          , prettyField "signature" sig
          , prettyField32 "file_size" (dexFileLen hdr)
          , prettyField32 "header_size" (dexHdrLen hdr)
          , prettyField32 "link_size" (dexLinkSize hdr)
          , prettyFieldHex "link_off" (dexLinkOff hdr)
          , prettyField32 "string_ids_size" (dexNumStrings hdr)
          , prettyFieldHex "string_ids_off" (dexOffStrings hdr)
          , prettyField32 "type_ids_size" (dexNumTypes hdr)
          , prettyFieldHex "type_ids_off" (dexOffTypes hdr)
          , prettyField32 "field_ids_size" (dexNumFields hdr)
          , prettyFieldHex "field_ids_off" (dexOffFields hdr)
          , prettyField32 "method_ids_size" (dexNumMethods hdr)
          , prettyFieldHex "method_ids_off" (dexOffMethods hdr)
          , prettyField32 "class_defs_size" (dexNumClassDefs hdr)
          , prettyFieldHex "class_defs_off" (dexOffClassDefs hdr)
          , prettyField32 "data_size" (dexDataSize hdr)
          , prettyFieldHex "data_off" (dexDataOff hdr)
          ]
  where
    sig = M.mconcat [ M.mconcat (take 2 sigStrings), "...", M.mconcat (drop 18 sigStrings) ]
    sigStrings = map word8HexFixed (dexSHA1 hdr)
prettyHeader fp hdr =
  vsep [ "Opened" <+> PP.quotes (PP.text fp) <> ", DEX version " <> PP.quotes (pSDI (dexVersion hdr))
          , "DEX file header:"
          , prettyField "magic" (PP.quotes (pSDI (escapebs (BS.append (dexMagic hdr) (dexVersion hdr)))))
          , prettyField "checksum" (word32HexFixed (dexChecksum hdr))
          , prettyField "signature" sig
          , prettyField32 "file_size" (dexFileLen hdr)
          , prettyField32 "header_size" (dexHdrLen hdr)
          , prettyField32 "link_size" (dexLinkSize hdr)
          , prettyFieldHex "link_off" (dexLinkOff hdr)
          , prettyField32 "string_ids_size" (dexNumStrings hdr)
          , prettyFieldHex "string_ids_off" (dexOffStrings hdr)
          , prettyField32 "type_ids_size" (dexNumTypes hdr)
          , prettyFieldHex "type_ids_off" (dexOffTypes hdr)
          , prettyField32 "field_ids_size" (dexNumFields hdr)
          , prettyFieldHex "field_ids_off" (dexOffFields hdr)
          , prettyField32 "method_ids_size" (dexNumMethods hdr)
          , prettyFieldHex "method_ids_off" (dexOffMethods hdr)
          , prettyField32 "class_defs_size" (dexNumClassDefs hdr)
          , prettyFieldHex "class_defs_off" (dexOffClassDefs hdr)
          , prettyField32 "data_size" (dexDataSize hdr)
          , prettyFieldHex "data_off" (dexDataOff hdr)
          ]
  where
    sig = M.mconcat [ M.mconcat (take 2 sigStrings), "...", M.mconcat (drop 18 sigStrings) ]
    sigStrings = map word8HexFixed (dexSHA1 hdr)