@l1yp/file-viewer 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +134 -0
- package/dist/FileViewer.js +7 -0
- package/dist/FileViewer.vue.d.ts +37 -0
- package/dist/FileViewer.vue_vue_type_script_setup_true_lang.js +103 -0
- package/dist/_virtual/_plugin-vue_export-helper.js +8 -0
- package/dist/components/AppxViewer.js +7 -0
- package/dist/components/AppxViewer.vue.d.ts +18 -0
- package/dist/components/AppxViewer.vue_vue_type_script_setup_true_lang.js +174 -0
- package/dist/components/ArchiveBrowser.js +7 -0
- package/dist/components/ArchiveBrowser.vue.d.ts +18 -0
- package/dist/components/ArchiveBrowser.vue_vue_type_script_setup_true_lang.js +279 -0
- package/dist/components/AudioViewer.js +7 -0
- package/dist/components/AudioViewer.vue.d.ts +21 -0
- package/dist/components/AudioViewer.vue_vue_type_script_setup_true_lang.js +201 -0
- package/dist/components/BinObjBrowser.js +7 -0
- package/dist/components/BinObjBrowser.vue.d.ts +19 -0
- package/dist/components/BinObjBrowser.vue_vue_type_script_setup_true_lang.js +141 -0
- package/dist/components/CertViewer.js +7 -0
- package/dist/components/CertViewer.vue.d.ts +17 -0
- package/dist/components/CertViewer.vue_vue_type_script_setup_true_lang.js +251 -0
- package/dist/components/ClassViewer.js +7 -0
- package/dist/components/ClassViewer.vue.d.ts +15 -0
- package/dist/components/ClassViewer.vue_vue_type_script_setup_true_lang.js +164 -0
- package/dist/components/CodeBlock.js +7 -0
- package/dist/components/CodeBlock.vue.d.ts +17 -0
- package/dist/components/CodeBlock.vue_vue_type_script_setup_true_lang.js +79 -0
- package/dist/components/CodeView.js +7 -0
- package/dist/components/CodeView.vue.d.ts +21 -0
- package/dist/components/CodeView.vue_vue_type_script_setup_true_lang.js +180 -0
- package/dist/components/CsvViewer.js +7 -0
- package/dist/components/CsvViewer.vue.d.ts +26 -0
- package/dist/components/CsvViewer.vue_vue_type_script_setup_true_lang.js +187 -0
- package/dist/components/DicomViewer.js +7 -0
- package/dist/components/DicomViewer.vue.d.ts +30 -0
- package/dist/components/DicomViewer.vue_vue_type_script_setup_true_lang.js +362 -0
- package/dist/components/DocxViewer.js +7 -0
- package/dist/components/DocxViewer.vue.d.ts +19 -0
- package/dist/components/DocxViewer.vue_vue_type_script_setup_true_lang.js +59 -0
- package/dist/components/DrawioViewer.js +7 -0
- package/dist/components/DrawioViewer.vue.d.ts +16 -0
- package/dist/components/DrawioViewer.vue_vue_type_script_setup_true_lang.js +38 -0
- package/dist/components/DxfViewer.js +7 -0
- package/dist/components/DxfViewer.vue.d.ts +14 -0
- package/dist/components/DxfViewer.vue_vue_type_script_setup_true_lang.js +239 -0
- package/dist/components/EbookViewer.js +7 -0
- package/dist/components/EbookViewer.vue.d.ts +22 -0
- package/dist/components/EbookViewer.vue_vue_type_script_setup_true_lang.js +170 -0
- package/dist/components/EmlViewer.js +7 -0
- package/dist/components/EmlViewer.vue.d.ts +21 -0
- package/dist/components/EmlViewer.vue_vue_type_script_setup_true_lang.js +193 -0
- package/dist/components/EplViewer.js +7 -0
- package/dist/components/EplViewer.vue.d.ts +19 -0
- package/dist/components/EplViewer.vue_vue_type_script_setup_true_lang.js +201 -0
- package/dist/components/FileViewerBody.js +7 -0
- package/dist/components/FileViewerBody.vue.d.ts +47 -0
- package/dist/components/FileViewerBody.vue_vue_type_script_setup_true_lang.js +599 -0
- package/dist/components/FileViewerPanel.js +7 -0
- package/dist/components/FileViewerPanel.vue.d.ts +3 -0
- package/dist/components/FileViewerPanel.vue_vue_type_script_setup_true_lang.js +207 -0
- package/dist/components/FontViewer.js +7 -0
- package/dist/components/FontViewer.vue.d.ts +17 -0
- package/dist/components/FontViewer.vue_vue_type_script_setup_true_lang.js +120 -0
- package/dist/components/FrontmatterCard.js +7 -0
- package/dist/components/FrontmatterCard.vue.d.ts +11 -0
- package/dist/components/FrontmatterCard.vue_vue_type_script_setup_true_lang.js +30 -0
- package/dist/components/GeoViewer.js +7 -0
- package/dist/components/GeoViewer.vue.d.ts +17 -0
- package/dist/components/GeoViewer.vue_vue_type_script_setup_true_lang.js +255 -0
- package/dist/components/HarViewer.js +7 -0
- package/dist/components/HarViewer.vue.d.ts +20 -0
- package/dist/components/HarViewer.vue_vue_type_script_setup_true_lang.js +322 -0
- package/dist/components/HexViewer.js +7 -0
- package/dist/components/HexViewer.vue.d.ts +22 -0
- package/dist/components/HexViewer.vue_vue_type_script_setup_true_lang.js +121 -0
- package/dist/components/HprofViewer.js +7 -0
- package/dist/components/HprofViewer.vue.d.ts +27 -0
- package/dist/components/HprofViewer.vue_vue_type_script_setup_true_lang.js +561 -0
- package/dist/components/ImageLightbox.js +7 -0
- package/dist/components/ImageLightbox.vue.d.ts +3 -0
- package/dist/components/ImageLightbox.vue_vue_type_script_setup_true_lang.js +86 -0
- package/dist/components/InlineText.d.ts +29 -0
- package/dist/components/InlineText.js +21 -0
- package/dist/components/JksViewer.js +7 -0
- package/dist/components/JksViewer.vue.d.ts +22 -0
- package/dist/components/JksViewer.vue_vue_type_script_setup_true_lang.js +353 -0
- package/dist/components/JsonlViewer.js +7 -0
- package/dist/components/JsonlViewer.vue.d.ts +15 -0
- package/dist/components/JsonlViewer.vue_vue_type_script_setup_true_lang.js +103 -0
- package/dist/components/LogViewer.js +7 -0
- package/dist/components/LogViewer.vue.d.ts +29 -0
- package/dist/components/LogViewer.vue_vue_type_script_setup_true_lang.js +670 -0
- package/dist/components/LrcViewer.js +7 -0
- package/dist/components/LrcViewer.vue.d.ts +17 -0
- package/dist/components/LrcViewer.vue_vue_type_script_setup_true_lang.js +106 -0
- package/dist/components/MarkdownTable.js +7 -0
- package/dist/components/MarkdownTable.vue.d.ts +19 -0
- package/dist/components/MarkdownTable.vue_vue_type_script_setup_true_lang.js +71 -0
- package/dist/components/MarkdownText.d.ts +30 -0
- package/dist/components/MarkdownText.js +21 -0
- package/dist/components/MhtViewer.js +7 -0
- package/dist/components/MhtViewer.vue.d.ts +22 -0
- package/dist/components/MhtViewer.vue_vue_type_script_setup_true_lang.js +112 -0
- package/dist/components/MindMapView.js +7 -0
- package/dist/components/MindMapView.vue.d.ts +23 -0
- package/dist/components/MindMapView.vue_vue_type_script_setup_true_lang.js +337 -0
- package/dist/components/MissingDependency.js +7 -0
- package/dist/components/MissingDependency.vue.d.ts +17 -0
- package/dist/components/MissingDependency.vue_vue_type_script_setup_true_lang.js +37 -0
- package/dist/components/ModelViewer.js +7 -0
- package/dist/components/ModelViewer.vue.d.ts +18 -0
- package/dist/components/ModelViewer.vue_vue_type_script_setup_true_lang.js +157 -0
- package/dist/components/MsiViewer.js +7 -0
- package/dist/components/MsiViewer.vue.d.ts +19 -0
- package/dist/components/MsiViewer.vue_vue_type_script_setup_true_lang.js +136 -0
- package/dist/components/NotebookViewer.js +7 -0
- package/dist/components/NotebookViewer.vue.d.ts +20 -0
- package/dist/components/NotebookViewer.vue_vue_type_script_setup_true_lang.js +125 -0
- package/dist/components/PdfViewer.js +7 -0
- package/dist/components/PdfViewer.vue.d.ts +19 -0
- package/dist/components/PdfViewer.vue_vue_type_script_setup_true_lang.js +114 -0
- package/dist/components/PptxViewer.js +7 -0
- package/dist/components/PptxViewer.vue.d.ts +20 -0
- package/dist/components/PptxViewer.vue_vue_type_script_setup_true_lang.js +73 -0
- package/dist/components/PsdViewer.js +7 -0
- package/dist/components/PsdViewer.vue.d.ts +15 -0
- package/dist/components/PsdViewer.vue_vue_type_script_setup_true_lang.js +218 -0
- package/dist/components/QmcAudioViewer.js +7 -0
- package/dist/components/QmcAudioViewer.vue.d.ts +18 -0
- package/dist/components/QmcAudioViewer.vue_vue_type_script_setup_true_lang.js +92 -0
- package/dist/components/RasterViewer.js +7 -0
- package/dist/components/RasterViewer.vue.d.ts +21 -0
- package/dist/components/RasterViewer.vue_vue_type_script_setup_true_lang.js +161 -0
- package/dist/components/RtfViewer.js +7 -0
- package/dist/components/RtfViewer.vue.d.ts +21 -0
- package/dist/components/RtfViewer.vue_vue_type_script_setup_true_lang.js +66 -0
- package/dist/components/SevenZipBrowser.js +7 -0
- package/dist/components/SevenZipBrowser.vue.d.ts +13 -0
- package/dist/components/SevenZipBrowser.vue_vue_type_script_setup_true_lang.js +366 -0
- package/dist/components/SqliteViewer.js +7 -0
- package/dist/components/SqliteViewer.vue.d.ts +18 -0
- package/dist/components/SqliteViewer.vue_vue_type_script_setup_true_lang.js +186 -0
- package/dist/components/SubtitleViewer.js +7 -0
- package/dist/components/SubtitleViewer.vue.d.ts +15 -0
- package/dist/components/SubtitleViewer.vue_vue_type_script_setup_true_lang.js +48 -0
- package/dist/components/XlsxChart.js +7 -0
- package/dist/components/XlsxChart.vue.d.ts +14 -0
- package/dist/components/XlsxChart.vue_vue_type_script_setup_true_lang.js +240 -0
- package/dist/components/XlsxViewer.js +7 -0
- package/dist/components/XlsxViewer.vue.d.ts +22 -0
- package/dist/components/XlsxViewer.vue_vue_type_script_setup_true_lang.js +814 -0
- package/dist/components/XmindViewer.js +7 -0
- package/dist/components/XmindViewer.vue.d.ts +13 -0
- package/dist/components/XmindViewer.vue_vue_type_script_setup_true_lang.js +48 -0
- package/dist/components/ZipBrowser.js +7 -0
- package/dist/components/ZipBrowser.vue.d.ts +14 -0
- package/dist/components/ZipBrowser.vue_vue_type_script_setup_true_lang.js +326 -0
- package/dist/components/ZoomImage.js +7 -0
- package/dist/components/ZoomImage.vue.d.ts +29 -0
- package/dist/components/ZoomImage.vue_vue_type_script_setup_true_lang.js +147 -0
- package/dist/components/epl/EplCodeBlock.js +7 -0
- package/dist/components/epl/EplCodeBlock.vue.d.ts +15 -0
- package/dist/components/epl/EplCodeBlock.vue_vue_type_script_setup_true_lang.js +72 -0
- package/dist/components/epl/EplDoc.js +7 -0
- package/dist/components/epl/EplDoc.vue.d.ts +19 -0
- package/dist/components/epl/EplDoc.vue_vue_type_script_setup_true_lang.js +327 -0
- package/dist/components/epl/EplMethod.js +7 -0
- package/dist/components/epl/EplMethod.vue.d.ts +14 -0
- package/dist/components/epl/EplMethod.vue_vue_type_script_setup_true_lang.js +100 -0
- package/dist/components/epl/EplResource.js +7 -0
- package/dist/components/epl/EplResource.vue.d.ts +15 -0
- package/dist/components/epl/EplResource.vue_vue_type_script_setup_true_lang.js +204 -0
- package/dist/components/epl/EplTree.js +7 -0
- package/dist/components/epl/EplTree.vue.d.ts +27 -0
- package/dist/components/epl/EplTree.vue_vue_type_script_setup_true_lang.js +123 -0
- package/dist/components/epl/EplVarTable.js +7 -0
- package/dist/components/epl/EplVarTable.vue.d.ts +21 -0
- package/dist/components/epl/EplVarTable.vue_vue_type_script_setup_true_lang.js +60 -0
- package/dist/components/epl/docTypes.d.ts +12 -0
- package/dist/components/epl/numbering.d.ts +21 -0
- package/dist/components/epl/numbering.js +14 -0
- package/dist/components/icons/Icon.js +7 -0
- package/dist/components/icons/Icon.vue.d.ts +14 -0
- package/dist/components/icons/Icon.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/components/icons/iconPaths.d.ts +60 -0
- package/dist/components/icons/iconPaths.js +54 -0
- package/dist/components/optionalViewer.d.ts +14 -0
- package/dist/components/optionalViewer.js +37 -0
- package/dist/components/ui/ClampBlock.d.ts +82 -0
- package/dist/components/ui/ClampBlock.js +63 -0
- package/dist/composables/useFileViewer.d.ts +428 -0
- package/dist/composables/useFileViewer.js +27 -0
- package/dist/composables/useLightbox.d.ts +33 -0
- package/dist/composables/useLightbox.js +17 -0
- package/dist/composables/useLogRules.d.ts +47 -0
- package/dist/composables/useLogRules.js +74 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.js +30 -0
- package/dist/lib/aes.d.ts +25 -0
- package/dist/lib/aes.js +99 -0
- package/dist/lib/appx.d.ts +66 -0
- package/dist/lib/appx.js +112 -0
- package/dist/lib/archive.d.ts +29 -0
- package/dist/lib/asn1.d.ts +47 -0
- package/dist/lib/asn1.js +122 -0
- package/dist/lib/binobj.d.ts +69 -0
- package/dist/lib/binobj.js +430 -0
- package/dist/lib/brotli.d.ts +14 -0
- package/dist/lib/brotli.js +16 -0
- package/dist/lib/bzip2.d.ts +14 -0
- package/dist/lib/bzip2.js +161 -0
- package/dist/lib/classfile.d.ts +72 -0
- package/dist/lib/classfile.js +210 -0
- package/dist/lib/codePreview.d.ts +22 -0
- package/dist/lib/codePreview.js +27 -0
- package/dist/lib/codefold.d.ts +14 -0
- package/dist/lib/codefold.js +30 -0
- package/dist/lib/codeformat.d.ts +21 -0
- package/dist/lib/codeformat.js +130 -0
- package/dist/lib/csv.d.ts +19 -0
- package/dist/lib/csv.js +74 -0
- package/dist/lib/des.d.ts +17 -0
- package/dist/lib/des.js +928 -0
- package/dist/lib/diagram.d.ts +5 -0
- package/dist/lib/diagram.js +479 -0
- package/dist/lib/dicom.d.ts +69 -0
- package/dist/lib/dicom.js +442 -0
- package/dist/lib/dicomCodecs.d.ts +28 -0
- package/dist/lib/dicomCodecs.js +156 -0
- package/dist/lib/dicomRender.d.ts +46 -0
- package/dist/lib/dicomRender.js +114 -0
- package/dist/lib/dxf.d.ts +86 -0
- package/dist/lib/dxf.js +399 -0
- package/dist/lib/eml.d.ts +40 -0
- package/dist/lib/eml.js +46 -0
- package/dist/lib/encoding.d.ts +28 -0
- package/dist/lib/encoding.js +44 -0
- package/dist/lib/epl/code/ast.d.ts +150 -0
- package/dist/lib/epl/code/codeDataParser.d.ts +3 -0
- package/dist/lib/epl/code/codeDataParser.js +330 -0
- package/dist/lib/epl/code/codeLines.d.ts +20 -0
- package/dist/lib/epl/code/codeLines.js +191 -0
- package/dist/lib/epl/code/structures.d.ts +86 -0
- package/dist/lib/epl/code/textCode.d.ts +29 -0
- package/dist/lib/epl/code/textCode.js +150 -0
- package/dist/lib/epl/code/variable.d.ts +25 -0
- package/dist/lib/epl/eplDocument.d.ts +21 -0
- package/dist/lib/epl/eplDocument.js +36 -0
- package/dist/lib/epl/imageList.d.ts +28 -0
- package/dist/lib/epl/imageList.js +66 -0
- package/dist/lib/epl/index.d.ts +53 -0
- package/dist/lib/epl/index.js +45 -0
- package/dist/lib/epl/io/binaryReader.d.ts +56 -0
- package/dist/lib/epl/io/binaryReader.js +119 -0
- package/dist/lib/epl/io/encoding.d.ts +16 -0
- package/dist/lib/epl/io/encoding.js +27 -0
- package/dist/lib/epl/model/eplSystemId.d.ts +64 -0
- package/dist/lib/epl/model/eplSystemId.js +16 -0
- package/dist/lib/epl/model/section.d.ts +46 -0
- package/dist/lib/epl/names/eplLibData.js +39 -0
- package/dist/lib/epl/names/idToNameMap.d.ts +33 -0
- package/dist/lib/epl/names/idToNameMap.js +130 -0
- package/dist/lib/epl/names/libNameProvider.d.ts +15 -0
- package/dist/lib/epl/names/libNameProvider.js +18 -0
- package/dist/lib/epl/program.d.ts +120 -0
- package/dist/lib/epl/program.js +134 -0
- package/dist/lib/epl/projectFileReader.d.ts +23 -0
- package/dist/lib/epl/projectFileReader.js +65 -0
- package/dist/lib/epl/sections/code.d.ts +20 -0
- package/dist/lib/epl/sections/esystemInfo.d.ts +14 -0
- package/dist/lib/epl/sections/losable.d.ts +11 -0
- package/dist/lib/epl/sections/projectConfig.d.ts +23 -0
- package/dist/lib/epl/sections/resource.d.ts +57 -0
- package/dist/lib/fb2.d.ts +14 -0
- package/dist/lib/fb2.js +62 -0
- package/dist/lib/fileType.d.ts +315 -0
- package/dist/lib/fileType.js +800 -0
- package/dist/lib/fonts.d.ts +8 -0
- package/dist/lib/fonts.js +4 -0
- package/dist/lib/format.d.ts +16 -0
- package/dist/lib/format.js +38 -0
- package/dist/lib/frontmatter.d.ts +13 -0
- package/dist/lib/frontmatter.js +23 -0
- package/dist/lib/geo.d.ts +30 -0
- package/dist/lib/geo.js +235 -0
- package/dist/lib/har.d.ts +171 -0
- package/dist/lib/har.js +397 -0
- package/dist/lib/highlight.d.ts +18 -0
- package/dist/lib/highlight.js +34 -0
- package/dist/lib/highlightLangs.d.ts +15 -0
- package/dist/lib/highlightLangs.js +93 -0
- package/dist/lib/hprof.d.ts +211 -0
- package/dist/lib/hprof.js +709 -0
- package/dist/lib/ipynb.d.ts +48 -0
- package/dist/lib/ipynb.js +130 -0
- package/dist/lib/jks.d.ts +86 -0
- package/dist/lib/jks.js +167 -0
- package/dist/lib/jsonl.d.ts +29 -0
- package/dist/lib/jsonl.js +24 -0
- package/dist/lib/lrc.d.ts +32 -0
- package/dist/lib/lrc.js +84 -0
- package/dist/lib/lzma.d.ts +70 -0
- package/dist/lib/lzma.js +204 -0
- package/dist/lib/markdown/blocks.d.ts +9 -0
- package/dist/lib/markdown/blocks.js +221 -0
- package/dist/lib/markdown/index.d.ts +3 -0
- package/dist/lib/markdown/inline.d.ts +33 -0
- package/dist/lib/markdown/inline.js +84 -0
- package/dist/lib/markdown/math.d.ts +5 -0
- package/dist/lib/markdown/math.js +25 -0
- package/dist/lib/markdown/segmentize.d.ts +11 -0
- package/dist/lib/markdown/segmentize.js +28 -0
- package/dist/lib/markdown/styles.d.ts +26 -0
- package/dist/lib/markdown/styles.js +135 -0
- package/dist/lib/mht.d.ts +51 -0
- package/dist/lib/mht.js +122 -0
- package/dist/lib/midi.d.ts +28 -0
- package/dist/lib/midi.js +84 -0
- package/dist/lib/mime.d.ts +82 -0
- package/dist/lib/mime.js +151 -0
- package/dist/lib/mindmap.d.ts +51 -0
- package/dist/lib/mindmap.js +113 -0
- package/dist/lib/mobi.d.ts +15 -0
- package/dist/lib/mobi.js +68 -0
- package/dist/lib/msi.d.ts +50 -0
- package/dist/lib/msi.js +332 -0
- package/dist/lib/optionalDep.d.ts +26 -0
- package/dist/lib/optionalDep.js +20 -0
- package/dist/lib/pkcs12.d.ts +56 -0
- package/dist/lib/pkcs12.js +356 -0
- package/dist/lib/qmc.d.ts +50 -0
- package/dist/lib/qmc.js +213 -0
- package/dist/lib/rar.d.ts +16 -0
- package/dist/lib/rar.js +40 -0
- package/dist/lib/rawPreview.d.ts +12 -0
- package/dist/lib/rawPreview.js +54 -0
- package/dist/lib/rc2.d.ts +12 -0
- package/dist/lib/rc2.js +298 -0
- package/dist/lib/resolveInput.d.ts +22 -0
- package/dist/lib/resolveInput.js +55 -0
- package/dist/lib/rtf.d.ts +53 -0
- package/dist/lib/rtf.js +413 -0
- package/dist/lib/sevenZip.d.ts +82 -0
- package/dist/lib/sevenZip.js +395 -0
- package/dist/lib/sha1.d.ts +24 -0
- package/dist/lib/sha1.js +53 -0
- package/dist/lib/sha256.d.ts +21 -0
- package/dist/lib/sha256.js +119 -0
- package/dist/lib/speechAudio.d.ts +36 -0
- package/dist/lib/speechAudio.js +85 -0
- package/dist/lib/sqlite.d.ts +38 -0
- package/dist/lib/sqlite.js +104 -0
- package/dist/lib/subtitle.d.ts +26 -0
- package/dist/lib/subtitle.js +99 -0
- package/dist/lib/tarball.d.ts +20 -0
- package/dist/lib/tarball.js +248 -0
- package/dist/lib/viewerFormats.d.ts +35 -0
- package/dist/lib/viewerFormats.js +83 -0
- package/dist/lib/viewerKind.d.ts +36 -0
- package/dist/lib/viewerKind.js +233 -0
- package/dist/lib/x509.d.ts +68 -0
- package/dist/lib/x509.js +267 -0
- package/dist/lib/xlsx.d.ts +55 -0
- package/dist/lib/xlsx.js +321 -0
- package/dist/lib/xlsxCharts.d.ts +34 -0
- package/dist/lib/xlsxCharts.js +152 -0
- package/dist/lib/xmind.d.ts +6 -0
- package/dist/lib/xmind.js +124 -0
- package/dist/lib/zip.d.ts +56 -0
- package/dist/lib/zip.js +169 -0
- package/dist/style.css +2 -0
- package/dist/types.d.ts +42 -0
- package/package.json +128 -0
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
//#region src/lib/binobj.ts
|
|
2
|
+
var e = class extends Error {
|
|
3
|
+
constructor(e) {
|
|
4
|
+
super(e), this.name = "UnsupportedBinaryError";
|
|
5
|
+
}
|
|
6
|
+
}, t = 2, n = 11, r = 2, i = 10, a = 0, o = {
|
|
7
|
+
2: "sparc",
|
|
8
|
+
3: "i386",
|
|
9
|
+
8: "mips",
|
|
10
|
+
20: "ppc",
|
|
11
|
+
21: "ppc64",
|
|
12
|
+
22: "s390",
|
|
13
|
+
40: "arm",
|
|
14
|
+
42: "sh",
|
|
15
|
+
50: "ia-64",
|
|
16
|
+
62: "x86-64",
|
|
17
|
+
183: "aarch64",
|
|
18
|
+
243: "riscv"
|
|
19
|
+
}, s = {
|
|
20
|
+
332: "i386",
|
|
21
|
+
358: "mips",
|
|
22
|
+
448: "arm",
|
|
23
|
+
452: "arm-thumb2",
|
|
24
|
+
512: "ia-64",
|
|
25
|
+
20580: "riscv64",
|
|
26
|
+
34404: "x86-64",
|
|
27
|
+
43620: "aarch64"
|
|
28
|
+
}, c = {
|
|
29
|
+
0: "local",
|
|
30
|
+
1: "global",
|
|
31
|
+
2: "weak"
|
|
32
|
+
}, l = {
|
|
33
|
+
[r]: "func",
|
|
34
|
+
[i]: "ifunc"
|
|
35
|
+
}, u = 6, d = 3, f = 4, p = 0, m = 1, h = 14, g = 15, _ = 29, v = 3, y = {
|
|
36
|
+
1: "可重定位 (REL)",
|
|
37
|
+
2: "可执行 (EXEC)",
|
|
38
|
+
3: "共享对象 (DYN/PIE)",
|
|
39
|
+
4: "核心转储 (CORE)"
|
|
40
|
+
}, b = {
|
|
41
|
+
0: "System V",
|
|
42
|
+
1: "HP-UX",
|
|
43
|
+
2: "NetBSD",
|
|
44
|
+
3: "Linux",
|
|
45
|
+
6: "Solaris",
|
|
46
|
+
7: "AIX",
|
|
47
|
+
9: "FreeBSD",
|
|
48
|
+
12: "OpenBSD"
|
|
49
|
+
}, x = {
|
|
50
|
+
1: "Native",
|
|
51
|
+
2: "Windows GUI",
|
|
52
|
+
3: "Windows 控制台",
|
|
53
|
+
5: "OS/2 控制台",
|
|
54
|
+
7: "POSIX 控制台",
|
|
55
|
+
9: "Windows CE GUI",
|
|
56
|
+
10: "EFI 应用",
|
|
57
|
+
11: "EFI 启动驱动",
|
|
58
|
+
12: "EFI 运行时驱动",
|
|
59
|
+
13: "EFI ROM",
|
|
60
|
+
14: "Xbox"
|
|
61
|
+
}, S = 3, C = 14, w = 16, T = {
|
|
62
|
+
CompanyName: "公司",
|
|
63
|
+
FileDescription: "描述",
|
|
64
|
+
FileVersion: "文件版本",
|
|
65
|
+
InternalName: "内部名称",
|
|
66
|
+
LegalCopyright: "版权",
|
|
67
|
+
OriginalFilename: "原始文件名",
|
|
68
|
+
ProductName: "产品",
|
|
69
|
+
ProductVersion: "产品版本",
|
|
70
|
+
Comments: "备注",
|
|
71
|
+
LegalTrademarks: "商标"
|
|
72
|
+
}, E = class {
|
|
73
|
+
buf;
|
|
74
|
+
le;
|
|
75
|
+
dv;
|
|
76
|
+
constructor(e, t) {
|
|
77
|
+
this.buf = e, this.le = t, this.dv = new DataView(e);
|
|
78
|
+
}
|
|
79
|
+
get length() {
|
|
80
|
+
return this.dv.byteLength;
|
|
81
|
+
}
|
|
82
|
+
u8(e) {
|
|
83
|
+
return this.dv.getUint8(e);
|
|
84
|
+
}
|
|
85
|
+
u16(e) {
|
|
86
|
+
return this.dv.getUint16(e, this.le);
|
|
87
|
+
}
|
|
88
|
+
u32(e) {
|
|
89
|
+
return this.dv.getUint32(e, this.le);
|
|
90
|
+
}
|
|
91
|
+
u64(e) {
|
|
92
|
+
return Number(this.dv.getBigUint64(e, this.le));
|
|
93
|
+
}
|
|
94
|
+
str(e) {
|
|
95
|
+
if (e < 0 || e >= this.length) return "";
|
|
96
|
+
let t = e;
|
|
97
|
+
for (; t < this.length && this.dv.getUint8(t) !== 0;) t++;
|
|
98
|
+
return new TextDecoder("utf-8").decode(new Uint8Array(this.buf, e, t - e));
|
|
99
|
+
}
|
|
100
|
+
slice(e, t) {
|
|
101
|
+
if (e < 0 || e >= this.length || t <= 0) return new Uint8Array();
|
|
102
|
+
let n = Math.min(this.length, e + t);
|
|
103
|
+
return new Uint8Array(this.buf.slice(e, n));
|
|
104
|
+
}
|
|
105
|
+
utf16(e, t) {
|
|
106
|
+
let n = Math.min(this.length, e + t), r = "";
|
|
107
|
+
for (let t = e; t + 1 < n; t += 2) {
|
|
108
|
+
let e = this.dv.getUint16(t, !0);
|
|
109
|
+
if (e === 0) break;
|
|
110
|
+
r += String.fromCharCode(e);
|
|
111
|
+
}
|
|
112
|
+
return r;
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
function D(t) {
|
|
116
|
+
if (t.byteLength < 64) throw new e("文件过小,不是有效的 ELF/PE");
|
|
117
|
+
let n = new DataView(t);
|
|
118
|
+
if (n.getUint32(0, !1) === 2135247942) return O(t);
|
|
119
|
+
if (n.getUint8(0) === 77 && n.getUint8(1) === 90) return M(t);
|
|
120
|
+
throw new e("无法识别的二进制格式(既不是 ELF 也不是 PE)");
|
|
121
|
+
}
|
|
122
|
+
function O(s) {
|
|
123
|
+
let u = new DataView(s), d = u.getUint8(4), f = u.getUint8(5);
|
|
124
|
+
if (d !== 1 && d !== 2) throw new e("未知 ELF 位宽");
|
|
125
|
+
let p = d === 2 ? 64 : 32, m = f !== 2, h = new E(s, m), g = h.u16(18), _ = o[g] ?? `0x${g.toString(16)}`, v = p === 64 ? h.u64(40) : h.u32(32), y = h.u16(p === 64 ? 58 : 46), b = h.u16(p === 64 ? 60 : 48), x = (e) => v + e * y, S = [];
|
|
126
|
+
for (let e = 0; e < b; e++) {
|
|
127
|
+
let t = x(e);
|
|
128
|
+
S.push({
|
|
129
|
+
type: h.u32(t + 4),
|
|
130
|
+
offset: p === 64 ? h.u64(t + 24) : h.u32(t + 16),
|
|
131
|
+
size: p === 64 ? h.u64(t + 32) : h.u32(t + 20),
|
|
132
|
+
link: h.u32(t + (p === 64 ? 40 : 24)),
|
|
133
|
+
entsize: p === 64 ? h.u64(t + 56) : h.u32(t + 36)
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
let C = S.find((e) => e.type === t), w = S.find((e) => e.type === n), T = C ?? w, D = !C, O = [];
|
|
137
|
+
try {
|
|
138
|
+
O = A(h, p, S);
|
|
139
|
+
} catch {}
|
|
140
|
+
let k = {
|
|
141
|
+
format: "elf",
|
|
142
|
+
arch: _,
|
|
143
|
+
bits: p,
|
|
144
|
+
endian: m ? "le" : "be",
|
|
145
|
+
stripped: D,
|
|
146
|
+
symbols: [],
|
|
147
|
+
meta: O
|
|
148
|
+
};
|
|
149
|
+
if (!T) return k.note = "未找到符号表(.symtab/.dynsym 均缺失,文件被完全剥离)", k;
|
|
150
|
+
let j = S[T.link];
|
|
151
|
+
if (!j) return k.note = "符号表缺少关联的字符串表", k;
|
|
152
|
+
let M = T.entsize || (p === 64 ? 24 : 16), N = Math.floor(T.size / M), P = [];
|
|
153
|
+
for (let e = 0; e < N; e++) {
|
|
154
|
+
let t = T.offset + e * M, n, o, s, u, d;
|
|
155
|
+
p === 64 ? (n = h.u32(t), o = h.u8(t + 4), s = h.u16(t + 6), u = h.u64(t + 8), d = h.u64(t + 16)) : (n = h.u32(t), u = h.u32(t + 4), d = h.u32(t + 8), o = h.u8(t + 12), s = h.u16(t + 14));
|
|
156
|
+
let f = o & 15;
|
|
157
|
+
if (f !== r && f !== i || s === a || n === 0) continue;
|
|
158
|
+
let m = h.str(j.offset + n);
|
|
159
|
+
m && P.push({
|
|
160
|
+
name: m,
|
|
161
|
+
address: u,
|
|
162
|
+
size: d || void 0,
|
|
163
|
+
kind: l[f] ?? "func",
|
|
164
|
+
bind: c[o >> 4],
|
|
165
|
+
source: C ? ".symtab" : ".dynsym"
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
return P.sort((e, t) => e.address - t.address || e.name.localeCompare(t.name)), k.symbols = P, P.length || (k.note = D ? "动态符号表中没有已定义的函数" : "未找到函数符号"), k;
|
|
169
|
+
}
|
|
170
|
+
var k = (e) => e + 3 & -4;
|
|
171
|
+
function A(e, t, n) {
|
|
172
|
+
let r = e.u16(16), i = e.u8(7), a = t === 64 ? e.u64(24) : e.u32(24), o = t === 64 ? e.u64(32) : e.u32(28), s = e.u16(t === 64 ? 54 : 42), c = e.u16(t === 64 ? 56 : 44), l = "", v = "";
|
|
173
|
+
if (o && c && s >= (t === 64 ? 56 : 32)) for (let n = 0; n < c; n++) {
|
|
174
|
+
let r = o + n * s, i = e.u32(r), a = t === 64 ? e.u64(r + 8) : e.u32(r + 4);
|
|
175
|
+
i === d ? l = e.str(a).trim() : i === f && !v && (v = j(e, a, t === 64 ? e.u64(r + 32) : e.u32(r + 16)));
|
|
176
|
+
}
|
|
177
|
+
let x = "", S = "", C = [], w = n.find((e) => e.type === u);
|
|
178
|
+
if (w) {
|
|
179
|
+
let r = n[w.link], i = r ? r.offset : 0, a = w.entsize || (t === 64 ? 16 : 8), o = Math.floor(w.size / a);
|
|
180
|
+
for (let n = 0; n < o; n++) {
|
|
181
|
+
let r = w.offset + n * a, o = t === 64 ? e.u64(r) : e.u32(r), s = t === 64 ? e.u64(r + 8) : e.u32(r + 4);
|
|
182
|
+
if (o === p) break;
|
|
183
|
+
if (o === m) {
|
|
184
|
+
let t = e.str(i + s);
|
|
185
|
+
t && C.push(t);
|
|
186
|
+
} else o === h ? x = e.str(i + s) : (o === g || o === _) && (S = e.str(i + s));
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
let T = [
|
|
190
|
+
{
|
|
191
|
+
label: "类型",
|
|
192
|
+
value: y[r] ?? `0x${r.toString(16)}`
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
label: "ABI",
|
|
196
|
+
value: b[i] ?? `0x${i.toString(16)}`
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
label: "入口",
|
|
200
|
+
value: `0x${a.toString(16)}`
|
|
201
|
+
}
|
|
202
|
+
];
|
|
203
|
+
return l && T.push({
|
|
204
|
+
label: "解释器",
|
|
205
|
+
value: l
|
|
206
|
+
}), x && T.push({
|
|
207
|
+
label: "SONAME",
|
|
208
|
+
value: x
|
|
209
|
+
}), C.length && T.push({
|
|
210
|
+
label: `依赖 (${C.length})`,
|
|
211
|
+
value: C.join(", ")
|
|
212
|
+
}), S && T.push({
|
|
213
|
+
label: "RPATH",
|
|
214
|
+
value: S
|
|
215
|
+
}), v && T.push({
|
|
216
|
+
label: "构建 ID",
|
|
217
|
+
value: v
|
|
218
|
+
}), T;
|
|
219
|
+
}
|
|
220
|
+
function j(e, t, n) {
|
|
221
|
+
let r = t, i = t + n;
|
|
222
|
+
for (; r + 12 <= i;) {
|
|
223
|
+
let t = e.u32(r), n = e.u32(r + 4), i = e.u32(r + 8), a = t ? e.str(r + 12) : "", o = r + 12 + k(t);
|
|
224
|
+
if (i === v && a === "GNU" && n > 0) return Array.from(e.slice(o, n)).map((e) => e.toString(16).padStart(2, "0")).join("");
|
|
225
|
+
let s = o + k(n);
|
|
226
|
+
if (s <= r) break;
|
|
227
|
+
r = s;
|
|
228
|
+
}
|
|
229
|
+
return "";
|
|
230
|
+
}
|
|
231
|
+
function M(t) {
|
|
232
|
+
let n = new E(t, !0), r = n.u32(60);
|
|
233
|
+
if (n.u32(r) !== 17744) throw new e("缺少 PE 签名");
|
|
234
|
+
let i = r + 4, a = n.u16(i), o = s[a] ?? `0x${a.toString(16)}`, c = n.u16(i + 2), l = n.u32(i + 8), u = n.u16(i + 18), d = n.u16(i + 16), f = i + 20, p = n.u16(f) === 523 ? 64 : 32, m = {
|
|
235
|
+
format: "pe",
|
|
236
|
+
arch: o,
|
|
237
|
+
bits: p,
|
|
238
|
+
endian: "le",
|
|
239
|
+
stripped: !0,
|
|
240
|
+
symbols: [],
|
|
241
|
+
meta: []
|
|
242
|
+
};
|
|
243
|
+
if (d === 0) return m.note = "该 PE 无可选头", m;
|
|
244
|
+
let h = [], g = f + d;
|
|
245
|
+
for (let e = 0; e < c; e++) {
|
|
246
|
+
let t = g + e * 40;
|
|
247
|
+
h.push({
|
|
248
|
+
vsize: n.u32(t + 8),
|
|
249
|
+
va: n.u32(t + 12),
|
|
250
|
+
rawSize: n.u32(t + 16),
|
|
251
|
+
raw: n.u32(t + 20)
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
let _ = (e) => {
|
|
255
|
+
for (let t of h) {
|
|
256
|
+
let n = Math.max(t.vsize, t.rawSize);
|
|
257
|
+
if (e >= t.va && e < t.va + n) return e - t.va + t.raw;
|
|
258
|
+
}
|
|
259
|
+
return null;
|
|
260
|
+
};
|
|
261
|
+
m.meta.push({
|
|
262
|
+
label: "类型",
|
|
263
|
+
value: u & 8192 ? "动态链接库 (DLL)" : "可执行文件 (EXE)"
|
|
264
|
+
});
|
|
265
|
+
let v = n.u16(f + 68);
|
|
266
|
+
m.meta.push({
|
|
267
|
+
label: "子系统",
|
|
268
|
+
value: x[v] ?? `0x${v.toString(16)}`
|
|
269
|
+
}), m.meta.push({
|
|
270
|
+
label: "入口",
|
|
271
|
+
value: `0x${n.u32(f + 16).toString(16)}`
|
|
272
|
+
});
|
|
273
|
+
let y = p === 64 ? n.u64(f + 24) : n.u32(f + 28);
|
|
274
|
+
m.meta.push({
|
|
275
|
+
label: "镜像基址",
|
|
276
|
+
value: `0x${y.toString(16)}`
|
|
277
|
+
}), l > 0 && l < 4294967295 && m.meta.push({
|
|
278
|
+
label: "链接时间",
|
|
279
|
+
value: N(l)
|
|
280
|
+
});
|
|
281
|
+
let b = f + (p === 64 ? 112 : 96), S = (() => {
|
|
282
|
+
let e = n.u32(b + 16);
|
|
283
|
+
return e ? _(e) : null;
|
|
284
|
+
})();
|
|
285
|
+
if (S != null) {
|
|
286
|
+
try {
|
|
287
|
+
for (let [e, t] of L(n, S, _)) m.meta.push({
|
|
288
|
+
label: T[e] ?? e,
|
|
289
|
+
value: t
|
|
290
|
+
});
|
|
291
|
+
} catch {}
|
|
292
|
+
try {
|
|
293
|
+
let e = B(n, S, _);
|
|
294
|
+
e && (m.iconDataUrl = e);
|
|
295
|
+
} catch {}
|
|
296
|
+
}
|
|
297
|
+
let C = n.u32(b);
|
|
298
|
+
if (!C) return m.note = "该 PE 没有导出表(无导出函数)", m;
|
|
299
|
+
let w = _(C);
|
|
300
|
+
if (w == null) return m.note = "导出表 RVA 无法定位", m;
|
|
301
|
+
let D = n.u32(w + 16), O = n.u32(w + 24), k = _(n.u32(w + 28)), A = _(n.u32(w + 32)), j = _(n.u32(w + 36));
|
|
302
|
+
if (k == null || A == null || j == null) return m.note = "导出表结构无法定位", m;
|
|
303
|
+
let M = [];
|
|
304
|
+
for (let e = 0; e < O; e++) {
|
|
305
|
+
let t = _(n.u32(A + e * 4)), r = t == null ? "" : n.str(t);
|
|
306
|
+
if (!r) continue;
|
|
307
|
+
let i = n.u16(j + e * 2), a = n.u32(k + i * 4);
|
|
308
|
+
M.push({
|
|
309
|
+
name: r,
|
|
310
|
+
address: a,
|
|
311
|
+
kind: "export",
|
|
312
|
+
source: "export",
|
|
313
|
+
ordinal: D + i
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
return M.sort((e, t) => e.address - t.address || e.name.localeCompare(t.name)), m.symbols = M, !M.length && !m.note && (m.note = "导出表中没有具名函数"), m;
|
|
317
|
+
}
|
|
318
|
+
function N(e) {
|
|
319
|
+
return (/* @__PURE__ */ new Date(e * 1e3)).toISOString().slice(0, 10);
|
|
320
|
+
}
|
|
321
|
+
function P(e, t) {
|
|
322
|
+
let n = e.u16(t + 12), r = e.u16(t + 14), i = [];
|
|
323
|
+
for (let a = 0; a < n + r; a++) {
|
|
324
|
+
let n = t + 16 + a * 8, r = e.u32(n), o = e.u32(n + 4);
|
|
325
|
+
i.push({
|
|
326
|
+
id: r & 2147483647,
|
|
327
|
+
named: (r & 2147483648) != 0,
|
|
328
|
+
isDir: (o & 2147483648) != 0,
|
|
329
|
+
offset: o & 2147483647
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
return i;
|
|
333
|
+
}
|
|
334
|
+
function F(e, t, n) {
|
|
335
|
+
let r = n(e.u32(t));
|
|
336
|
+
return r == null ? null : {
|
|
337
|
+
off: r,
|
|
338
|
+
size: e.u32(t + 4)
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
function I(e, t, n, r, i) {
|
|
342
|
+
let a = P(e, t).find((e) => !e.named && e.id === n && e.isDir);
|
|
343
|
+
if (!a) return null;
|
|
344
|
+
let o = P(e, t + a.offset), s = r == null ? o[0] : o.find((e) => !e.named && e.id === r);
|
|
345
|
+
if (!s) return null;
|
|
346
|
+
let c = t + s.offset;
|
|
347
|
+
if (s.isDir) {
|
|
348
|
+
let n = P(e, t + s.offset)[0];
|
|
349
|
+
if (!n || n.isDir) return null;
|
|
350
|
+
c = t + n.offset;
|
|
351
|
+
}
|
|
352
|
+
return F(e, c, i);
|
|
353
|
+
}
|
|
354
|
+
function L(e, t, n) {
|
|
355
|
+
let r = I(e, t, w, null, n);
|
|
356
|
+
return r ? z(e, r.off, r.size) : [];
|
|
357
|
+
}
|
|
358
|
+
function R(e, t) {
|
|
359
|
+
let n = e.u16(t), r = e.u16(t + 2), i = e.u16(t + 4), a = e.utf16(t + 6, 512), o = k(t + 6 + (a.length + 1) * 2), s = i === 1 ? r * 2 : r;
|
|
360
|
+
return {
|
|
361
|
+
key: a,
|
|
362
|
+
length: n,
|
|
363
|
+
valOff: o,
|
|
364
|
+
valLen: s,
|
|
365
|
+
wType: i,
|
|
366
|
+
childOff: k(o + s)
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
function z(e, t, n) {
|
|
370
|
+
let r = [], i = t + n, a = R(e, t);
|
|
371
|
+
if (a.key !== "VS_VERSION_INFO" || a.length === 0) return r;
|
|
372
|
+
let o = Math.min(i, t + a.length), s = a.childOff;
|
|
373
|
+
for (; s + 6 <= o;) {
|
|
374
|
+
let t = R(e, s);
|
|
375
|
+
if (t.length === 0) break;
|
|
376
|
+
if (t.key === "StringFileInfo") {
|
|
377
|
+
let n = Math.min(o, s + t.length), i = t.childOff;
|
|
378
|
+
for (; i + 6 <= n;) {
|
|
379
|
+
let t = R(e, i);
|
|
380
|
+
if (t.length === 0) break;
|
|
381
|
+
let a = Math.min(n, i + t.length), o = t.childOff;
|
|
382
|
+
for (; o + 6 <= a;) {
|
|
383
|
+
let t = R(e, o);
|
|
384
|
+
if (t.length === 0) break;
|
|
385
|
+
let n = t.wType === 1 ? e.utf16(t.valOff, t.valLen + 2).trim() : "";
|
|
386
|
+
t.key && n && r.push([t.key, n]), o = k(o + t.length);
|
|
387
|
+
}
|
|
388
|
+
i = k(i + t.length);
|
|
389
|
+
}
|
|
390
|
+
break;
|
|
391
|
+
}
|
|
392
|
+
s = k(s + t.length);
|
|
393
|
+
}
|
|
394
|
+
return r;
|
|
395
|
+
}
|
|
396
|
+
function B(e, t, n) {
|
|
397
|
+
let r = I(e, t, C, null, n);
|
|
398
|
+
if (!r) return null;
|
|
399
|
+
let i = e.u16(r.off + 4);
|
|
400
|
+
if (!i) return null;
|
|
401
|
+
let a = -1, o = -1;
|
|
402
|
+
for (let t = 0; t < i; t++) {
|
|
403
|
+
let n = r.off + 6 + t * 14, i = (e.u8(n) || 256) * (e.u8(n + 1) || 256) * 1e3 + e.u16(n + 6);
|
|
404
|
+
i > o && (o = i, a = t);
|
|
405
|
+
}
|
|
406
|
+
if (a < 0) return null;
|
|
407
|
+
let s = r.off + 6 + a * 14, c = {
|
|
408
|
+
w: e.u8(s),
|
|
409
|
+
h: e.u8(s + 1),
|
|
410
|
+
colorCount: e.u8(s + 2),
|
|
411
|
+
planes: e.u16(s + 4),
|
|
412
|
+
bitCount: e.u16(s + 6),
|
|
413
|
+
bytesInRes: e.u32(s + 8),
|
|
414
|
+
iconId: e.u16(s + 12)
|
|
415
|
+
}, l = I(e, t, S, c.iconId, n);
|
|
416
|
+
if (!l) return null;
|
|
417
|
+
let u = e.slice(l.off, Math.min(l.size, c.bytesInRes || l.size));
|
|
418
|
+
return u.length ? u.length > 8 && u[0] === 137 && u[1] === 80 && u[2] === 78 && u[3] === 71 ? `data:image/png;base64,${H(u)}` : `data:image/x-icon;base64,${H(V(c, u))}` : null;
|
|
419
|
+
}
|
|
420
|
+
function V(e, t) {
|
|
421
|
+
let n = new Uint8Array(22 + t.length), r = new DataView(n.buffer);
|
|
422
|
+
return r.setUint16(2, 1, !0), r.setUint16(4, 1, !0), n[6] = e.w & 255, n[7] = e.h & 255, n[8] = e.colorCount & 255, r.setUint16(10, e.planes, !0), r.setUint16(12, e.bitCount, !0), r.setUint32(14, t.length, !0), r.setUint32(18, 22, !0), n.set(t, 22), n;
|
|
423
|
+
}
|
|
424
|
+
function H(e) {
|
|
425
|
+
let t = "", n = 32768;
|
|
426
|
+
for (let r = 0; r < e.length; r += n) t += String.fromCharCode(...e.subarray(r, r + n));
|
|
427
|
+
return btoa(t);
|
|
428
|
+
}
|
|
429
|
+
//#endregion
|
|
430
|
+
export { e as UnsupportedBinaryError, D as parseBinObj };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* In-browser Brotli decompression, wrapping the WASM decoder (brotli-dec-wasm).
|
|
3
|
+
*
|
|
4
|
+
* Browsers ship native gzip/deflate (DecompressionStream) but NOT Brotli, and a faithful Brotli decoder is
|
|
5
|
+
* far too large to hand-roll (it carries a ~120KB static dictionary plus context modeling). So — like rar —
|
|
6
|
+
* this leans on a compiled WASM decoder: brotli-dec-wasm's `web` (wasm-bindgen) build, decode-only, ~250KB.
|
|
7
|
+
* The wasm is fetched as a same-origin asset (Vite emits it via the `?url` import) and instantiated from the
|
|
8
|
+
* fetched bytes (no streaming, so the server's wasm MIME type is irrelevant). Pulled in lazily by
|
|
9
|
+
* {@link lib/tarball} only when a `.br` / `.tar.br` is actually opened.
|
|
10
|
+
*
|
|
11
|
+
* Brotli is a raw stream with no magic bytes, so callers route to it by extension, not by sniffing.
|
|
12
|
+
*/
|
|
13
|
+
/** Decompress a complete Brotli stream into its raw bytes. */
|
|
14
|
+
export declare function brotliDecode(data: Uint8Array): Promise<Uint8Array>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import e, { decompress as t } from "brotli-dec-wasm/web";
|
|
2
|
+
import n from "brotli-dec-wasm/web/bg.wasm?url";
|
|
3
|
+
//#region src/lib/brotli.ts
|
|
4
|
+
var r = null;
|
|
5
|
+
function i() {
|
|
6
|
+
return r ||= (async () => {
|
|
7
|
+
let t = await fetch(n);
|
|
8
|
+
if (!t.ok) throw Error(`无法加载 brotli wasm(HTTP ${t.status})`);
|
|
9
|
+
await e({ module_or_path: await t.arrayBuffer() });
|
|
10
|
+
})(), r;
|
|
11
|
+
}
|
|
12
|
+
async function a(e) {
|
|
13
|
+
return await i(), t(e);
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { a as brotliDecode };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal in-browser bzip2 decoder — no dependency, no WASM.
|
|
3
|
+
*
|
|
4
|
+
* Browsers ship a native gzip/deflate inflate (DecompressionStream) but nothing for bzip2's Burrows–Wheeler
|
|
5
|
+
* pipeline, so — like {@link lib/lzma} does for 7z — the tar-family reader ({@link lib/tarball}) carries its
|
|
6
|
+
* own. This is a from-scratch port of the bzip2 block format (the algorithm Julian Seward's reference
|
|
7
|
+
* `bzip2`/libbzip2 implements): a bit reader, canonical-Huffman group tables, the MTF + RLE2 symbol decode,
|
|
8
|
+
* the inverse Burrows–Wheeler transform, and the final RLE1 run expansion.
|
|
9
|
+
*
|
|
10
|
+
* One synchronous entry point, {@link bzip2Decode}, returns the full decompressed bytes. Randomized blocks
|
|
11
|
+
* (a pre-0.9.5 quirk modern bzip2 never emits) and malformed streams are surfaced as errors.
|
|
12
|
+
*/
|
|
13
|
+
/** Decode a complete bzip2 stream ("BZh" + level + one or more blocks) into its raw bytes. */
|
|
14
|
+
export declare function bzip2Decode(data: Uint8Array): Uint8Array;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
//#region src/lib/bzip2.ts
|
|
2
|
+
var e = 3227993, t = 2511705, n = 1536581, r = 3690640, i = 0, a = 1, o = class {
|
|
3
|
+
data;
|
|
4
|
+
pos = 0;
|
|
5
|
+
buf = 0;
|
|
6
|
+
count = 0;
|
|
7
|
+
constructor(e) {
|
|
8
|
+
this.data = e;
|
|
9
|
+
}
|
|
10
|
+
bit() {
|
|
11
|
+
return this.count === 0 && (this.buf = this.pos < this.data.length ? this.data[this.pos++] : 0, this.count = 8), this.count--, this.buf >> this.count & 1;
|
|
12
|
+
}
|
|
13
|
+
bits(e) {
|
|
14
|
+
let t = 0;
|
|
15
|
+
for (let n = 0; n < e; n++) t = t << 1 | this.bit();
|
|
16
|
+
return t;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
function s(e, t) {
|
|
20
|
+
let n = 32, r = 0;
|
|
21
|
+
for (let i = 0; i < t; i++) e[i] > r && (r = e[i]), e[i] < n && (n = e[i]);
|
|
22
|
+
let i = new Int32Array(t), a = 0;
|
|
23
|
+
for (let o = n; o <= r; o++) for (let n = 0; n < t; n++) e[n] === o && (i[a++] = n);
|
|
24
|
+
let o = new Int32Array(r + 2);
|
|
25
|
+
for (let n = 0; n < t; n++) o[e[n] + 1]++;
|
|
26
|
+
for (let e = 1; e < o.length; e++) o[e] += o[e - 1];
|
|
27
|
+
let s = new Int32Array(r + 2), c = 0;
|
|
28
|
+
for (let e = n; e <= r; e++) c += o[e + 1] - o[e], s[e] = c - 1, c <<= 1;
|
|
29
|
+
for (let e = n + 1; e <= r; e++) o[e] = (s[e - 1] + 1 << 1) - o[e];
|
|
30
|
+
return {
|
|
31
|
+
minLen: n,
|
|
32
|
+
maxLen: r,
|
|
33
|
+
limit: s,
|
|
34
|
+
base: o,
|
|
35
|
+
perm: i
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function c(e, t) {
|
|
39
|
+
let n = t.minLen, r = e.bits(n);
|
|
40
|
+
for (; n <= t.maxLen && r > t.limit[n];) n++, r = r << 1 | e.bit();
|
|
41
|
+
return t.perm[r - t.base[n]];
|
|
42
|
+
}
|
|
43
|
+
function l(e, t) {
|
|
44
|
+
if (e.bits(16), e.bits(16), e.bit() !== 0) throw Error("不支持随机化的 bzip2 块");
|
|
45
|
+
let n = e.bits(24), r = e.bits(16), o = [];
|
|
46
|
+
for (let t = 0; t < 16; t++) if (r & 32768 >> t) {
|
|
47
|
+
let n = e.bits(16);
|
|
48
|
+
for (let e = 0; e < 16; e++) n & 32768 >> e && o.push(t * 16 + e);
|
|
49
|
+
}
|
|
50
|
+
let l = o.length;
|
|
51
|
+
if (l === 0) throw Error("bzip2 块符号表为空");
|
|
52
|
+
let d = l + 2, f = d - 1, p = e.bits(3);
|
|
53
|
+
if (p < 2 || p > 6) throw Error("bzip2 Huffman 组数非法");
|
|
54
|
+
let m = e.bits(15), h = new Int32Array(p);
|
|
55
|
+
for (let e = 0; e < p; e++) h[e] = e;
|
|
56
|
+
let g = new Uint8Array(m);
|
|
57
|
+
for (let t = 0; t < m; t++) {
|
|
58
|
+
let n = 0;
|
|
59
|
+
for (; e.bit() === 1;) if (n++, n >= p) throw Error("bzip2 选择器越界");
|
|
60
|
+
let r = h[n];
|
|
61
|
+
for (let e = n; e > 0; e--) h[e] = h[e - 1];
|
|
62
|
+
h[0] = r, g[t] = r;
|
|
63
|
+
}
|
|
64
|
+
let _ = [];
|
|
65
|
+
for (let t = 0; t < p; t++) {
|
|
66
|
+
let t = new Uint8Array(d), n = e.bits(5);
|
|
67
|
+
for (let r = 0; r < d; r++) {
|
|
68
|
+
for (;;) {
|
|
69
|
+
if (n < 1 || n > 20) throw Error("bzip2 码长非法");
|
|
70
|
+
if (e.bit() === 0) break;
|
|
71
|
+
e.bit() === 0 ? n++ : n--;
|
|
72
|
+
}
|
|
73
|
+
t[r] = n;
|
|
74
|
+
}
|
|
75
|
+
_.push(s(t, d));
|
|
76
|
+
}
|
|
77
|
+
let v = new Uint32Array(t), y = new Int32Array(256), b = o.slice(), x = 0, S = -1, C = 0, w = _[0], T = () => {
|
|
78
|
+
if (C === 0) {
|
|
79
|
+
if (S++, S >= m) throw Error("bzip2 选择器不足");
|
|
80
|
+
C = 50, w = _[g[S]];
|
|
81
|
+
}
|
|
82
|
+
return C--, c(e, w);
|
|
83
|
+
}, E = T();
|
|
84
|
+
for (; E !== f;) {
|
|
85
|
+
if (E === i || E === a) {
|
|
86
|
+
let e = -1, n = 1;
|
|
87
|
+
do
|
|
88
|
+
E === i ? e += n : e += n << 1, n <<= 1, E = T();
|
|
89
|
+
while (E === i || E === a);
|
|
90
|
+
e++;
|
|
91
|
+
let r = b[0];
|
|
92
|
+
if (y[r] += e, x + e > t) throw Error("bzip2 块溢出");
|
|
93
|
+
for (; e-- > 0;) v[x++] = r;
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
let e = E - 1, n = b[e];
|
|
97
|
+
for (let t = e; t > 0; t--) b[t] = b[t - 1];
|
|
98
|
+
if (b[0] = n, y[n]++, x >= t) throw Error("bzip2 块溢出");
|
|
99
|
+
v[x++] = n, E = T();
|
|
100
|
+
}
|
|
101
|
+
if (n >= x) throw Error("bzip2 origPtr 越界");
|
|
102
|
+
let D = new Int32Array(257);
|
|
103
|
+
for (let e = 0; e < 256; e++) D[e + 1] = y[e];
|
|
104
|
+
for (let e = 1; e <= 256; e++) D[e] += D[e - 1];
|
|
105
|
+
for (let e = 0; e < x; e++) {
|
|
106
|
+
let t = v[e] & 255;
|
|
107
|
+
v[D[t]] |= e << 8, D[t]++;
|
|
108
|
+
}
|
|
109
|
+
let O = v[n] >>> 8, k = new Uint8Array(x);
|
|
110
|
+
for (let e = 0; e < x; e++) O = v[O], k[e] = O & 255, O >>>= 8;
|
|
111
|
+
let A = new u(x), j = 0;
|
|
112
|
+
for (; j < x;) {
|
|
113
|
+
let e = k[j], t = 1;
|
|
114
|
+
for (; j + t < x && t < 4 && k[j + t] === e;) t++;
|
|
115
|
+
if (A.pushRepeat(e, t), j += t, t === 4) {
|
|
116
|
+
let t = k[j];
|
|
117
|
+
A.pushRepeat(e, t), j++;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return A.slice();
|
|
121
|
+
}
|
|
122
|
+
var u = class {
|
|
123
|
+
buf;
|
|
124
|
+
len = 0;
|
|
125
|
+
constructor(e) {
|
|
126
|
+
this.buf = new Uint8Array(Math.max(64, e));
|
|
127
|
+
}
|
|
128
|
+
ensure(e) {
|
|
129
|
+
let t = this.len + e;
|
|
130
|
+
if (t <= this.buf.length) return;
|
|
131
|
+
let n = this.buf.length * 2;
|
|
132
|
+
for (; n < t;) n *= 2;
|
|
133
|
+
let r = new Uint8Array(n);
|
|
134
|
+
r.set(this.buf.subarray(0, this.len)), this.buf = r;
|
|
135
|
+
}
|
|
136
|
+
pushRepeat(e, t) {
|
|
137
|
+
t <= 0 || (this.ensure(t), this.buf.fill(e, this.len, this.len + t), this.len += t);
|
|
138
|
+
}
|
|
139
|
+
slice() {
|
|
140
|
+
return this.buf.slice(0, this.len);
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
function d(i) {
|
|
144
|
+
if (i.length < 4 || i[0] !== 66 || i[1] !== 90 || i[2] !== 104) throw Error("不是有效的 bzip2 文件");
|
|
145
|
+
let a = i[3] - 48;
|
|
146
|
+
if (a < 1 || a > 9) throw Error("bzip2 块大小非法");
|
|
147
|
+
let s = a * 1e5, c = new o(i.subarray(4)), u = [];
|
|
148
|
+
for (;;) {
|
|
149
|
+
let i = c.bits(24), a = c.bits(24);
|
|
150
|
+
if (i === n && a === r) break;
|
|
151
|
+
if (i !== e || a !== t) throw Error("bzip2 块标记损坏");
|
|
152
|
+
u.push(l(c, s + 10));
|
|
153
|
+
}
|
|
154
|
+
let d = 0;
|
|
155
|
+
for (let e of u) d += e.length;
|
|
156
|
+
let f = new Uint8Array(d), p = 0;
|
|
157
|
+
for (let e of u) f.set(e, p), p += e.length;
|
|
158
|
+
return f;
|
|
159
|
+
}
|
|
160
|
+
//#endregion
|
|
161
|
+
export { d as bzip2Decode };
|