Compare commits

...

34 Commits

Author SHA1 Message Date
Nik
1a2d785093 patterns/java_class: Added MIME type 2023-06-24 11:05:10 +02:00
Nik
addec74d91 type/leb128: Fixed type always displaying 0 2023-06-22 17:35:59 +02:00
jfsbrito
ce83eedf02 patterns/7z: Added CompressData length and other improvements (#134)
* Update 7z.hexpat - v1.01

v1.01
--Minor changes.
--CompressData lenght added
--Output optimization

* Update 7z.hexpat v1.02

-Minor Changes
-Added Bzip2 verification
2023-06-22 07:27:31 +02:00
Doriel Rivalet
463ddcc62e themes: Add Catppuccin themes (#132)
* docs(README): add catppuccin theme

* themes: add catppuccin flavors

* chore: rename catppuccin files

* docs(README): update catppuccin file names
2023-06-19 23:09:16 +02:00
jfsbrito
13b97fc976 patterns/7z: Added 7Zip pattern (#128)
* 7z.hexpat

This repository contains a custom pattern for the ImHex tool that enables the analysis of 7zip files. The pattern allows for a structured view of 7zip files within ImHex, providing insights into various aspects of the file structure.

- Identification of 7zip files: The custom pattern detects and identifies 7zip file types based on their signature.
- Extraction of key information: The pattern extracts important details from the 7zip file, such as the format version, CRC values, relative offset of the end header, and file size.
- Differentiation of compression methods: The pattern distinguishes between LZMA and LZMA2 compression methods used within the 7zip file.
- Visualization of start and end headers: The pattern helps in visualizing the start and end headers of the 7zip file, making it easier to navigate through its structure.

To use the custom pattern for analyzing 7zip files in ImHex, follow these steps:

1. Install ImHex: Ensure that you have ImHex installed on your system.
2. Open a 7zip file: Launch ImHex and open the 7zip file you want to analyze.
3. Apply the custom pattern: In the "Pattern" menu, select the custom pattern for 7zip file analysis and apply it.
4. Explore the file structure: ImHex will display the matched patterns, allowing you to explore the structure of the 7zip file with the extracted information.

Please note that this custom pattern is designed specifically for 7zip files and may not be suitable for other file formats.

Contributions to this custom pattern for 7zip file analysis are welcome. If you have any improvements, bug fixes, or suggestions, feel free to submit a pull request.

This custom pattern for ImHex is licensed under the [MIT License](LICENSE.md). You are free to modify and distribute this pattern as per the terms of the license.

We would like to acknowledge the developers of ImHex for providing an excellent tool for binary file analysis. The custom pattern for 7zip file analysis in this repository builds upon the capabilities of ImHex to enhance the understanding of 7zip file structures.

---

We hope you find this custom pattern useful for analyzing 7zip files using ImHex. If you encounter any issues or have any questions, please feel free to raise them in the "Issues" section of this repository.

Thanks!

* Added test file

---------
2023-06-19 23:08:42 +02:00
luisfilipe23lol
55e4283432 patterns/cda: Added CDA pattern (#133)
* Create cda.hexpat

pattern language created for .cda files

* added test file for cda pattern

* Delete cda.hexpat.cda.cda

* Add test file cda

test file for cda pattern

* Update README.md

Add cda file in read.me
2023-06-19 14:22:17 +02:00
Nik
ea225edf12 git: Disable coverage information for now 2023-06-17 15:20:01 +02:00
blondecake433
bb19cb43ee patterns:/mp4: Added mp4 pattern (#129) 2023-06-17 15:07:08 +02:00
Nik
8f8ad0e2d5 git: Try fix Coveralls heap out of memory 2023-06-17 15:02:53 +02:00
Nik
3ad1f3969f includes/std: Fixed documentation of copy_value_to_section function 2023-06-15 22:58:44 +02:00
cryptax
5451d45158 patterns/dex: Fix pattern to see data section of DEX files + Link_data (#127) 2023-06-15 18:48:47 +02:00
Nik
e6a731fa1d includes/type: Added Base64 type 2023-06-15 17:34:20 +02:00
Jackson Barreto
8a62001705 patterns: Added TIFF pattern (#126)
* Create tiff.hexpat

* Update README.md

Update readme to include tiff hexpat

* added file to test the pattern

---------

Co-authored-by: joelalves <joel.17.alves@gmail.com>
2023-06-15 08:08:39 +02:00
Nik
1f8710b586 patterns/ntag: Fixed Length type transform function 2023-06-13 13:36:53 +02:00
Nik
acd2d4abb8 includes/std: Fixed description of array library (#125) 2023-06-12 08:10:48 +02:00
qufb
032f3c7c01 pattern/midi: Support multiple tracks (#124)
* pattern/midi: Support multiple tracks

* pattern/midi: Replace custom type used to index array
2023-06-11 13:09:23 +02:00
无以铭川
3841ff51ef pattern/java_class: Format byte code instruction (#123) 2023-06-08 23:39:39 +02:00
Nik
622721403f patterns/flac: Fixed typo 2023-06-06 08:26:01 +02:00
Nik
11291d1ebb tests: Added JPG test file 2023-06-05 10:59:12 +02:00
Nik
92e61ccf5d tests: Fixed build with new pattern language changes 2023-06-05 10:03:55 +02:00
Nik
062edfe527 includes/std: Fixed std::fxpt::to_fixed conversion issue 2023-06-05 09:48:33 +02:00
paxcut
5b32941801 patterns: Added visualizers to image patterns (#117)
* Added image visualizers to image patterns that were supported

* missing include files

* Small style fixes

---------

Co-authored-by: Nik <werwolv98@gmail.com>
2023-06-04 22:38:25 +02:00
Nik
e99ab5b59b patterns/java_class: Fixed duplicate variables 2023-06-02 10:54:09 +02:00
Feitong Chen
775c836766 patterns/macho: Fix macho CpuType error and add CpuType::ARM64 and CpuType::ARM64_32 (#115) 2023-06-01 16:38:34 +02:00
blondecake433
43058b4c45 pattern/gif: Improved GIF pattern (#114) 2023-05-26 09:28:18 +02:00
Justus Garbe
0128ea87db patterns/java_class: Added Java SE 20 Attributes, added value displaying (#113)
greatly enchanced the java pattern
2023-05-19 17:59:15 +02:00
WerWolv
fe231436d9 patterns/gb: Added Gameboy ROM pattern (#89)
* Added gameboy format

* Add mime type

* Add test

* Avoid DMCA :sweating:
2023-05-19 16:09:14 +02:00
gmestanley
7a9ac44577 patterns/pe: Improved PE pattern (#112)
New improvement
2023-05-16 11:03:07 +02:00
Nick Bitounis
74e9d8f2e7 patterns: Added pattern file for M.A.X. v1.04 game files. (#111)
* Added pattern file for M.A.X. v1.04 game files.

* * Added MAX pattern in list of patterns.
* Added MAX sample game save file.
* Reordered the list of patterns to ascending name.

---------

Co-authored-by: n.bitounis <n.bitounis@xe.gr>
2023-05-08 16:17:19 +02:00
Nik
2f39a62d85 includes/std: Added support for writing patterns to files 2023-05-02 20:38:21 +02:00
AdventureT
e21063d58b patterns: Added Crash Bandicoot - Back in time level format (#110)
* Added Crash Bandicoot - Back in time level format

* Update README.md

* Fix README.md
2023-04-25 21:44:02 +02:00
paxcut
8f1a6bdd75 includes/std: Added std::math::exp(), fixed std::math::ln comment (#106)
Removed extraneous argument base to ln function and added the necessary definition in include file to access previously builtin function exp.
2023-04-17 22:19:47 +02:00
Nik
b9af43e08b patterns: Fixed WAV MIME type in readme 2023-04-16 21:37:40 +02:00
Nik
2ffa4e0161 patterns/wav: Fixed MIME type 2023-04-06 12:33:46 +02:00
43 changed files with 5249 additions and 933 deletions

View File

@@ -59,16 +59,18 @@ jobs:
cd tests/build
ctest --output-on-failure
- name: ⚗️ Generate Coverage Report
run: |
cd tests/build
lcov -d ./_deps/pattern_language-build/lib --gcov-tool /usr/bin/gcov-12 -c -o coverage.info
#- name: ⚗️ Generate Coverage Report
# run: |
# cd tests/build
# lcov -d ./_deps/pattern_language-build/lib --gcov-tool /usr/bin/gcov-12 -c -o coverage.info
- name: ⬆️ Upload Coverage Report
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: tests/build/coverage.info
#- name: ⬆️ Upload Coverage Report
# uses: coverallsapp/github-action@master
# env:
# NODE_OPTIONS: --max-old-space-size=8000
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# path-to-lcov: tests/build/coverage.info
- name: 📎 Validate JSON Files
run: |

127
README.md
View File

@@ -22,75 +22,82 @@ Everything will immediately show up in ImHex's Content Store and gets bundled wi
| Name | MIME | Path | Description |
|------|------|------|-------------|
| BMP | `image/bmp` | [`patterns/bmp.hexpat`](patterns/bmp.hexpat) | OS2/Windows Bitmap files |
| ELF | `application/x-executable` | [`patterns/elf.hexpat`](patterns/elf.hexpat) | ELF header in elf binaries |
| PE | `application/x-dosexec` | [`patterns/pe.hexpat`](patterns/pe.hexpat) | PE header, COFF header, Standard COFF fields and Windows Specific fields |
| NE | | [`patterns/ne.hexpat`](patterns/ne.hexpat) | NE header and Standard NE fields |
| Intel HEX | | [`patterns/intel_hex.hexpat`](patterns/intel_hex.hexpat) | [Intel hexadecimal object file format definition]("https://en.wikipedia.org/wiki/Intel_HEX") |
| MIDI | `audio/midi` | [`patterns/midi.hexpat`](patterns/midi.hexpat) | MIDI header, event fields provided |
| WAV | `audio/wav` | [`patterns/wav.hexpat`](patterns/wav.hexpat) | RIFF header, WAVE header, PCM header |
| ZIP | `application/zip` | [`patterns/zip.hexpat`](patterns/zip.hexpat) | End of Central Directory Header, Central Directory File Headers |
| PCAP | `application/vnd.tcpdump.pcap` | [`patterns/pcap.hexpat`](patterns/pcap.hexpat) | pcap header and packets |
| SPIRV | | [`patterns/spirv.hexpat`](patterns/spirv.hexpat) | SPIR-V header and instructions |
| 7Z | | [`patterns/7z.hexpat`](patterns/7z.hexpat) | 7z File Format |
| AFE2 | | [`patterns/afe2.hexpat`](patterns/afe2.hexpat) | Nintendo Switch Atmosphère CFW Fatal Error log |
| AR | `application/x-archive` | [`patterns/ar.hexpat`](patterns/ar.hexpat) | Static library archive files |
| NACP | | [`patterns/nacp.hexpat`](patterns/nacp.hexpat) | Nintendo Switch NACP files |
| NRO | | [`patterns/nro.hexpat`](patterns/nro.hexpat) | Nintendo Switch NRO files |
| PRODINFO | | [`patterns/prodinfo.hexpat`](patterns/prodinfo.hexpat) | Nintendo Switch PRODINFO |
| Java Class | `application/x-java-applet` | [`patterns/java_class.hexpat`](patterns/java_class.hexpat) | Java Class files |
| ARM VTOR | | [`patterns/arm_cm_vtor.hexpat`](patterns/arm_cm_vtor.hexpat) | ARM Cortex M Vector Table Layout |
| ICO | | [`patterns/ico.hexpat`](patterns/ico.hexpat) | Icon (.ico) or Cursor (.cur) files |
| PNG | `image/png` | [`patterns/png.hexpat`](patterns/png.hexpat) | PNG image files |
| QOI | `image/qoi` | [`patterns/qoi.hexpat`](patterns/qoi.hexpat) | QOI image files |
| DDS | `image/vnd-ms.dds` | [`patterns/dds.hexpat`](patterns/dds.hexpat) | DirectDraw Surface |
| TGA | `image/tga` | [`patterns/tga.hexpat`](patterns/tga.hexpat) | Truevision TGA/TARGA image |
| ISO | | [`patterns/iso.hexpat`](patterns/iso.hexpat) | ISO 9660 file system |
| VDF | | [`patterns/vdf.hexpat`](patterns/vdf.hexpat) | Binary Value Data Format (.vdf) files |
| IP | | [`patterns/ip.hexpat`](patterns/ip.hexpat) | Ethernet II Frames (IP Packets) |
| UF2 | | [`patterns/uf2.hexpat`](patterns/uf2.hexpat) | [USB Flashing Format](https://github.com/microsoft/uf2) |
| File System | | [`patterns/fs.hexpat`](patterns/fs.hexpat) | Drive File System |
| Bencode | `application/x-bittorrent` | [`patterns/bencode.hexpat`](patterns/bencode.hexpat) | Bencode encoding, used by Torrent files |
| Protobuf | | [`patterns/protobuf.hexpat`](patterns/protobuf.hexpat) | Google Protobuf encoding |
| OGG | `audio/ogg` | [`patterns/ogg.hexpat`](patterns/ogg.hexpat) | OGG Audio format |
| STL | `model/stl` | [`patterns/stl.hexpat`](patterns/stl.hexpat) | STL 3D Model format |
| VHDX | | [`patterns/vhdx.hexpat`](patterns/vhdx.hexpat) | Microsoft Hyper-V Virtual Hard Disk format |
| NTAG | | [`patterns/ntag.hexpat`](patterns/ntag.hexpat) | NTAG213/NTAG215/NTAG216, NFC Forum Type 2 Tag compliant IC |
| Shell Link | `application/x-ms-shortcut` | [`patterns/lnk.hexpat`](patterns/lnk.hexpat) | Windows Shell Link file format |
| Xilinx BIT | | [`patterns/xilinx_bit.hexpat`](patterns/xilinx_bit.hexpat) | Xilinx FPGA Bitstreams |
| FLAC | `audio/flac` | [`patterns/flac.hexpat`](patterns/flac.hexpat) | Free Lossless Audio Codec, FLAC Audio Format |
| BMP | `image/bmp` | [`patterns/bmp.hexpat`](patterns/bmp.hexpat) | OS2/Windows Bitmap files |
| BSON | `application/bson` | [`patterns/bson.hexpat`](patterns/bson.hexpat) | BSON (Binary JSON) format |
| msgpack | `application/x-msgpack` | [`patterns/msgpack.hexpat`](patterns/msgpack.hexpat) | MessagePack binary serialization format |
| MiniDump | `application/x-dmp` | [`patterns/minidump.hexpat`](patterns/minidump.hexpat) | Windows MiniDump files |
| ID3 | `audio/mpeg` | [`patterns/id3.hexpat`](patterns/id3.hexpat) | ID3 tags in MP3 files |
| TAR | `application/x-tar` | [`patterns/tar.hexpat`](patterns/tar.hexpat) | Tar file format |
| CPIO | `application/x-cpio` | [`patterns/cpio.hexpat`](patterns/cpio.hexpat) | Old Binary CPIO Format |
| FDT | | [`patterns/fdt.hexpat`](patterns/fdt.hexpat) | Flat Linux Device Tree blob |
| StuffItV5 | `application/x-stuffit` | [`patterns/sit5.hexpat`](patterns/sit5.hexpat) | StuffIt V5 archive |
| NBT | | [`patterns/nbt.hexpat`](patterns/nbt.hexpat) | Minecraft NBT format |
| PCX | `application/x-pcx` | [`patterns/pcx.hexpat`](patterns/pcx.hexpat) | PCX Image format |
| GZIP | `application/gzip` | [`patterns/gzip.hexpat`](patterns/gzip.hexpat) | GZip compressed data format |
| PFS0 | | [`patterns/pfs0.hexpat`](patterns/pfs0.hexpat) | Nintendo Switch PFS0 archive (NSP files) |
| XCI | | [`patterns/xci.hexpat`](patterns/xci.hexpat) | Nintendo Switch XCI cardridge ROM |
| WAD | | [`patterns/wad.hexpat`](patterns/wad.hexpat) | DOOM WAD Archive |
| GIF | `image/gif` | [`patterns/gif.hexpat`](patterns/gif.hexpat) | GIF image files |
| ZSTD | `application/zstd` | [`patterns/zstd.hexpat`](patterns/zstd.hexpat) | Zstandard compressed data format |
| COFF | `application/x-coff` | [`patterns/coff.hexpat`](patterns/coff.hexpat) | Common Object File Format (COFF) executable |
| Mach-O | `application/x-mach-binary` | [`patterns/macho.hexpat`](patterns/macho.hexpat) | Mach-O executable |
| CHM | | [`patterns/chm.hexpat`](patterns/chm.hexpat) | Windows HtmlHelp Data (ITSF / CHM) |
| DMG | | [`patterns/dmg.hexpat`](patterns/dmg.hexpat) | Apple Disk Image Trailer (DMG) |
| XBEH | `audio/x-xbox-executable` | [`patterns/xbeh.hexpat`](patterns/xbeh.hexpat) | Xbox executable |
| QBCL | | [`patterns/qbcl.hexpat`](patterns/qbcl.hexpat) | Qubicle voxel scene project file |
| BSP | | [`patterns/bsp_goldsrc.hexpat`](patterns/bsp_goldsrc.hexpat) | GoldSrc engine maps format (used in Half-Life 1) |
| CCHVA | | [`patterns/cchva.hexpat`](patterns/cchva.hexpat) | Command and Conquer Voxel Animation |
| CCVXL | | [`patterns/ccvxl.hexpat`](patterns/ccvxl.hexpat) | Command and Conquer Voxel Model |
| CCPAL | | [`patterns/ccpal.hexpat`](patterns/ccpal.hexpat) | Command and Conquer Voxel Palette |
| PIF | `image/pif` | [`patterns/pif.hexpat`](patterns/pif.hexpat) | PIF Image Format |
| CDA | | [`patterns/cda.hexpat`](patterns/cda.hexpat) | Compact Disc Audio track |
| CHM | | [`patterns/chm.hexpat`](patterns/chm.hexpat) | Windows HtmlHelp Data (ITSF / CHM) |
| COFF | `application/x-coff` | [`patterns/coff.hexpat`](patterns/coff.hexpat) | Common Object File Format (COFF) executable |
| CPIO | `application/x-cpio` | [`patterns/cpio.hexpat`](patterns/cpio.hexpat) | Old Binary CPIO Format |
| CrashLvl | | [`patterns/Crashlvl.hexpat`](patterns/Crashlvl.hexpat) | Crash Bandicoot - Back in Time (fan game) User created flashback tapes level format |
| DDS | `image/vnd-ms.dds` | [`patterns/dds.hexpat`](patterns/dds.hexpat) | DirectDraw Surface |
| DEX | | [`patterns/dex.hexpat`](patterns/dex.hexpat) | Dalvik EXecutable Format |
| DMG | | [`patterns/dmg.hexpat`](patterns/dmg.hexpat) | Apple Disk Image Trailer (DMG) |
| DS_Store | `application/octet-stream` | [`patterns/dsstore.hexpat`](patterns/dsstore.hexpat) | .DS_Store file format |
| DTA | | [`patterns/max_v104.hexpat`](patterns/max_v104.hexpat) | Mechanized Assault and Exploration v1.04 (strategy game) save file format |
| ELF | `application/x-executable` | [`patterns/elf.hexpat`](patterns/elf.hexpat) | ELF header in elf binaries |
| EVTX | | [`patterns/evtx.hexpat`](patterns/evtx.hexpat) | MS Windows Vista Event Log |
| FDT | | [`patterns/fdt.hexpat`](patterns/fdt.hexpat) | Flat Linux Device Tree blob |
| File System | | [`patterns/fs.hexpat`](patterns/fs.hexpat) | Drive File System |
| FLAC | `audio/flac` | [`patterns/flac.hexpat`](patterns/flac.hexpat) | Free Lossless Audio Codec, FLAC Audio Format |
| GB | `application/x-gameboy-rom` | [`patterns/gb.hexpat`](patterns/gb.hexpat) | Gameboy ROM |
| GIF | `image/gif` | [`patterns/gif.hexpat`](patterns/gif.hexpat) | GIF image files |
| GZIP | `application/gzip` | [`patterns/gzip.hexpat`](patterns/gzip.hexpat) | GZip compressed data format |
| ICO | | [`patterns/ico.hexpat`](patterns/ico.hexpat) | Icon (.ico) or Cursor (.cur) files |
| ID3 | `audio/mpeg` | [`patterns/id3.hexpat`](patterns/id3.hexpat) | ID3 tags in MP3 files |
| Intel HEX | | [`patterns/intel_hex.hexpat`](patterns/intel_hex.hexpat) | [Intel hexadecimal object file format definition]("https://en.wikipedia.org/wiki/Intel_HEX") |
| IP | | [`patterns/ip.hexpat`](patterns/ip.hexpat) | Ethernet II Frames (IP Packets) |
| ISO | | [`patterns/iso.hexpat`](patterns/iso.hexpat) | ISO 9660 file system |
| Java Class | `application/x-java-applet` | [`patterns/java_class.hexpat`](patterns/java_class.hexpat) | Java Class files |
| JPEG | `image/jpeg` | [`patterns/jpeg.hexpat`](patterns/jpeg.hexpat) | JPEG Image Format |
| Lua 5.4 | | [`patterns/lua54.hexpat`](patterns/lua54.hexpat) | Lua 5.4 bytecode |
| DEX | | [`patterns/dex.hexpat`](patterns/dex.hexpat) | Dalvik EXecutable Format |
| DS_Store | `application/octet-stream` | [`patterns/dsstore.hexpat`](patterns/dsstore.hexpat) | .DS_Store file format |
| Mach-O | `application/x-mach-binary` | [`patterns/macho.hexpat`](patterns/macho.hexpat) | Mach-O executable |
| MIDI | `audio/midi` | [`patterns/midi.hexpat`](patterns/midi.hexpat) | MIDI header, event fields provided |
| MiniDump | `application/x-dmp` | [`patterns/minidump.hexpat`](patterns/minidump.hexpat) | Windows MiniDump files |
| mp4 | `video/mp4` | [`patterns/mp4.hexpat`](patterns/mp4.hexpat) | MPEG-4 Part 14 digital multimedia container format |
| msgpack | `application/x-msgpack` | [`patterns/msgpack.hexpat`](patterns/msgpack.hexpat) | MessagePack binary serialization format |
| NACP | | [`patterns/nacp.hexpat`](patterns/nacp.hexpat) | Nintendo Switch NACP files |
| NBT | | [`patterns/nbt.hexpat`](patterns/nbt.hexpat) | Minecraft NBT format |
| NE | | [`patterns/ne.hexpat`](patterns/ne.hexpat) | NE header and Standard NE fields |
| NRO | | [`patterns/nro.hexpat`](patterns/nro.hexpat) | Nintendo Switch NRO files |
| NTAG | | [`patterns/ntag.hexpat`](patterns/ntag.hexpat) | NTAG213/NTAG215/NTAG216, NFC Forum Type 2 Tag compliant IC |
| OGG | `audio/ogg` | [`patterns/ogg.hexpat`](patterns/ogg.hexpat) | OGG Audio format |
| PCAP | `application/vnd.tcpdump.pcap` | [`patterns/pcap.hexpat`](patterns/pcap.hexpat) | pcap header and packets |
| PCX | `application/x-pcx` | [`patterns/pcx.hexpat`](patterns/pcx.hexpat) | PCX Image format |
| PE | `application/x-dosexec` | [`patterns/pe.hexpat`](patterns/pe.hexpat) | PE header, COFF header, Standard COFF fields and Windows Specific fields |
| PFS0 | | [`patterns/pfs0.hexpat`](patterns/pfs0.hexpat) | Nintendo Switch PFS0 archive (NSP files) |
| PIF | `image/pif` | [`patterns/pif.hexpat`](patterns/pif.hexpat) | PIF Image Format |
| PNG | `image/png` | [`patterns/png.hexpat`](patterns/png.hexpat) | PNG image files |
| PRODINFO | | [`patterns/prodinfo.hexpat`](patterns/prodinfo.hexpat) | Nintendo Switch PRODINFO |
| Protobuf | | [`patterns/protobuf.hexpat`](patterns/protobuf.hexpat) | Google Protobuf encoding |
| QBCL | | [`patterns/qbcl.hexpat`](patterns/qbcl.hexpat) | Qubicle voxel scene project file |
| QOI | `image/qoi` | [`patterns/qoi.hexpat`](patterns/qoi.hexpat) | QOI image files |
| Shell Link | `application/x-ms-shortcut` | [`patterns/lnk.hexpat`](patterns/lnk.hexpat) | Windows Shell Link file format |
| SPIRV | | [`patterns/spirv.hexpat`](patterns/spirv.hexpat) | SPIR-V header and instructions |
| STL | `model/stl` | [`patterns/stl.hexpat`](patterns/stl.hexpat) | STL 3D Model format |
| StuffItV5 | `application/x-stuffit` | [`patterns/sit5.hexpat`](patterns/sit5.hexpat) | StuffIt V5 archive |
| TAR | `application/x-tar` | [`patterns/tar.hexpat`](patterns/tar.hexpat) | Tar file format |
| TIFF | `image/tiff` | [`patterns/tiff.hexpat`](patterns/tiff.hexpat) | Tag Image File Format |
| TGA | `image/tga` | [`patterns/tga.hexpat`](patterns/tga.hexpat) | Truevision TGA/TARGA image |
| UEFI | | [`patterns/uefi.hexpat`](patterns/uefi.hexpat)` | UEFI structs for parsing efivars |
| EVTX | | [`patterns/evtx.hexpat`](patterns/evtx.hexpat) | MS Windows Vista Event Log |
| BSP | | [`patterns/bsp_goldsrc.hexpat`](patterns/bsp_goldsrc.hexpat) | GoldSrc engine maps format (used in Half-Life 1) |
| UF2 | | [`patterns/uf2.hexpat`](patterns/uf2.hexpat) | [USB Flashing Format](https://github.com/microsoft/uf2) |
| VDF | | [`patterns/vdf.hexpat`](patterns/vdf.hexpat) | Binary Value Data Format (.vdf) files |
| VHDX | | [`patterns/vhdx.hexpat`](patterns/vhdx.hexpat) | Microsoft Hyper-V Virtual Hard Disk format |
| WAV | `audio/x-wav` | [`patterns/wav.hexpat`](patterns/wav.hexpat) | RIFF header, WAVE header, PCM header |
| WAD | | [`patterns/wad.hexpat`](patterns/wad.hexpat) | DOOM WAD Archive |
| XBEH | `audio/x-xbox-executable` | [`patterns/xbeh.hexpat`](patterns/xbeh.hexpat) | Xbox executable |
| XCI | | [`patterns/xci.hexpat`](patterns/xci.hexpat) | Nintendo Switch XCI cardridge ROM |
| Xilinx BIT | | [`patterns/xilinx_bit.hexpat`](patterns/xilinx_bit.hexpat) | Xilinx FPGA Bitstreams |
| ZIP | `application/zip` | [`patterns/zip.hexpat`](patterns/zip.hexpat) | End of Central Directory Header, Central Directory File Headers |
| ZSTD | `application/zstd` | [`patterns/zstd.hexpat`](patterns/zstd.hexpat) | Zstandard compressed data format |
### Scripts
@@ -179,3 +186,7 @@ Everything will immediately show up in ImHex's Content Store and gets bundled wi
|------|------|-------------|
| Visual Studio Dark | [`themes/vs_dark.json`](themes/vs_dark.json) | Theme similar to Visual Studio's Dark theme |
| Solarized Dark | [`themes/solarized_dark.json`](themes/solarized_dark.json) | Solarized Dark Theme |
| Catppuccin Latte | [`themes/catppuccin-latte.json`](themes/catppuccin-latte.json) | Catppuccin Latte Flavor (Light Theme) |
| Catppuccin Frappe | [`themes/catppuccin-frappe.json`](themes/catppuccin-frappe.json) | Catppuccin Frappe Flavor (Dark Theme) |
| Catppuccin Macchiato | [`themes/catppuccin-macchiato.json`](themes/catppuccin-macchiato.json) | Catppuccin Macchiato Flavor (Dark Theme) |
| Catppuccin Mocha | [`themes/catppuccin-mocha.json`](themes/catppuccin-mocha.json) | Catppuccin Mocha Flavor (Dark Theme) |

View File

@@ -1,8 +1,8 @@
#pragma once
/*!
The array library contains various helper functions and types to make
it easier to work with Arrays.
The array library contains a helper type to make it easier to create multi-dimensional arrays
and pass arrays to functions as parameters.
*/
namespace std {
@@ -16,4 +16,4 @@ namespace std {
T data[Size] [[inline]];
};
}
}

View File

@@ -59,9 +59,9 @@ namespace std::file {
/**
Writes the content of a string into a file
@param handle The file handle to write to
@param data String to write to the file
@param data String or Pattern to write to the file
*/
fn write(Handle handle, str data) {
fn write(Handle handle, auto data) {
builtin::std::file::write(handle, data);
};

View File

@@ -28,7 +28,7 @@ namespace std::fxpt {
@return The fixed point representation of flt
*/
fn to_fixed(double flt, u32 precision) {
return fixed((flt * (1 << precision)));
return s128((flt * (1 << precision)));
};
/**

View File

@@ -178,7 +178,6 @@ namespace std::math {
/**
Calculates the natural logarithm of `value`.
@param value Value
@param base Base
@return Logarithm of `value` with base `e`
*/
fn ln(auto value) { return builtin::std::math::ln(value); };
@@ -198,6 +197,13 @@ namespace std::math {
*/
fn pow(auto base, auto exp) { return builtin::std::math::pow(base, exp); };
/**
Calculates the value of the natural number `e` raised to the power of `value`.
@param value Exponent
@return `e` raised to the power of `value`
*/
fn exp(auto value) { return builtin::std::math::exp(value); };
/**
Calculates the square root of `value`.
@param value Value

View File

@@ -174,10 +174,9 @@ namespace std::mem {
/**
Copies a range of bytes from the main section into a custom section
@param from_section The section to copy from
@param from_address The address to copy from
@param value The pattern whose bytes should be copied
@param to_section The section to copy to
@param to_address The address to copy to
@param size The size of the range to copy
*/
fn copy_value_to_section(ref auto value, Section to_section, u64 to_address) {
builtin::std::mem::copy_value_to_section(value, to_section, to_address);

63
includes/type/base64.pat Normal file
View File

@@ -0,0 +1,63 @@
#include <std/io.pat>
#include <std/string.pat>
#include <std/mem.pat>
/*!
Type representing a Base64 encoded string
*/
namespace type {
/**
Type representing a Base64 encoded string
@tparam T String type
*/
struct Base64<T> {
T string;
} [[sealed, format("type::impl::transform_base64")]];
namespace impl {
fn get_decoded_value(char c) {
if (c >= 'A' && c <= 'Z') return c - 'A';
if (c >= 'a' && c <= 'z') return c - 'a' + 26;
if (c >= '0' && c <= '9') return c - '0' + 52;
if (c == '+') return 62;
if (c == '/') return 63;
return -1; // Invalid character
};
fn decode_base64(str input) {
u64 inputLength = std::string::length(input);
str result;
s32 val = 0;
s32 bits = -8;
for (u32 i = 0, i < inputLength, i += 1) {
char c = input[i];
if (c == '=')
break;
s32 index = type::impl::get_decoded_value(c);
if (index == -1)
continue;
val = (val << 6) + index;
bits += 6;
if (bits >= 0) {
result += char((val >> bits) & 0xFF);
bits -= 8;
}
}
return result;
};
fn transform_base64(ref auto base64) {
return type::impl::decode_base64(base64.string);
};
}
}

View File

@@ -33,7 +33,7 @@ namespace type {
namespace impl {
fn transform_uleb128_array(auto array) {
fn transform_uleb128_array(ref auto array) {
u128 res = array[0] & 0x7f;
for(u8 i = 1, array[i-1] & 0x80 != 0, i+=1) {
res |= u128(array[i] & 0x7f) << 7 * i;
@@ -41,7 +41,7 @@ namespace type {
return res;
};
fn transform_sleb128_array(auto array) {
fn transform_sleb128_array(ref auto array) {
s128 res = type::impl::transform_uleb128_array(array);
if (res & 0x40 != 0) {
res |= ~0 << (sizeof(array) / sizeof(u8)) * 7;
@@ -49,21 +49,21 @@ namespace type {
return res;
};
fn format_uleb128(auto leb128) {
fn format_uleb128(ref auto leb128) {
u128 res = type::impl::transform_uleb128_array(leb128.array);
return std::format("{} ({:#x})", res, res);
};
fn transform_uleb128(auto leb128) {
fn transform_uleb128(ref auto leb128) {
return type::impl::transform_uleb128_array(leb128.array);
};
fn format_sleb128(auto leb128) {
fn format_sleb128(ref auto leb128) {
s128 res = type::impl::transform_sleb128_array(leb128.array);
return std::format("{} ({:#x})", res, res);
};
fn transform_sleb128(auto leb128) {
fn transform_sleb128(ref auto leb128) {
return type::impl::transform_sleb128_array(leb128.array);
};

99
patterns/7z.hexpat Normal file
View File

@@ -0,0 +1,99 @@
#include <std/io.pat>
#include <std/mem.pat>
#include <std/math.pat>
enum Type:u8{
startPosition = 0x00, // Start position
sizeStartHeader = 0x20, // Size of start Header
};
enum TypeB:u48{
sevenZipSignature = 0x1C27AFBC7A37, // Defining 7z signature
};
struct StartHeader {
// File signature
u48 signature [[color("FF0000")] ];
// Version format
u16 formatVersion [[color("00FF00")]];
// CRC start header
u32 crcOfTheFollowing20Bytes [[color("0000FF")]];
// Relative offset of End Header
u64 relativeOffsetEndHeader [[color("FFFF00")]];
// Length of End Header
u64 theLengthOfEndHeader [[color("00FFFF")]];
// CRC of End Ender
u32 crcOftheEndHeader [[color("FF00FF")]];
// File size calculation
u64 fileSize = relativeOffsetEndHeader + theLengthOfEndHeader + Type::sizeStartHeader;
// Absolute offset calculation End Header
u64 startEndHeader = relativeOffsetEndHeader + Type::sizeStartHeader;
};
StartHeader startheader @ Type::startPosition;
struct CompressedData {
// Start of compressed data
u8 startOfCompressedData[4] [[color("C0C0C0")]];
};
CompressedData compresseddata @ Type::sizeStartHeader;
struct EndHeader {
// Set padding to place End Header in right position
padding[startheader.relativeOffsetEndHeader];
// Mark link to meta block
u8 linkToMetaBlock [[color("FF0000")]];
// Mark all End Header
char fullEndHeader[startheader.theLengthOfEndHeader] [[color("63954A")]];
// Detect LZMA signature
u64 lzmaSignaturePosition = std::mem::find_sequence_in_range(0, addressof(fullEndHeader), addressof(fullEndHeader) + sizeof(fullEndHeader), 0x23, 0x03, 0x01, 0x01, 0x05, 0x5D);
// Mark positions if LZMA signature was detected
if(lzmaSignaturePosition != 0xFFFFFFFFFFFFFFFF){
u48 lzmaSignature @ lzmaSignaturePosition [[color("0000FF")]];
}
};
EndHeader endheader @ Type::sizeStartHeader;
// Check 7z type
if(startheader.signature == TypeB::sevenZipSignature){
std::print("It is a 7z File Type");
}else{
std::print("The file is not 7z type");
}
std::print("Format Version {} ",startheader.formatVersion);
// Version verification
if(startheader.formatVersion == 0x0400){
std::print("Major Version 0x00 || 0 - Minor Version 0x04 || 4");
}
// Verification of the compressed method is LZMA, Bzip2 or LZMA2
if(compresseddata.startOfCompressedData[0] == Type::startPosition){
std::print("Compressed Method LZMA");
}else if(compresseddata.startOfCompressedData[0] == 0x42){
std::print("Compressed Method Bzip2");
}else{
std::print("Compressed Method LZMA2");
}
std::print("CRC Start Header 0x{:X}",startheader.crcOfTheFollowing20Bytes);
std::print("CRC End Header 0x{:X} ", startheader.crcOftheEndHeader);
std::print("CompressedData length 0x{:X} || {} bytes ",startheader.relativeOffsetEndHeader, startheader.relativeOffsetEndHeader);
std::print("Relative Offset of End Header 0x{:X} || {} bytes",startheader.relativeOffsetEndHeader, startheader.relativeOffsetEndHeader);
std::print("Offset to start End Header 0x{:X} || {} bytes",startheader.startEndHeader,startheader.startEndHeader);
std::print("End Header length 0x{:X} || {} bytes",startheader.theLengthOfEndHeader,startheader.theLengthOfEndHeader);
std::print("File size 0x{:X} || {} bytes",startheader.fileSize, startheader.fileSize);

73
patterns/Crashlvl.hexpat Normal file
View File

@@ -0,0 +1,73 @@
#include <type/magic.pat>
#include <std/string.pat>
#include <std/array.pat>
// Crash Bandicoot - Back in Time (fan game) user created tapes
// author AdventureT
struct Header {
type::Magic<"CRASHLVL"> magic;
u8 version;
std::string::SizedString<u8> levelName;
std::string::SizedString<u8> author;
};
enum Music : u32 {
None,
BonusBGM,
CrashCreatorBGM,
MainMenuBGM,
WarpRoomBGM,
Level01BGM,
Level02BGM,
Level03BGM,
Level04BGM,
Level05BGM,
SewerBGM,
EgyptBGM,
NBrioBGM
};
enum Type : u32 {
Unset,
Flashback,
Trial
};
enum Time : u32 {
Night,
Day,
Storm,
Dawn
};
enum Terrain : u32 {
None,
Machines,
Trees,
Waterfall,
Snow,
Fortress,
};
struct Options {
Type type;
Time time;
Terrain terrain;
Music music;
};
struct Object {
std::string::SizedString<u8> objName;
u32 x;
u32 y;
};
struct Objects{
u32 objCount;
std::Array<Object, objCount> objArray;
};
Header header @ 0x0;
Options options @ $;
Objects objects @ $;

View File

@@ -1,5 +1,6 @@
#pragma MIME image/bmp
#pragma endian little
#include <std/mem.pat>
struct BitmapFileHeader {
u8 bfType[2];
@@ -31,6 +32,7 @@ struct Colors {
};
struct Bitmap {
u8 data[std::mem::size()] [[no_unique_address, hidden]];
BitmapFileHeader bmfh;
BitmapInfoHeader bmih;
@@ -46,6 +48,6 @@ struct Bitmap {
u8 lineData[bmih.biSizeImage];
else
u8 lineData[bmfh.bfSize - $];
};
} [[hex::visualize("image", this.data)]];
Bitmap bitmap @ 0x00;

29
patterns/cda.hexpat Normal file
View File

@@ -0,0 +1,29 @@
struct Header {
u32 RIFF;
s32 size;
u32 CDDA;
u32 fmt;
u32 lenghtofthechunck;
u16 versionofcdformat;
u16 numberofrange;
u32 identifier;
};
struct DataInfo {
u32 range;
u32 duration;
u8 rangepositionframes;
u8 rangepositionseconds;
u8 rangepositionminutes;
u8 nullbyte;
u8 durationtrackframes;
u8 durationtrackseconds;
u8 durationtrackminutes;
u8 nullbytee;
};
Header header @ 0;
DataInfo data @ 0x1C;

View File

@@ -170,5 +170,8 @@ struct Dex {
field_id_item field_ids[header.field_ids_size] @ header.field_ids_off;
method_id_item method_ids[header.method_ids_size] @ header.method_ids_off;
class_def_item class_defs[header.class_defs_size] @ header.class_defs_off;
u8 data[header.data_size] @header.data_off;
map_list map_list @ header.map_off;
u8 link_data[header.link_size] @ header.link_off;
};
Dex dex @ 0x00;
Dex dex @ 0x00;

View File

@@ -138,7 +138,7 @@ enum PICTURE_TYPE : u32 {
struct METADATA_BLOCK_PICTURE {
PICTURE_TYPE pictureType;
u32 mimeTypeLength;
char mimeType[mineTypeLength];
char mimeType[mimeTypeLength];
u32 descriptionLength;
char description[descriptionLength];
u32 width, height;

337
patterns/gb.hexpat Normal file
View File

@@ -0,0 +1,337 @@
#include <type/size.pat>
#include <std/io.pat>
#include <std/string.pat>
#pragma MIME application/x-gameboy-rom
namespace format {
fn rom_type(u8 romType) {
u32 romSize = 32768 * (1 << romType);
u16 romBanks = 2 * (1 << romType);
if(romType == 0x52) {
romSize = 1153434;
romBanks = 72;
}
if(romType == 0x53) {
romSize = 1258291;
romBanks = 80;
}
return std::format("size: {}, banks: {}", type::impl::size_formatter(romSize), romBanks);
};
fn ram_type(u8 ramType) {
u16 ramSize;
u16 ramBanks;
if(ramType == 2) {
ramSize = 8192;
ramBanks = 1;
}
if(ramType == 3) {
ramSize = 32768;
ramBanks = 4;
}
if(ramType == 4) {
ramSize = 131072;
ramBanks = 16;
}
if(ramType == 5) {
ramSize = 65536;
ramBanks = 8;
}
return std::format("size: {}, banks: {}", type::impl::size_formatter(ramSize), ramBanks);
};
fn rom_features(u8 type) {
str result = "( ";
match(type) {
(0x00): result += "no_mbc ";
(0x01): result += "mbc1 ";
(0x02): result += "mbc1 | ram ";
(0x03): result += "mbc1 | ram | battery ";
(0x05): result += "mbc2 ";
(0x06): result += "mbc2 | battery ";
(0x08): result += "no_mbc | ram ";
(0x09): result += "no_mbc | ram | battery ";
(0x0B): result += "mmm01 ";
(0x0C): result += "mmm01 | ram ";
(0x0D): result += "mmm01 | ram | battery ";
(0x0F): result += "mbc3 | timer | battery ";
(0x10): result += "mbc3 | timer | ram | battery ";
(0x11): result += "mbc3 ";
(0x12): result += "mbc3 | ram ";
(0x13): result += "mbc3 | ram | battery ";
(0x19): result += "mbc5 ";
(0x1A): result += "mbc5 | ram ";
(0x1B): result += "mbc5 | ram | battery ";
(0x1C): result += "mbc5 | rumble ";
(0x1D): result += "mbc5 | rumble | ram ";
(0x1E): result += "mbc5 | rumble | ram | battery ";
(0x20): result += "mbc6 ";
(0x22): result += "mbc7 | sensor | rumble ";
(0xFC): result += "camera ";
(0xFD): result += "tama5 ";
(0xFE): result += "huc3 ";
(0xFF): result += "huc1 | ram | battery ";
}
return result + ")";
};
fn licensee_code(u8 code) {
match(code) {
(0x00): return "None";
(0x01 | 0x31): return "Nintendo";
(0x08 | 0x38): return "Capcom";
(0x09): return "Hot-B";
(0x0A | 0xE0): return "Jaleco";
(0x0B): return "Coconuts Japan";
(0x0C | 0x6E): return "Elite Systems";
(0x13 | 0x69): return "EA (Electronic Arts)";
(0x18): return "Hudsonsoft";
(0x19): return "ITC Entertainment";
(0x1A): return "Yanoman";
(0x1D): return "Japan Clary";
(0x1F | 0x4A | 0x61): return "Virgin Interactive";
(0x24): return "PCM Complete";
(0x25): return "San-X";
(0x28): return "Kotobuki Systems";
(0x29): return "Seta";
(0x30 | 0x70): return "Infogrames";
(0x32 | 0xA2 | 0xB2 | 0xC4): return "Bandai";
(0x33): return "See new licensee";
(0x34 | 0xA4): return "Konami";
(0x35): return "HectorSoft";
(0x39 | 0x9D): return "Banpresto";
(0x3C): return ".Entertainment i";
(0x3E): return "Gremlin";
(0x41): return "Ubisoft";
(0x42 | 0xEB): return "Atlus";
(0x44 | 0x4D): return "Malibu";
(0x46 | 0xCF): return "Angel";
(0x47): return "Spectrum Holoby";
(0x49): return "Irem";
(0x50): return "Absolute";
(0x51 | 0xB0): return "Acclaim";
(0x52): return "Activision";
(0x53): return "American Sammy";
(0x54): return "GameTek";
(0x55): return "Park Place";
(0x56 | 0xDB | 0xFF): return "LJN";
(0x57): return "Matchbox";
(0x59): return "Milton Bradley";
(0x5A): return "Mindscape";
(0x5B): return "Romstar";
(0x5C | 0xD6): return "Naxat Soft";
(0x5D): return "Tradewest";
(0x60): return "Titus";
(0x67): return "Ocean Interactive";
(0x6F): return "Electro Brain";
(0x71): return "Interplay";
(0x72 | 0xAA): return "Broderbund";
(0x73): return "Sculptered Soft";
(0x75): return "The Sales Curve";
(0x78): return "t.hq";
(0x79): return "Accolade";
(0x7A): return "Triffix Entertainment";
(0x7C): return "Microprose";
(0x7F | 0xC2): return "Kemco";
(0x80): return "Misawa Entertainment";
(0x83): return "Lozc";
(0x86 | 0xC4): return "Tokuma Shoten Intermedia";
(0x8B): return "Bullet-Proof Software";
(0x8C): return "Vic Tokai";
(0x8E): return "Ape";
(0x8F): return "I'Max";
(0x91): return "Chunksoft Co.";
(0x92): return "Video System";
(0x93): return "Tsubaraya Productions Co.";
(0x95): return "Varie Corporation";
(0x96): return "Yonezawa/SPal";
(0x97): return "Kaneko";
(0x99): return "Arc";
(0x9A): return "Nihon Bussan";
(0x9B): return "Tecmo";
(0x9C): return "Imagineer";
(0x9F): return "Nova";
(0xA1): return "Hori Electric";
(0xA6): return "Kawada";
(0xA7): return "Takara";
(0xA9): return "Technos Japan";
(0xAC): return "Toei Animation";
(0xAD): return "Toho";
(0xAF): return "Namco";
(0xB1): return "ASCII or Nexsoft";
(0xB4): return "Square Enix";
(0xB6): return "HAL Laboratory";
(0xB7): return "SNK";
(0xB9 | 0xCE): return "Pony Canyon";
(0xBA): return "Culture Brain";
(0xBB): return "Sunsoft";
(0xBD): return "Sony Imagesoft";
(0xBF): return "Sammy";
(0xC0 | 0xD0): return "Taito";
(0xC3): return "Squaresoft";
(0xC5): return "Data East";
(0xC6): return "Tonkinhouse";
(0xC8): return "Koei";
(0xC9): return "UFL";
(0xCA): return "Ultra";
(0xCB): return "Vap";
(0xCC): return "Use Corporation";
(0xCD): return "Meldac";
(0xD1): return "Sofel";
(0xD2): return "Quest";
(0xD3): return "Sigma Enterprises";
(0xD4): return "ASK Kodansha Co.";
(0xD7): return "Copya System";
(0xDA): return "Tomy";
(0xDD): return "NCS";
(0xDE): return "Human";
(0xDF): return "Altron";
(0xE1): return "Towa Chiki";
(0xE2): return "Yutaka";
(0xE3): return "Varie";
(0xE5): return "Epoch";
(0xE7): return "Athena";
(0xE8): return "Asmik";
(0xE9): return "Natsume";
(0xEA): return "King Records";
(0xEE): return "IGS";
(0xF0): return "A Wave";
(0xF3): return "Extreme Entertainment";
}
return "Unknown Licensee";
};
fn new_licensee_code(str a) {
if(a[0] == 0 && a[1] == 0) return "See old licensee";
match(a) {
("00"): return "None";
("01"): return "Nintendo R&D1";
("08"): return "Capcom";
("13"): return "Electronic Arts";
("18"): return "Hudson Soft";
("19"): return "b-ai";
("20"): return "kss";
("22"): return "pow";
("24"): return "PCM Complete";
("25"): return "san-x";
("28"): return "Kemco Japan";
("29"): return "seta";
("30"): return "Viacom";
("31"): return "Nintendo";
("32"): return "Bandai";
("33"): return "Ocean/Acclaim";
("34"): return "Konami";
("35"): return "Hector";
("37"): return "Taito";
("38"): return "Hudson";
("39"): return "Banpresto";
("41"): return "Ubi Soft";
("42"): return "Atlus";
("44"): return "Malibu";
("46"): return "angel";
("47"): return "Bullet-Proof";
("49"): return "irem";
("50"): return "Absolute";
("51"): return "Acclaim";
("52"): return "Activision";
("53"): return "American sammy";
("54"): return "Konami";
("55"): return "Hi tech entertainment";
("56"): return "LJN";
("57"): return "Matchbox";
("58"): return "Mattel";
("59"): return "Milton Bradley";
("60"): return "Titus";
("61"): return "Virgin";
("64"): return "LucasArts";
("67"): return "Ocean";
("69"): return "Electronic Arts";
("70"): return "Infogrames";
("71"): return "Interplay";
("72"): return "Broderbund";
("73"): return "sculptured";
("75"): return "sci";
("78"): return "THQ";
("79"): return "Accolade";
("80"): return "misawa";
("83"): return "lozc";
("86"): return "Tokuma Shoten Intermedia";
("87"): return "Tsukuda Original";
("91"): return "Chunksoft";
("92"): return "Video system";
("93"): return "Ocean/Acclaim";
("95"): return "Varie";
("96"): return "Yonezawa/spal";
("97"): return "Kaneko";
("99"): return "Pack in soft";
("A4"): return "Konami (Yu-Gi-Oh!)";
}
return "Unknown";
};
}
bitfield pixel_packed {
p1 : 1;
p2 : 1;
p3 : 1;
p4 : 1;
p5 : 1;
p6 : 1;
p7 : 1;
p8 : 1;
};
enum CGB : u8 {
NO_CGB = 0x00 ... 0x7F,
BACKWARDS_COMPATIBLE = 0x80,
CGB_ONLY = 0xC0
};
struct Logo {
pixel_packed rawData[0x30];
};
struct JumpVectors {
u8 rst1[8] [[comment("rst $1")]];
u8 rst2[8] [[comment("rst $2")]];
u8 rst3[8] [[comment("rst $3")]];
u8 rst4[8] [[comment("rst $4")]];
u8 rst5[8] [[comment("rst $5")]];;
u8 rst6[8] [[comment("rst $6")]];
u8 rst7[8] [[comment("rst $7")]];
u8 rst8[8] [[comment("rst $8")]];
u8 int1[8] [[comment("vblank")]];
u8 int2[8] [[comment("lcd stat")]];
u8 int3[8] [[comment("timer")]];
u8 int4[8] [[comment("serial")]];
u8 int5[8] [[comment("joypad")]];
};
struct Header {
u32 jmpInstruction;
Logo logo;
char title[0xF];
CGB cgb;
char newLicenseeCode[2] [[format("format::new_licensee_code")]];
bool sgbFlag;
u8 type [[format("format::rom_features")]];
u8 romType [[format("format::rom_type")]];
u8 ramType [[format("format::ram_type")]];
bool japanOnly;
u8 licenseeCode [[format("format::licensee_code")]];
u8 version;
u8 checksum [[comment("Checksum for: $134-$14C")]];
u16 gloalChecksum [[comment("Checksum for entire range")]];
};
struct Cartrige {
JumpVectors jumpVectors [[comment("Instructions called on interupts or rst instructions")]];
padding[0x100 - sizeof(JumpVectors)];
Header header;
};
Cartrige cart @ 0x00;

View File

@@ -1,20 +1,23 @@
#pragma MIME image/gif
// Extension Labels
#define LABEL_GC 0xF9
#define LABEL_COMMENT 0xFE
#define LABEL_APPLICATION 0xFF
#define LABEL_PLAINTEXT 0x01
#define LABEL_APPLICATION_NETSCAPE "NETSCAPE"
#define CODE_FRAME 0x2C
#define CODE_EXTENSION 0x21
#define CODE_TRAILER 0x3B
#define MAX_BLOCKS 4096
#define GCT_ACCESS parent.parent.parent.parent.header.gct
// Indentifier Magics
#define IMAGE_SEPERATOR_MAGIC 0x2C
#define EXTENSION_INTRODUCER_MAGIC 0x21
#define GIF_TRAILER_MAGIC 0x3B
#include <std/io.pat>
#include <std/core.pat>
#include <std/mem.pat>
#include <std/string.pat>
#include <std/math.pat>
#pragma MIME image/gif
#include <type/magic.pat>
bitfield GCT_Flags {
size : 3 [[comment("physical size = 2^(flags.size + 1)")]];
@@ -23,106 +26,114 @@ bitfield GCT_Flags {
enabled : 1;
};
bitfield LCT_Flags {
size : 3 [[comment("physical size = 2^(flags.size + 1)")]];
padding : 2;
sort : 1 [[comment("Indicates if the table is sorted by importance")]];
interlace : 1;
enable : 1;
bitfield ImageDescriptorFlags {
lctSize: 3;
reserved: 2;
lctSort: 1;
interlaceFlag: 1;
lctEnable: 1;
};
bitfield GC_Flags {
bitfield GCE_Flags {
transparent : 1;
userInput : 1;
disposalMode : 3 [[format("format::dispose_enum")]];
reserved : 3;
};
struct color {
u8 r, g, b;
} [[color(std::format("{:02X}{:02X}{:02X}", r, g, b))]];
struct Color {
u8 red;
u8 green;
u8 blue;
} [[color(std::format("{:02X}{:02X}{:02X}", red, green, blue))]];
struct subblock {
u8 size;
if(size == 0) break;
u8 data[size];
struct _SubBlocks {
u8 data_size;
u8 data[data_size];
};
struct block {
subblock blocks[MAX_BLOCKS];
};
fn exp2(auto n) {
return 1 << n;
struct DataSubBlocks {
_SubBlocks subBlocks[while(std::mem::read_unsigned($, 1) != 0)];
};
struct Header {
char magic[3];
type::Magic<"GIF"> magic;
char version[3];
};
struct LogicalScreenDescriptor {
u16 width;
u16 height;
GCT_Flags gctFlags;
u8 bgColorIndex;
u8 pixelAscpet;
if (gctFlags.enabled) {
color gct[(exp2(gctFlags.size + 1))];
color bgColor = gct[bgColorIndex];
Color gct[std::math::pow(2, gctFlags.size + 1)];
}
};
};
struct frame {
u16 x;
u16 y;
u16 width;
u16 height;
LCT_Flags lctFlags;
if(lctFlags.enable) {
color lct[(exp2(lctFlags.size + 1))];
struct ImageDescriptor {
u16 imageLeftPosition;
u16 imageTopPosition;
u16 imageWidth;
u16 imageHeight;
ImageDescriptorFlags flags;
if(flags.lctEnable) {
Color lct[std::math::pow(2, flags.lctSize + 1)];
}
u8 lzwMinCode [[comment("This byte determines the initial number of bits used for LZW codes in the image data")]];
block lzwCompressedData [[comment("Data is pallet indecies either into current LDC or GCT and is compressed using LZW")]];
DataSubBlocks lzwCompressedData [[comment("Data is pallet indecies either into current LDC or GCT and is compressed using LZW")]];
};
struct comment {
block data [[hidden]];
char comment[] @ addressof(data.blocks) + 1; // TODO : need to find a better way of doing this
struct CommentExtension {
DataSubBlocks commentData;
};
struct application {
u8 blockSize [[hidden]];
char identifier[8] [[comment("Only known are: NETSCAPE")]];
char version[3] [[comment("Only known for NETSCAPE: '2.0'")]];
block b [[hidden]];
if(identifier == LABEL_APPLICATION_NETSCAPE) {
u16 loopcount @ addressof(b.blocks[0].data) + 1 [[comment("0, = Forever")]];
}
struct ApplicationExtension {
u8 blockSize;
char identifier[8];
char authenticationCode[3];
DataSubBlocks applicationData;
};
struct plaintext {
u8 blockSize [[hidden]];
u16 gridLeftPos;
u16 gridTopPos;
u16 gridWidth;
u16 gridHeight;
u8 cellWidth;
u8 cellHeight;
u8 textForegroundColorIndex [[hidden]];
u8 textBackgroundColorIndex [[hidden]];
color textForegroundColor @ addressof(GCT_ACCESS[textForegroundColorIndex]);
color textBackgroundColor @ addressof(GCT_ACCESS[textBackgroundColorIndex]);
block data [[hidden]];
char text[] @ addressof(data.blocks) + 1;
//char text[data.blocks[std::core::array_index()].size] @ addressof(data.blocks[std::core::array_index()].data);
struct PlainTextExtension {
u8 blockSize;
u16 textGridLeftPos;
u16 textGridTopPos;
u16 textGridWidth;
u16 textGridHeight;
u8 charCellWidth;
u8 charCellHeight;
u8 textForegroundColorIndex;
u8 textBackgroundColorIndex;
DataSubBlocks plainTextData;
};
struct graphical_control {
u8 blockSize [[hidden]];
GC_Flags flags;
struct GraphicControlExtension {
u8 blockSize;
std::assert_warn(blockSize == 4, "Unexpected GCE block size");
GCE_Flags flags;
u16 delay [[format("format::delay")]];
u8 transparentColorIndex;
block b [[hidden]];
};
struct Extension {
u8 label [[format("format::extension_name")]];
if(label == LABEL_GC) GraphicControlExtension gce [[inline]];
if(label == LABEL_COMMENT) CommentExtension c [[inline]];
if(label == LABEL_APPLICATION) ApplicationExtension a [[inline]];
if(label == LABEL_PLAINTEXT) PlainTextExtension p [[inline]];
};
struct Block {
u8 identifier [[format("format::identifier_name")]];
if(identifier == IMAGE_SEPERATOR_MAGIC) ImageDescriptor i [[inline]];
if(identifier == EXTENSION_INTRODUCER_MAGIC) Extension e [[inline]];
if(identifier == GIF_TRAILER_MAGIC) break;
u8 blockTerminator;
} [[format("format::block_name")]];
namespace format {
fn dispose_enum(u8 value) {
if(value == 0x00) return "Do nothing";
@@ -139,11 +150,18 @@ namespace format {
return "Unknown Extension";
};
fn content_name(ref frame f) {
if(f.code == CODE_FRAME) return "Frame";
if(f.code == CODE_EXTENSION) return "Extension";
if(f.code == CODE_TRAILER) return "End";
return "Unknown Content";
fn block_name(ref Block b) {
if(b.identifier == IMAGE_SEPERATOR_MAGIC) return "Image Descriptor";
if(b.identifier == EXTENSION_INTRODUCER_MAGIC) return "Extension";
if(b.identifier == GIF_TRAILER_MAGIC) return "Trailer";
return "Unknown Block Type";
};
fn identifier_name(u8 identifier) {
if(identifier == IMAGE_SEPERATOR_MAGIC) return "Image Separator";
if(identifier == EXTENSION_INTRODUCER_MAGIC) return "Extension Introducer";
if(identifier == GIF_TRAILER_MAGIC) return "GIF Trailer";
return "Unknown Identifier";
};
fn delay(u16 delay) {
@@ -154,28 +172,12 @@ namespace format {
};
}
struct extension {
u8 label [[format("format::extension_name")]];
if(label == LABEL_GC) graphical_control gc [[inline]];
if(label == LABEL_COMMENT) comment c [[inline]];
if(label == LABEL_APPLICATION) application a [[inline]];
if(label == LABEL_PLAINTEXT) plaintext [[inline]];
};
struct content {
u8 code [[hidden]];
if(code == CODE_FRAME) frame f [[inline]];
if(code == CODE_EXTENSION) extension e [[inline]];
if(code == CODE_TRAILER) break;
} [[format("format::content_name")]];
struct Data {
content contents[while(!std::mem::eof())] [[inline]];
};
struct Gif {
u8 data[std::mem::size()] [[no_unique_address, hidden]];
Header header;
Data data;
};
std::assert_warn(header.version == "89a" || header.version == "87a", "Unsupported format version");
LogicalScreenDescriptor logicalScreenDescriptor;
Block blocks[while(!std::mem::eof())];
} [[hex::visualize("image", this.data)]];
Gif gif @ 0x00;

File diff suppressed because it is too large Load Diff

View File

@@ -119,4 +119,4 @@ struct Segment {
}
};
Segment segments[while(!std::mem::eof())] @ 0x00;
Segment segments[while(!std::mem::eof())] @ 0x00 [[hex::visualize("image", this)]];

View File

@@ -8,6 +8,7 @@ enum Magic : u32 {
};
enum CpuType : u32 {
ANY = -1,
VAX = 1,
ROMP = 2,
BS32032 = 4,
@@ -17,14 +18,16 @@ enum CpuType : u32 {
X86_64 = CpuType::I386 | 0x100'0000,
MIPS = 8,
NS32532 = 9,
MC98000 = 10,
HPPA = 11,
ARM = 12,
ARM64 = CpuType::ARM | 0x100'0000,
ARM64_32 = CpuType::ARM | 0x200'0000,
MC88000 = 13,
SPARC = 14,
I860 = be u32(15),
I860_LITTLE = 16,
RS6000 = 17,
MC980000 = 18,
POWERPC = 18,
POWERPC64 = CpuType::POWERPC | 0x100'0000,
VEO = 255

831
patterns/max_v104.hexpat Normal file
View File

@@ -0,0 +1,831 @@
#include <std/sys.pat>
#include <std/mem.pat>
#pragma array_limit 12544
#pragma pattern_limit 2000000
#pragma eval_depth 32
enum FileType : u8
{
Custom,
Tutorial,
Campaign,
Hot_seat,
Multiplayer,
Demo,
Debug,
Text,
Scenario,
Multi_scenario
};
enum PlanetType : u8
{
Snowcrab,
Frigia,
Ice_Berg,
The_Cooler,
Ultima_Thule,
Long_Floes,
Iron_Cross,
Splatterscape,
Peak_a_boo,
Valentines_Planet,
Three_Rings,
Great_divide,
New_Luzon,
Middle_Sea,
High_Impact,
Sanctuary,
Islandia,
Hammerhead,
Freckles,
Sandspit,
Great_Circle,
Long_Passage,
Flash_Point,
Bottleneck
};
enum TeamType : u8
{
None = 0,
Human = 1,
Computer = 2,
Remote = 3,
Eliminated = 4
};
enum TeamIndex : u8
{
Red = 0,
Green = 1,
Blue = 2,
Gray = 3
};
enum TeamIndex16 : u16
{
Red = 0,
Green = 1,
Blue = 2,
Gray = 3
};
enum PlayMode : u8
{
Turn_Based = 0,
Simultaneous_Moves = 1
};
enum TeamClan : u8
{
None = 0,
The_Chosen = 1,
Crimson_Path = 2,
Von_Griffin = 3,
Ayers_Hand = 4,
Musashi = 5,
Sacred_Eights = 6,
Seven_Knights = 7,
Axis_Inc = 8
};
enum OpponentType : u8
{
Clueless = 0,
Apprentice = 1,
Average = 2,
Expert = 3,
Master = 4,
God = 5
};
enum VictoryType : u8
{
Duration = 0,
Score = 1
};
struct IniOptions
{
s32 world;
s32 turn_timer;
s32 endturn;
s32 start_gold;
s32 play_mode;
s32 victory_type;
s32 victory_limit;
s32 opponent;
s32 raw_resource;
s32 fuel_resource;
s32 gold_resource;
s32 alien_derelicts;
};
struct IniPreferences
{
s32 effects;
s32 click_scroll;
s32 quick_scroll;
s32 fast_movement;
s32 follow_unit;
s32 auto_select;
s32 enemy_halt;
};
enum SurfaceType : u8
{
Land = 1,
Water = 2,
Coast = 4,
Air = 8
};
enum AiStrategy : u8
{
Random,
Defensive,
Missiles,
Air,
Sea,
Scout_horde,
Tank_horde,
Fast_attack,
Combined_arms,
Espionage
};
bitfield GridResourceMapEntry
{
padding : 2;
team_visibility_gray : 1;
team_visibility_blue : 1;
team_visibility_green : 1;
team_visibility_red : 1;
padding : 2;
cargo_amount : 5;
cargo_type_fuel : 1;
cargo_type_gold : 1;
cargo_type_material : 1;
};
bitfield UnitFlags
{
// MSB
requires_slab: 1;
turret_sprite: 1;
sentry_unit: 1;
spinning_turret: 1;
padding: 4;
hovering: 1;
has_firing_sprite: 1;
fires_missiles: 1;
constructor_unit: 1;
padding: 1;
electronic_unit: 1;
selectable: 1;
standalone: 1;
mobile_land_unit: 1;
stationary: 1;
padding: 4;
upgradeable: 1;
padding: 1;
// LSB
ground_cover : 1;
exploding: 1;
animated: 1;
connector_unit: 1;
building: 1;
missile_unit: 1;
mobile_air_unit: 1;
mobile_sea_unit: 1;
};
struct Point
{
s16 x;
s16 y;
};
struct ResearchTopicInfo
{
u32 research_level;
u32 turns_to_complete;
s32 allocation;
};
struct ScreenLocation
{
s8 x;
s8 y;
};
struct TeamInfo
{
Point markers[10];
TeamType team_type;
s8 field_41;
TeamClan team_clan;
ResearchTopicInfo research_topics[8];
u32 victory_points;
u16 next_unit_id;
u8 unit_counters[93];
ScreenLocation screen_location[6];
u16 score_graph[50];
u16 selected_unit;
u16 zoom_level;
Point screen_position;
bool gui_button_state_range;
bool gui_button_state_scan;
bool gui_button_state_status;
bool gui_button_state_colors;
bool gui_button_state_hits;
bool gui_button_state_ammo;
bool gui_button_state_names;
bool gui_button_state_minimap_2x;
bool gui_button_state_minimap_tnt;
bool gui_button_state_grid;
bool gui_button_state_survey;
u16 stats_factories_built;
u16 stats_mines_built;
u16 stats_buildings_built;
u16 stats_units_built;
u16 casualties[93];
u16 stats_gold_spent_on_upgrades;
};
struct UnitValues
{
u16 object_index;
if(CheckObjectId(object_index, true) == true)
{
u16 class_type;
u16 turns;
u16 hits;
u16 armor;
u16 attack;
u16 speed;
u16 range;
u16 rounds;
bool move_and_fire;
u16 scan;
u16 storage;
u16 ammo;
u16 attack_radius;
u16 agent_adjust;
u16 version;
u8 units_built;
}
};
struct Complex
{
u16 object_index;
if(CheckObjectId(object_index, true) == true)
{
u16 class_type;
s16 material;
s16 fuel;
s16 gold;
s16 power;
s16 workers;
s16 buildings;
s16 id;
}
};
struct TeamUnits
{
s16 gold;
UnitValues base_unit_values[93];
UnitValues current_unit_values[93];
u16 complex_count;
Complex complexes[complex_count];
};
enum UnitType : u16
{
UNIT_TYPE_GOLD_REFINERY = 0,
UNIT_TYPE_POWER_STATION = 1,
UNIT_TYPE_POWER_GENERATOR = 2,
UNIT_TYPE_BARRACKS = 3,
UNIT_TYPE_ALIEN_BUILDING_1 = 4,
UNIT_TYPE_RADAR = 5,
UNIT_TYPE_STORAGE_UNIT = 6,
UNIT_TYPE_FUEL_TANK = 7,
UNIT_TYPE_GOLD_VAULT = 8,
UNIT_TYPE_DEPOT = 9,
UNIT_TYPE_HANGAR = 10,
UNIT_TYPE_DOCK = 11,
UNIT_TYPE_CONNECTOR = 12,
UNIT_TYPE_LARGE_RUBBLE_1 = 13,
UNIT_TYPE_SMALL_RUBBLE_1 = 14,
UNIT_TYPE_LARGE_TAPE = 15,
UNIT_TYPE_SMALL_TAPE = 16,
UNIT_TYPE_LARGE_SLAB = 17,
UNIT_TYPE_SMALL_SLAB = 18,
UNIT_TYPE_LARGE_CONES = 19,
UNIT_TYPE_SMALL_CONES = 20,
UNIT_TYPE_ROAD = 21,
UNIT_TYPE_LANDING_PAD = 22,
UNIT_TYPE_SHIPYARD = 23,
UNIT_TYPE_LIGHT_VEHICLE_PLANT = 24,
UNIT_TYPE_HEAVY_VEHICLE_PLANT = 25,
UNIT_TYPE_ALIEN_BUILDING_2 = 26,
UNIT_TYPE_AIR_UNITS_PLANT = 27,
UNIT_TYPE_HABITAT = 28,
UNIT_TYPE_RESEARCH_CENTER = 29,
UNIT_TYPE_ECOSPHERE = 30,
UNIT_TYPE_ALIEN_BUILDING_3 = 31,
UNIT_TYPE_TRAINING_HALL = 32,
UNIT_TYPE_WATER_PLATFORM = 33,
UNIT_TYPE_GUN_TURRET = 34,
UNIT_TYPE_ANTI_AIRCRAFT = 35,
UNIT_TYPE_ARTILLERY = 36,
UNIT_TYPE_MISSILE_LAUNCHER = 37,
UNIT_TYPE_CONCRETE_BLOCK = 38,
UNIT_TYPE_BRIDGE = 39,
UNIT_TYPE_MINING_STATION = 40,
UNIT_TYPE_LAND_MINE = 41,
UNIT_TYPE_SEA_MINE = 42,
UNIT_TYPE_LAND_EXPLOSION = 43,
UNIT_TYPE_AIR_EXPLOSION = 44,
UNIT_TYPE_SEA_EXPLOSION = 45,
UNIT_TYPE_BUILDING_EXPLOSION = 46,
UNIT_TYPE_HIT_EXPLOSION = 47,
UNIT_TYPE_MASTER_BUILDER = 48,
UNIT_TYPE_CONSTRUCTOR = 49,
UNIT_TYPE_SCOUT = 50,
UNIT_TYPE_TANK = 51,
UNIT_TYPE_ASSAULT_GUN = 52,
UNIT_TYPE_ROCKET_LAUNCHER = 53,
UNIT_TYPE_MISSILE_CRAWLER = 54,
UNIT_TYPE_MOBILE_ANTI_AIRCRAFT = 55,
UNIT_TYPE_MINE_LAYER = 56,
UNIT_TYPE_SURVEYOR = 57,
UNIT_TYPE_SCANNER = 58,
UNIT_TYPE_SUPPLY_TRUCK = 59,
UNIT_TYPE_GOLD_TRUCK = 60,
UNIT_TYPE_ENGINEER = 61,
UNIT_TYPE_BULLDOZER = 62,
UNIT_TYPE_REPAIR_UNIT = 63,
UNIT_TYPE_FUEL_TRUCK = 64,
UNIT_TYPE_PERSONNEL_CARRIER = 65,
UNIT_TYPE_INFILTRATOR = 66,
UNIT_TYPE_INFANTRY = 67,
UNIT_TYPE_ESCORT = 68,
UNIT_TYPE_CORVETTE = 69,
UNIT_TYPE_GUNBOAT = 70,
UNIT_TYPE_SUBMARINE = 71,
UNIT_TYPE_SEA_TRANSPORT = 72,
UNIT_TYPE_MISSILE_CRUISER = 73,
UNIT_TYPE_SEA_MINE_LAYER = 74,
UNIT_TYPE_CARGO_SHIP = 75,
UNIT_TYPE_FIGHTER = 76,
UNIT_TYPE_GROUND_ATTACK_PLANE = 77,
UNIT_TYPE_AIR_TRANSPORT = 78,
UNIT_TYPE_AWAC = 79,
UNIT_TYPE_ALIEN_GUNBOAT = 80,
UNIT_TYPE_ALIEN_TANK = 81,
UNIT_TYPE_ALIEN_ASSAULT_GUN = 82,
UNIT_TYPE_ALIEN_ATTACK_PLANE = 83,
UNIT_TYPE_MISSILE = 84,
UNIT_TYPE_TORPEDO = 85,
UNIT_TYPE_ALIEN_MISSILE = 86,
UNIT_TYPE_TANK_PLASMA_BALL = 87,
UNIT_TYPE_ARTILLERY_PLASMA_BALL = 88,
UNIT_TYPE_SMOKE_TRAIL = 89,
UNIT_TYPE_BUBBLE_TRAIL = 90,
UNIT_TYPE_HARVESTER = 91,
UNIT_TYPE_DEAD_WALDO = 92
};
enum OrderType : u8
{
ORDER_TYPE_AWAITING = 0x0,
ORDER_TYPE_TRANSFORMING = 0x1,
ORDER_TYPE_MOVING = 0x2,
ORDER_TYPE_FIRING = 0x3,
ORDER_TYPE_ORDER_BUILDING = 0x4,
ORDER_TYPE_ACTIVATE_ORDER = 0x5,
ORDER_TYPE_NEW_ALLOCATE_ORDER = 0x6,
ORDER_TYPE_POWER_ON = 0x7,
ORDER_TYPE_POWER_OFF = 0x8,
ORDER_TYPE_EXPLODING = 0x9,
ORDER_TYPE_UNLOADING = 0xA,
ORDER_TYPE_CLEARING = 0xB,
ORDER_TYPE_SENTRY = 0xC,
ORDER_TYPE_LANDING = 0xD,
ORDER_TYPE_TAKING_OFF = 0xE,
ORDER_TYPE_LOADING = 0xF,
ORDER_TYPE_IDLE = 0x10,
ORDER_TYPE_REPAIRING = 0x11,
ORDER_TYPE_REFUELING = 0x12,
ORDER_TYPE_RELOADING = 0x13,
ORDER_TYPE_TRANSFERRING = 0x14,
ORDER_TYPE_AWAITING_21 = 0x15,
ORDER_TYPE_AWAITING_22 = 0x16,
ORDER_TYPE_AWAITING_23 = 0x17,
ORDER_TYPE_AWAITING_24 = 0x18,
ORDER_TYPE_AWAITING_25 = 0x19,
ORDER_TYPE_DISABLED = 0x1A,
ORDER_TYPE_MOVING_27 = 0x1B,
ORDER_TYPE_REPAIRING_28 = 0x1C,
ORDER_TYPE_TRANSFERRING_29 = 0x1D,
ORDER_TYPE_ATTACKING = 0x1E,
ORDER_TYPE_BUILDING_HALTED = 0x1F
};
struct Rect
{
s32 ulx;
s32 uly;
s32 lrx;
s32 lry;
};
struct PathStep
{
s8 x;
s8 y;
};
struct Path
{
u16 object_index;
if(CheckObjectId(object_index, true) == true)
{
u16 class_type;
// Air path
if (class_type == 1)
{
s16 length;
u8 angle;
Point pixel_start;
Point pixel_end;
s32 x_step;
s32 y_step;
s32 delta_x;
s32 delta_y;
}
// Ground path
else if (class_type == 4)
{
Point pixel_end;
s16 index;
s16 steps_count;
PathStep steps[steps_count];
}
// Builder path
else if (class_type == 2)
{
Point coordinate;
}
else
{
std::assert(0, "Unknown path class");
}
}
};
struct UnitTypeArray
{
u16 object_count;
UnitType array[object_count];
};
struct UnitInfo
{
u16 object_index;
if(CheckObjectId(object_index, true) == true)
{
u16 class_type;
UnitType unit_type;
if (unit_type == UnitType::UNIT_TYPE_DEAD_WALDO)
{
std::print("Found Waldo!");
}
u16 hash_id;
UnitFlags flags;
Point pixel_position;
Point grid_position;
u16 name_length;
s8 name[name_length];
Point shadow_offset;
TeamIndex team;
u8 name_index;
u8 brightness;
u8 angle;
u8 visible_to_team[5];
u8 spotted_by_team[5];
u8 max_velocity;
u8 velocity;
u8 sound;
u8 scaler_adjust;
Rect sprite_bounds;
Rect shadow_bounds;
u8 turret_angle;
s8 turret_offset_x;
s8 turret_offset_y;
u16 total_images;
u16 image_base;
u16 turret_image_base;
u16 firing_image_base;
u16 connector_image_base;
u16 image_index;
u16 turret_image_index;
u16 image_index_max;
OrderType orders;
u8 state;
OrderType prior_orders;
u8 prior_state;
u8 laying_state;
Point target_grid;
u8 build_time;
u8 total_mining;
u8 raw_mining;
u8 fuel_mining;
u8 gold_mining;
u8 raw_mining_max;
u8 gold_mining_max;
u8 fuel_mining_max;
u8 hits;
u8 speed;
u8 shots;
u8 move_and_fire;
u16 storage;
u8 ammo;
u8 targeting_mode;
u8 enter_mode;
u8 cursor;
u8 recoil_delay;
u8 delayed_reaction;
u8 damaged_this_turn;
u8 research_topic;
u8 moved;
u8 bobbed;
u8 shake_effect_state;
u8 engine;
u8 weapon;
u8 comm;
u8 fuel_distance;
u8 move_fraction;
u8 energized;
u8 repeat_build;
u16 build_rate;
u8 disabled_reaction_fire;
u8 auto_survey;
u32 field_221;
Path path;
u16 connectors;
UnitValues base_values;
Complex complex;
UnitInfo parent_unit;
UnitInfo enemy_unit;
UnitTypeArray build_list;
}
};
struct UnitInfoList
{
u16 unitinfo_count;
UnitInfo units[unitinfo_count];
};
struct HashMapUnitInfo
{
u16 hash_size;
UnitInfoList map[hash_size];
};
struct MapHash
{
Point coordinates;
UnitInfoList units;
};
struct MapHashList
{
u16 maphash_count;
MapHash objects[maphash_count];
};
struct HashMapMapHash
{
u16 hash_size;
s16 x_shift;
MapHashList map[hash_size];
};
struct TeamHeatMaps
{
u8 heatmap_complete[12544];
u8 heatmap_stealth_sea[12544];
u8 heatmap_stealth_land[12544];
};
struct MessageLog
{
s16 length;
char text[length];
UnitInfo unit;
Point coordinates;
bool is_alert_message;
u16 resource_id;
};
struct MessageLogList
{
u16 message_log_count;
MessageLog entires[message_log_count];
};
struct AiMap
{
UnitInfo unit;
TeamIndex16 team;
bool visible_to_team;
Point point;
};
struct AiMapList
{
u16 ai_map_count;
AiMap objects[ai_map_count];
};
struct AiPlayer
{
TeamIndex16 team;
AiStrategy strategy;
s16 field_3;
s16 field_5;
s16 field_7;
TeamIndex16 target_team;
AiMapList map_list;
u16 has_info_map;
if (has_info_map)
{
u8 info_map[12544];
}
u16 has_mine_map;
if (has_mine_map)
{
u8 mine_map[12544];
}
Point target_location;
};
u16 last_object_index;
bool context;
fn Init()
{
context = false;
last_object_index = 0;
};
fn CheckObjectId(u16 index, bool caller)
{
bool result = false;
// ImHex bug workaround
if (context) { context = false; return result; }
// null object?
if (index == 0)
{
return false;
}
// already serialized object?
if (last_object_index < index)
{
last_object_index = index;
result = true;
}
return result;
};
struct SaveFile
{
Init();
s16 version;
FileType save_file_type;
char save_game_name[30];
PlanetType planet;
s16 mission_index;
char team_name_red[30];
char team_name_green[30];
char team_name_blue[30];
char team_name_gray[30];
TeamType team_type_red;
TeamType team_type_green;
TeamType team_type_blue;
TeamType team_type_gray;
TeamType team_type_alien;
TeamClan team_clan_red;
TeamClan team_clan_green;
TeamClan team_clan_blue;
TeamClan team_clan_gray;
TeamClan team_clan_alien;
u32 rng_seed;
OpponentType opponent;
s16 turn_timer;
s16 endturn;
PlayMode play_mode;
IniOptions options;
SurfaceType surface_map[12544];
GridResourceMapEntry GridResourceMap[12544];
TeamInfo team_info_red;
TeamInfo team_info_green;
TeamInfo team_info_blue;
TeamInfo team_info_gray;
TeamIndex active_turn_team;
TeamIndex player_team;
s32 turn_counter;
s16 game_state;
u16 turn_timer_;
IniPreferences preferences;
TeamUnits team_units_red;
TeamUnits team_units_green;
TeamUnits team_units_blue;
TeamUnits team_units_gray;
UnitInfoList unit_info_list_ground_cover_units;
UnitInfoList unit_info_list_mobile_land_sea_units;
UnitInfoList unit_info_list_stationary_units;
UnitInfoList unit_info_list_mobile_air_units;
UnitInfoList unit_info_list_particles;
HashMapUnitInfo hash_map_unit_info;
HashMapMapHash hash_map_map_hash;
if (team_type_red != TeamType::None)
{
TeamHeatMaps heat_maps_red;
}
if (team_type_green != TeamType::None)
{
TeamHeatMaps heat_maps_green;
}
if (team_type_blue != TeamType::None)
{
TeamHeatMaps heat_maps_blue;
}
if (team_type_gray != TeamType::None)
{
TeamHeatMaps heat_maps_gray;
}
MessageLogList message_log_red;
MessageLogList message_log_green;
MessageLogList message_log_blue;
MessageLogList message_log_gray;
if (team_type_red == TeamType::Computer)
{
AiPlayer ai_player_red;
}
if (team_type_green == TeamType::Computer)
{
AiPlayer ai_player_green;
}
if (team_type_blue == TeamType::Computer)
{
AiPlayer ai_player_blue;
}
if (team_type_gray == TeamType::Computer)
{
AiPlayer ai_player_gray;
}
};
SaveFile save @ 0x0;
std::assert($ == std::mem::size(), "Extra data found after parsed data");

View File

@@ -1,72 +1,278 @@
#include <std/core.pat>
#pragma MIME audio/midi
#pragma endian big
using Delta = u8;
using NoteValue = u8;
using Velocity = u8;
using EOF = u8;
// this is just for debugging midi file generation
// I'm testing a known good file against a bad one
// the file is hard coded in file format 0, and if
// you're expecting meta events anywhere add a specific
// call for those
// Only supports format 0
// https://www.music.mcgill.ca/~ich/classes/mumt306/StandardMIDIfileformat.html
enum NoteEvent : u8 {
NoteOn = 0x90,
NoteOff = 0x80
bool g_has_more_messages = true;
bool g_has_more_tracks = true;
fn signed14(s16 n) {
// Converts to 14-bit in range 0..16383. Note that MIDI data bytes
// have their first (most significant) bit clear (0), thus each byte
// is in range 0..127
n = ((n & 0x7f) << 7) | ((n >> 8) & 0x7f);
if (n >= 0) {
n -= 0x2000;
}
return n;
};
enum MetaFlag : u16 {
Footer = 0xFF2F,
KeySigEvent = 0xFF59,
TimeSigEvent = 0xFF58,
TempoEvent = 0xFF51,
TrackNameEvent = 0xFF03
fn u32ify(u32 vlq) {
// Converts from variable-length quantity to u32. These numbers are
// represented 7 bits per byte, most significant bits first. All bytes
// except the last have bit 7 set, and the last byte has bit 7 clear.
// If the number is in range 0..127, it is thus represented exactly
// as one byte.
u32 n = vlq & 0x7f;
if (vlq & 0x8000 == 0x8000) {
n += ((vlq & 0x7f00) >> 8) * 0x80;
}
if (vlq & 0x800000 == 0x800000) {
n += ((vlq & 0x7f0000) >> 8 * 2) * 0x80 * 0x80;
}
if (vlq & 0x80000000 == 0x80000000) {
n += ((vlq & 0x7f000000) >> 8 * 3) * 0x80 * 0x80 * 0x80;
}
return n;
};
enum Status : u8 {
NoteOff = 0x80 ... 0x8F,
NoteOn = 0x90 ... 0x9F,
PolyphonicAfterTouch = 0xA0 ... 0xAF,
ControlChange = 0xB0 ... 0xBF,
ProgramChange = 0xC0 ... 0xCF,
ChannelAfterTouch = 0xD0 ... 0xDF,
PitchWheel = 0xE0 ... 0xEF,
SysEx = 0xF0,
TimeCodeQtrFrame = 0xF1,
SongPositionPointer = 0xF2,
SongSelect = 0xF3,
Undefined = 0xF4 ... 0xF5,
TuneRequest = 0xF6,
EndOfSysEx = 0xF7,
TimingClock = 0xF8,
Undefined = 0xF9,
Start = 0xFA,
Continue = 0xFB,
Stop = 0xFC,
Undefined = 0xFD,
ActiveSensing = 0xFE,
MetaEvent = 0xFF,
};
Status g_next_status;
enum MetaType : u8 {
SequenceNumber = 0x00,
Text = 0x01,
CopyrightNotice = 0x02,
TrackName = 0x03,
InstrumentName = 0x04,
Lyric = 0x05,
Marker = 0x06,
CuePoint = 0x07,
ChannelPrefix = 0x20,
EndOfTrack = 0x2F,
SetTempo = 0x51,
SMPTEOffset = 0x54,
TimeSignature = 0x58,
KeySignature = 0x59,
SequencerSpecific = 0x7F
};
enum ControlChangeType : u8 {
Bank_Select_MSB = 0,
Modulation_Wheel_MSB = 1,
Breath_Controller_MSB = 2,
Undefined_MSB = 3,
Foot_Pedal_MSB = 4,
Portamento_Time_MSB = 5,
Data_Entry_MSB = 6,
Volume_MSB = 7,
Balance_MSB = 8,
Undefined_MSB = 9,
Pan_MSB = 10,
Expression_MSB = 11,
Effect_Controller_1_MSB = 12,
Effect_Controller_2_MSB = 13,
Undefined_MSB = 14,
Undefined_MSB = 15,
General_Purpose_MSB = 16 ... 19,
Undefined_MSB = 20 ... 31,
Bank_Select_LSB = 32,
Modulation_Wheel_LSB = 33,
Breath_Controller_LSB = 34,
Undefined_LSB = 35,
Foot_Pedal_LSB = 36,
Portamento_Time_LSB = 37,
Data_Entry_LSB = 38,
Volume_LSB = 39,
Balance_LSB = 40,
Undefined_LSB = 41,
Pan_LSB = 42,
Expression_LSB = 43,
Effect_Controller_1_LSB = 44,
Effect_Controller_2_LSB = 45,
Undefined_LSB = 46,
Undefined_LSB = 47,
General_Purpose_LSB = 48 ... 51,
Undefined_LSB = 52 ... 63,
Damper_Pedal = 64,
Portamento = 65,
Sostenuto_Pedal = 66,
Soft_Pedal = 67,
Legato_FootSwitch = 68,
Hold_2 = 69,
Sound_Controller_1 = 70,
Sound_Controller_2 = 71,
Sound_Controller_3 = 72,
Sound_Controller_4 = 73,
Sound_Controller_6 = 75,
Sound_Controller_7 = 76,
Sound_Controller_8 = 77,
Sound_Controller_9 = 78,
Sound_Controller_10 = 79,
General_Purpose_CC_Control = 80 ... 83,
Portamento_CC_Control = 84,
Undefined = 85 ... 87,
High_Resolution_Velocity_Prefix = 88,
Effect_2_Depth = 92,
Effect_3_Depth = 93,
Effect_4_Depth = 94,
Effect_5_Depth = 95,
Data_Increment = 96,
Data_Decrement = 97,
Non_Registered_Parameter_Number_LSB = 98,
Non_Registered_Parameter_Number_MSB = 99,
Registered_Parameter_Number_LSB = 100,
Registered_Parameter_Number_MSB = 101,
Undefined = 102 ... 119,
All_Sound_Off = 120,
Reset_All_Controllers = 121,
Local_Switch = 122,
All_Notes_Off = 123,
Omni_Mode_Off = 124,
Omni_Mode_On = 125,
Mono_Mode = 126,
Poly_Mode = 127,
};
enum HeaderFlag : u32 {
MThd = 0x4D546864
};
enum TrackChunk : u32 {
enum TrackFlag : u32 {
MTrk = 0x4D54726B
};
struct TimeSigEvent {
Delta delta;
MetaFlag flag;
u16 numerator;
u8 denominator;
u8 ticks_per_click; // not used
u8 thirty_second_notes_per_crotchet;
struct VariableLengthQuantity<auto name> {
if (std::mem::read_unsigned($, 1) & 0x80 == 0x80) {
if (std::mem::read_unsigned($ + 1, 1) & 0x80 == 0x80) {
if (std::mem::read_unsigned($ + 2, 1) & 0x80 == 0x80) {
u32 value [[format("u32ify"), name(name)]];
} else {
u24 value [[format("u32ify"), name(name)]];
}
} else {
u16 value [[format("u32ify"), name(name)]];
}
} else {
u8 value [[format("u32ify"), name(name)]];
}
};
struct KeySigEvent {
Delta delta;
MetaFlag flag;
u16 key;
u8 mode;
struct MessageData {
match (u8(g_next_status) & 0xf0) {
(Status::NoteOff | Status::NoteOn): {
u8 note_number;
u8 velocity;
}
(Status::PolyphonicAfterTouch): {
u8 note_number;
u8 amount;
}
(Status::ControlChange): {
ControlChangeType cc_number;
u8 value;
}
(Status::ProgramChange): {
u8 program_number;
}
(Status::ChannelAfterTouch): {
u8 amount;
}
(Status::PitchWheel): {
s16 value [[format("signed14")]];
}
}
match (g_next_status) {
(Status::SysEx | Status::EndOfSysEx): {
// "EndOfSysEx" can appear as the last data byte in a
// system exclusive message, or as the starting byte in
// multi-packet messages
VariableLengthQuantity<"sysex_length"> sysex_length [[inline]];
u8 sysex_data[sysex_length.value];
}
(Status::SongPositionPointer): {
u8 lsb;
u8 msb;
}
(Status::SongSelect): {
u8 song_number;
}
(Status::MetaEvent): {
MetaType meta_type;
VariableLengthQuantity<"meta_length"> meta_length [[inline]];
match (meta_type) {
(MetaType::EndOfTrack): {
g_has_more_messages = false;
g_has_more_tracks = std::mem::read_unsigned($, 4) == le u32(TrackFlag::MTrk);
}
(MetaType::Text
| MetaType::CopyrightNotice
| MetaType::TrackName
| MetaType::InstrumentName
| MetaType::Lyric
| MetaType::Marker
| MetaType::CuePoint): {
char text[meta_length.value];
}
(MetaType::TimeSignature): {
u8 numerator;
u8 denominator;
u8 ticks_per_click;
u8 thirty_second_notes_per_crotchet;
}
(MetaType::KeySignature): {
u8 key;
u8 mode;
}
(MetaType::SetTempo): {
u24 micro_seconds_per_click; // default 1 million
}
(_): {
u8 meta_data[meta_length.value];
}
}
}
}
};
struct TempoEvent {
Delta delta;
MetaFlag flag;
u32 micro_seconds_per_click; // default 1 million
};
struct Message {
VariableLengthQuantity<"delta"> delta [[inline]];
struct TrackNameEvent {
Delta delta;
MetaFlag flag;
u8 length;
u8 text;
};
// Status bytes of MIDI channel messages may be omitted if the
// preceding event is a MIDI channel message with the same status
if (std::mem::read_unsigned($, 1) > 0x7f) {
Status status;
g_next_status = status;
}
struct Note {
Delta delta;
NoteEvent ne;
NoteValue note;
Velocity vel;
MessageData data [[inline]];
};
struct HeaderChunk {
@@ -75,21 +281,18 @@ struct HeaderChunk {
u16 mode;
u16 num_tracks;
u16 ticks_per_quarter;
TrackChunk chunk;
u32 track_length;
};
struct Footer {
Delta d;
MetaFlag m;
EOF eof;
struct TrackChunk {
TrackFlag flag;
u32 length;
g_has_more_messages = true;
Message messages[while(g_has_more_messages)];
};
struct MidiFile {
HeaderChunk header;
// whatever meta flags can be in here
Note notes[12]; //however many notes you're looking at
Footer f;
TrackChunk tracks[while(g_has_more_tracks)];
};
MidiFile midi_file @ 0x00;

286
patterns/mp4.hexpat Normal file
View File

@@ -0,0 +1,286 @@
#pragma endian big
#pragma MIME audio/mp4
#pragma MIME video/mp4
#pragma MIME application/mp4
#include <std/io.pat>
#include <std/mem.pat>
#include <std/string.pat>
fn to_string(auto var) {
return str(var);
};
fn format_string(auto string) {
return string.value;
};
struct string {
char value[std::mem::find_sequence_in_range(0, $, std::mem::size(), 0x00) - $];
} [[sealed, format("format_string")]];
struct BaseBox {
u64 boxSize = 0;
u64 startOffset = $;
u64 endOffset = 0;
u32 size;
char type[4];
// Calculate the size of the current box
// 1. If the size is equal to 1 -> the box size is equal to 'largeSize' attribute.
// 2. If the size is equal to 0 -> The box extends to the end of the file.
// 3. Otherwise, size is equaly to the 'size' attribute.
if (this.size == 1) {
u64 largeSize;
boxSize = largeSize;
endOffset = startOffset + boxSize;
} else if (this.size == 0) {
boxSize = std::mem::size() - startOffset;
endOffset = std::mem::size();
} else {
boxSize = size;
endOffset = startOffset + boxSize;
}
if (this.type == "uuid") {
char usertype[16];
}
};
struct FullBox : BaseBox {
u8 version;
u24 flags;
};
struct UnknownBox : BaseBox {
u8 unk[while($ != endOffset)];
};
using brand = u32 [[format("to_string")]];
struct FileTypeBox : BaseBox {
brand major_brand;
u32 minor_version;
brand compatible_brands[(endOffset - $) / sizeof(brand)];
};
struct MovieHeaderBox : FullBox {
if (this.version == 1) {
u64 creation_time;
u64 modification_time;
u32 timescale;
u64 duration;
} else { // version == 0
u32 creation_time;
u32 modification_time;
u32 timescale;
u32 duration;
}
u32 rate [[comment("Fixed point number 16.16")]];
u16 volume [[comment("Fixed point number 8.8")]];
u8 reserved[10] [[sealed]];
u32 matrix[9];
u32 preview_time;
u32 preview_duration;
u32 poster_time;
u32 selection_time;
u32 selection_duration;
u32 current_time;
u32 next_track_id;
};
struct TrackHeaderBox : FullBox {
if (this.version == 1) {
u64 creation_time;
u64 modification_time;
u32 track_id;
u32 reserved;
u64 duration;
} else { // version == 0
u32 creation_time;
u32 modification_time;
u32 track_id;
u32 reserved;
u32 duration;
}
u32 reserved_2[2] [[sealed]];
s16 layer;
s16 alternate_group;
s16 volume;
u16 reserved_3;
s32 matrix[9];
u32 width;
u32 height;
};
struct DataEntryBox : FullBox {
if (std::string::contains(this.type, "url")) {
string location;
} else if (std::string::contains(this.type, "urn")) {
string name;
string location;
} else {
std::error("Invalid DataEntryBox");
}
};
struct DataReferenceBox : FullBox {
u32 entry_count;
DataEntryBox data_entries[this.entry_count];
};
struct SubDataInformationBox {
u32 type = std::mem::read_unsigned($ + 4, 4, std::mem::Endian::Big);
match (str(type)) {
("dref"): DataReferenceBox box [[inline]];
(_): UnknownBox box [[inline]];
}
} [[name(std::format("DataInformationBox({})", box.type))]];
struct DataInformationBox : BaseBox {
SubDataInformationBox box[while($ < endOffset)] [[inline]];
};
struct HandlerBox : FullBox {
u32 component_type;
u32 handler_type;
u32 reserved[3];
char name[endOffset - $];
};
struct VideoMediaHeaderBox : FullBox {
u16 graphicsmode;
u16 opcolor[3];
};
struct SubMediaInformationBox {
u32 type = std::mem::read_unsigned($ + 4, 4, std::mem::Endian::Big);
match (str(type)) {
("vmhd"): VideoMediaHeaderBox box [[inline]];
("hdlr"): HandlerBox box [[inline]];
("dinf"): DataInformationBox box [[inline]];
(_): UnknownBox box [[inline]];
// TODO: Add stbl
}
} [[name(std::format("MediaInformationBox({})", box.type))]];
struct MediaInformationBox : BaseBox {
SubMediaInformationBox box[while($ < endOffset)] [[inline]];
};
struct MediaHeaderBox : FullBox {
if (this.version == 1) {
u64 creation_time;
u64 modification_time;
u32 timescale;
u64 duration;
} else { // version==0
u32 creation_time;
u32 modification_time;
u32 timescale;
u32 duration;
}
u16 language [[comment("ISO-639-2/T language code")]];
u16 quality;
};
struct SubMediaBox {
u32 type = std::mem::read_unsigned($ + 4, 4, std::mem::Endian::Big);
match (str(type)) {
("mdhd"): MediaHeaderBox box [[inline]];
("hdlr"): HandlerBox box [[inline]];
("minf"): MediaInformationBox box [[inline]];
(_): UnknownBox box [[inline]];
}
} [[name(std::format("MediaBox({})", box.type))]];
struct MediaBox : BaseBox {
SubMediaBox box[while($ < endOffset)] [[inline]];
};
struct EditListEntry64 {
u64 segment_duration;
s64 media_time;
s16 media_rate_integer;
s16 media_rate_fraction;
};
struct EditListEntry32 {
u32 segment_duration;
s32 media_time;
s16 media_rate_integer;
s16 media_rate_fraction;
};
struct EditListBox : FullBox {
u32 entry_count;
if (this.version == 1) {
EditListEntry64 entry_list[this.entry_count];
} else { // version 0
EditListEntry32 entry_list[this.entry_count];
}
};
struct SubEditBox {
u32 type = std::mem::read_unsigned($ + 4, 4, std::mem::Endian::Big);
match (str(type)) {
("elst"): EditListBox box [[inline]];
(_): UnknownBox box [[inline]];
}
} [[name(std::format("EditBox({})", box.type))]];
struct EditBox : BaseBox {
SubEditBox box[while($ < endOffset)] [[inline]];
};
struct SubTrackBox {
u32 type = std::mem::read_unsigned($ + 4, 4, std::mem::Endian::Big);
match (str(type)) {
("mdia"): MediaBox box [[inline]];
("edts"): EditBox box [[inline]];
("tkhd"): TrackHeaderBox box [[inline]];
(_): UnknownBox box [[inline]];
}
} [[name(std::format("TrackBox({})", box.type))]];
struct TrackBox : BaseBox {
SubTrackBox box[while($ < endOffset)] [[inline]];
};
struct SubMovieBox {
u32 type = std::mem::read_unsigned($ + 4, 4, std::mem::Endian::Big);
match (str(type)) {
("mvhd"): MovieHeaderBox box [[inline]];
("trak"): TrackBox box [[inline]];
(_): UnknownBox box [[inline]];
// TODO: Add "iods" box
}
} [[name(std::format("MovieBox({})", box.type))]];
struct MovieBox : BaseBox {
SubMovieBox box[while($ < endOffset)] [[inline]];
};
struct MediaDataBox : BaseBox {
u8 data[while($ < endOffset)] [[sealed]];
};
struct Box {
u32 type = std::mem::read_unsigned($ + 4, 4, std::mem::Endian::Big);
match (str(type)) {
("ftyp"): FileTypeBox box [[inline]];
("moov"): MovieBox box [[inline]];
("mdat"): MediaDataBox box [[inline]];
(_): UnknownBox box [[inline]];
}
} [[name(std::format("Box({})", box.type))]];
Box mp4[while(!std::mem::eof())] @ 0x0;

View File

@@ -77,7 +77,7 @@ struct Length {
u8 length;
} [[sealed, transform("transform_length"), format("transform_length")]];
fn transform_length(Length length) {
fn transform_length(ref auto length) {
return length.length;
};

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,8 @@
#pragma MIME image/png
#pragma endian big
#include <std/mem.pat>
struct header_t {
u8 highBitByte;
char signature[3];
@@ -178,6 +180,7 @@ struct chunk_set {
chunk_t chunks[while(builtin::std::mem::read_string($ + 4, 4) != "IEND")] [[inline]];
} [[inline]];
u8 visualizer[std::mem::size()] @ 0x00 [[sealed, hex::visualize("image", this)]];
header_t header @ 0x00 [[comment("PNG file signature"), name("Signature")]];
chunk_t ihdr_chunk @ 0x08 [[comment("PNG Header chunk"), name("IHDR")]];
chunk_set set @ $ [[comment("PNG Chunks"), name("Chunks"), inline]];

View File

@@ -75,5 +75,6 @@ struct Footer {
char zero;
};
u8 visualizer[std::mem::size()] @ 0x00 [[sealed, hex::visualize("image", this)]];
Header header @ 0x0;
Footer footer @ std::mem::size() - 0x1A;

318
patterns/tiff.hexpat Normal file
View File

@@ -0,0 +1,318 @@
#pragma MIME image/tiff
#pragma eval_depth 100
#include <std/io.pat>
#include <std/mem.pat>
#include <std/string.pat>
#include <std/core.pat>
#define BIG 1
#define LITTLE 2
u32 stripCount = 0;
s32 current_strip = 0;
fn get_next_strip_index(){
if (current_strip <= stripCount) {
current_strip = current_strip + 1;
return current_strip - 1;
} else {
return stripCount+1;
}
};
fn reset_counter_strip(){
current_strip = 0;
stripCount = 0;
};
fn start_counter_strip(u32 total){
current_strip = 0;
stripCount = total;
};
fn set_endian(str magic) {
if (std::string::starts_with(magic, "II")) {
std::core::set_endian(std::mem::Endian::Little);
} else if (std::string::starts_with(magic, "MM")) {
std::core::set_endian(std::mem::Endian::Big);
}
};
fn get_total_IFDs(u32 first_offset){
u32 ifd_count = 0;
u32 current_offset = first_offset;
while (current_offset != 0) {
u16 ifd_entries_count = std::mem::read_unsigned(current_offset, 2, std::core::get_endian());
current_offset = std::mem::read_unsigned(current_offset + 2 + ifd_entries_count * 12, 4, std::core::get_endian());
ifd_count = ifd_count + 1;
}
return ifd_count;
};
fn get_ifds_offsets(u32 first_offset) {
u32 total_ifds = get_total_IFDs(first_offset);
u32 index = 0;
u32 current_offset = first_offset;
u32 ifd_offsets[total_ifds];
while (current_offset != 0) {
ifd_offsets[index] = current_offset;
u16 ifd_entries_count = std::mem::read_unsigned(current_offset, 2, std::core::get_endian());
current_offset = std::mem::read_unsigned(current_offset + 2 + ifd_entries_count * 12, 4, std::core::get_endian());
index = index + 1;
}
return ifd_offsets;
};
using TIFFFieldType;
using TIFFTag;
fn get_entry_value(u32 offset, TIFFTag Tag){
u16 count = std::mem::read_unsigned(offset, 2, std::core::get_endian());
u8 step = 12;
offset = offset + 2;
while (count != 0) {
if (std::mem::read_unsigned(offset, 2, std::core::get_endian()) == Tag) {
if (std::mem::read_unsigned(offset + 2, 2, std::core::get_endian()) == TIFFFieldType::SHORT) {
return std::mem::read_unsigned(offset + 8, 2, std::core::get_endian());
} else if (std::mem::read_unsigned(offset + 2, 2, std::core::get_endian()) == TIFFFieldType::LONG) {
return std::mem::read_unsigned(offset + 8, 4, std::core::get_endian());
}
}
count = count - 1;
offset = offset + step;
}
};
struct TIFFHeader {
char Magic[2];
set_endian(Magic);
u16 Version;
u32 Offset;
};
enum TIFFFieldType : u16 {
BYTE = 1,
ASCII = 2,
SHORT = 3,
LONG = 4,
RATIONAL = 5,
SBYTE = 6,
UNDEFINED = 7,
SSHORT = 8,
SLONG = 9,
SRATIONAL = 10,
FLOAT = 11,
DOUBLE = 12
};
enum TIFFTag : u16 {
NewSubfileType = 0x00FE,
SubfileType = 0x00FF,
ImageWidth = 0x0100,
ImageLength = 0x0101,
BitsPerSample = 0x0102,
Compression = 0x0103,
PhotometricInterpretation = 0x0106,
Threshholding = 0x0107,
CellWidth = 0x0108,
CellLength = 0x0109,
FillOrder = 0x010A,
DocumentName = 0x010D,
ImageDescription = 0x010E,
Make = 0x010F,
Model = 0x0110,
StripOffsets = 0x0111,
Orientation = 0x0112,
SamplesPerPixel = 0x0115,
RowsPerStrip = 0x0116,
StripByteCounts = 0x0117,
MinSampleValue = 0x0118,
MaxSampleValue = 0x0119,
XResolution = 0x011A,
YResolution = 0x011B,
PlanarConfiguration = 0x011C,
PageName = 0x011D,
XPosition = 0x011E,
YPosition = 0x011F,
FreeOffsets = 0x0120,
FreeByteCounts = 0x0121,
GrayResponseUnit = 0x0122,
GrayResponseCurve = 0x0123,
T4Options = 0x0124,
T6Options = 0x0125,
ResolutionUnit = 0x0128,
PageNumber = 0x0129,
TransferFunction = 0x012D,
Software = 0x0131,
DateTime = 0x0132,
Artist = 0x013B,
HostComputer = 0x013C,
Predictor = 0x013D,
WhitePoint = 0x013E,
PrimaryChromaticities = 0x013F,
ColorMap = 0x0140,
HalftoneHints = 0x0141,
TileWidth = 0x0142,
TileLength = 0x0143,
TileOffsets = 0x0144,
TileByteCounts = 0x0145,
InkSet = 0x014C,
InkNames = 0x014D,
NumberOfInks = 0x014E,
DotRange = 0x0150,
TargetPrinter = 0x0151,
ExtraSamples = 0x0152,
SampleFormat = 0x0153,
SMinSampleValue = 0x0154,
SMaxSampleValue = 0x0155,
TransferRange = 0x0156,
JPEGProc = 0x0200,
JPEGInterchangeFormat = 0x0201,
JPEGInterchangeFormatLngth = 0x0202,
JPEGRestartInterval = 0x0203,
JPEGLosslessPredictors = 0x0205,
JPEGPointTransforms = 0x0206,
JPEGQTables = 0x0207,
JPEGDCTables = 0x0208,
JPEGACTables = 0x0209,
YCbCrCoefficients = 0x0211,
YCbCrSubSampling = 0x0212,
YCbCrPositioning = 0x0213,
ReferenceBlackWhite = 0x0214,
Copyright = 0x8298,
InterColorProfile = 0x8773
};
struct IFDEntry {
TIFFTag Tag;
TIFFFieldType Type;
u32 Count;
match (Type) {
(TIFFFieldType::BYTE): {
if (std::core::get_endian() == BIG){
u8 Value;
padding[3];
} else {
u32 Value;
}
}
(TIFFFieldType::ASCII): {
u32 value_offset[[hidden]];
char Value[Count] @ value_offset;
}
(TIFFFieldType::SHORT): {
if (std::core::get_endian() == BIG){
u16 Value;
padding[2];
} else {
u32 Value;
}
}
(TIFFFieldType::LONG): u32 Value;
(TIFFFieldType::RATIONAL): {
u32 value_offset[[hidden]];
u32 Numerator @ value_offset;
u32 Denominator @ value_offset + 4;
}
(TIFFFieldType::SBYTE): {
if (std::core::get_endian() == BIG){
s8 Value;
padding[3];
} else {
s32 Value;
}
}
(TIFFFieldType::UNDEFINED): {
u32 value_offset[[hidden]];
u8 Value[Count] @ value_offset;
}
(TIFFFieldType::SSHORT): {
if (std::core::get_endian() == BIG){
s16 Value;
padding[2];
} else {
s32 Value;
}
}
(TIFFFieldType::SLONG): s32 Value;
(TIFFFieldType::SRATIONAL): {
u32 value_offset[[hidden]];
s32 Numerator @ value_offset;
s32 Denominator @ value_offset + 4;
}
(TIFFFieldType::FLOAT): float Value;
(TIFFFieldType::DOUBLE): {
u32 value_offset[[hidden]];
double Value @ value_offset;
}
(_): {
padding[4];
std::print("TIFFFieldType not supported");
}
}
};
struct StripList {
u16 entry_count [[hidden]];
u32 ImageLength = get_entry_value(addressof(this), TIFFTag::ImageLength);
u32 RowsPerStrip = get_entry_value(addressof(this), TIFFTag::RowsPerStrip);
u32 StripByteCounts = get_entry_value(addressof(this), TIFFTag::StripByteCounts);
u32 StripOffsets = get_entry_value(addressof(this), TIFFTag::StripOffsets);
s32 next_strip_index = get_next_strip_index();
if ((ImageLength/RowsPerStrip) > 1) {
u32 StripOffsetsArray[ImageLength/RowsPerStrip] @ StripOffsets [[hidden]];
u32 StripByteCountsArray[ImageLength/RowsPerStrip] @ StripByteCounts [[hidden]];
u8 Strip[StripByteCountsArray[next_strip_index]] @ StripOffsetsArray[next_strip_index];
} else {
u8 Strip[StripByteCounts] @ StripOffsets;
}
if (current_strip < stripCount) {
StripList strips @ addressof(this);
} else {
reset_counter_strip();
break;
}
}[[inline]];
struct IFD {
u16 NumberDirectoryEntries;
IFDEntry DirectoryEntry[NumberDirectoryEntries];
u32 NextIFD;
u32 ImageLength = get_entry_value(addressof(this), TIFFTag::ImageLength);
u32 RowsPerStrip = get_entry_value(addressof(this), TIFFTag::RowsPerStrip);
u32 StripByteCounts = get_entry_value(addressof(this), TIFFTag::StripByteCounts);
u32 StripOffsets = get_entry_value(addressof(this), TIFFTag::StripOffsets);
u32 StripOffsetsArray[ImageLength/RowsPerStrip] @ StripOffsets;
u32 StripByteCountsArray[ImageLength/RowsPerStrip] @ StripByteCounts;
start_counter_strip(ImageLength/RowsPerStrip);
StripList ImageData[] @ addressof(this);
};
struct IFDS {
IFD IFD;
if (IFD.NextIFD > 0) {
IFDS IFD_tmp @ IFD.NextIFD;
}else {
break;
}
}[[inline]];
struct TIFFFile {
TIFFHeader Header;
set_endian(Header.Magic);
u32 total_ifds = get_total_IFDs(Header.Offset);
IFDS IFDs[total_ifds] @ Header.Offset;
};
TIFFFile File @ 0x00;

View File

@@ -1,3 +1,4 @@
#pragma MIME audio/x-wav
#pragma MIME audio/wav
#include <std/mem.pat>

View File

@@ -51,16 +51,8 @@ int main(int argc, char **argv) {
runtime.addPragma("pattern_limit", DummyPragmaHandler);
runtime.addDefine("__PL_UNIT_TESTS__");
}
// Execute pattern
if (!runtime.executeString(patternFile.readString())) {
fmt::print("Error during execution!\n");
if (const auto &hardError = runtime.getError(); hardError.has_value())
fmt::print("Hard error: {}:{} - {}\n\n", hardError->line, hardError->column, hardError->message);
for (const auto &[level, message] : runtime.getConsoleLog()) {
runtime.setLogCallback([](auto level, const std::string &message) {
switch (level) {
using enum pl::core::LogConsole::Level;
case Debug: fmt::print(" [DEBUG] "); break;
@@ -70,7 +62,15 @@ int main(int argc, char **argv) {
}
fmt::print("{}\n", message);
}
});
}
// Execute pattern
if (!runtime.executeString(patternFile.readString())) {
fmt::print("Error during execution!\n");
if (const auto &hardError = runtime.getError(); hardError.has_value())
fmt::print("Hard error: {}:{} - {}\n\n", hardError->line, hardError->column, hardError->message);
return EXIT_FAILURE;
}

View File

@@ -52,16 +52,8 @@ int main(int argc, char **argv) {
runtime.setIncludePaths({ includePath });
runtime.addPragma("MIME", DummyPragmaHandler);
runtime.addDefine("__PL_UNIT_TESTS__");
}
// Execute pattern
if (!runtime.executeString(patternFile.readString())) {
fmt::print("Error during execution!\n");
if (const auto &hardError = runtime.getError(); hardError.has_value())
fmt::print("Hard error: {}:{} - {}\n\n", hardError->line, hardError->column, hardError->message);
for (const auto &[level, message] : runtime.getConsoleLog()) {
runtime.setLogCallback([](auto level, const std::string &message) {
switch (level) {
using enum pl::core::LogConsole::Level;
case Debug: fmt::print(" [DEBUG] "); break;
@@ -71,7 +63,16 @@ int main(int argc, char **argv) {
}
fmt::print("{}\n", message);
}
});
}
// Execute pattern
if (!runtime.executeString(patternFile.readString())) {
fmt::print("Error during execution!\n");
if (const auto &hardError = runtime.getError(); hardError.has_value())
fmt::print("Hard error: {}:{} - {}\n\n", hardError->line, hardError->column, hardError->message);
return EXIT_FAILURE;
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,312 @@
{
"base": "Dark",
"colors": {
"imgui": {
"border": "#A5ADCEFF",
"border-shadow": "#B5BFE2FF",
"button": "#8CAAEE7F",
"button-active": "#BABBF1FF",
"button-hovered": "#99D1DB7F",
"check-mark": "#8CAAEEFF",
"child-background": "#292C3CFF",
"docking-empty-background": "#303446FF",
"docking-preview": "#99D1DBFF",
"drag-drop-target": "#85C1DCFF",
"frame-background": "#303446FF",
"frame-background-active": "#BABBF1FF",
"frame-background-hovered": "#99D1DB7F",
"header": "#85C1DC7F",
"header-active": "#BABBF17F",
"header-hovered": "#99D1DB7F",
"menu-bar-background": "#303446FF",
"modal-window-dim-background": "#B5BFE27F",
"nav-highlight": "#BABBF1FF",
"nav-windowing-background": "#C6D0F5FF",
"nav-windowing-highlight": "#737994FF",
"plot-histogram": "#E5C890FF",
"plot-histogram-hovered": "#EF9F767F",
"plot-lines": "#A5ADCEFF",
"plot-lines-hovered": "#F4B8E47F",
"popup-background": "#303446FF",
"resize-grip": "#838BA7FF",
"resize-grip-active": "#BABBF1FF",
"resize-grip-hovered": "#99D1DB7F",
"scrollbar-background": "#303446FF",
"scrollbar-grab": "#838BA7FF",
"scrollbar-grab-active": "#BABBF1FF",
"scrollbar-grab-hovered": "#99D1DB7F",
"separator": "#838BA7FF",
"separator-active": "#BABBF1FF",
"separator-hovered": "#99D1DB7F",
"slider-grab": "#737994FF",
"slider-grab-active": "#BABBF1FF",
"tab": "#737994FF",
"tab-active": "#BABBF17F",
"tab-hovered": "#99D1DB7F",
"tab-unfocused": "#838BA77F",
"tab-unfocused-active": "#7379947F",
"table-border-light": "#838BA7FF",
"table-border-strong": "#949CBBFF",
"table-header-background": "#737994FF",
"table-row-background": "#292C3CFF",
"table-row-background-alt": "#232634FF",
"text": "#C6D0F5FF",
"text-disabled": "#838BA7FF",
"text-selected-background": "#6268807F",
"title-background": "#292C3CFF",
"title-background-active": "#292C3CFF",
"title-background-collapse": "#292C3CFF",
"window-background": "#303446FF"
},
"imhex": {
"desc-button": "#51576DFF",
"desc-button-active": "#BABBF1FF",
"desc-button-hovered": "#99D1DB7F",
"highlight": "#A6D189FF",
"toolbar-blue": "#8CAAEEFF",
"toolbar-brown": "#F2D5CFFF",
"toolbar-gray": "#838BA7FF",
"toolbar-green": "#A6D189FF",
"toolbar-purple": "#CA9EE6FF",
"toolbar-red": "#E78284FF",
"toolbar-yellow": "#E5C890FF"
},
"imnodes": {
"box-selector": "#8CAAEEFF",
"box-selector-outline": "#8CAAEE7F",
"grid-background": "#292C3CFF",
"grid-line": "#949CBBFF",
"grid-line-primary": "#838BA7FF",
"link": "#8CAAEEFF",
"link-hovered": "#99D1DBFF",
"link-selected": "#BABBF1FF",
"mini-map-background": "#C6D0F57F",
"mini-map-background-hovered": "#B5BFE27F",
"mini-map-canvas": "#51576D7F",
"mini-map-canvas-outline": "#4145597F",
"mini-map-link": "#8CAAEEFF",
"mini-map-link-selected": "#BABBF1FF",
"mini-map-node-background": "#6268807F",
"mini-map-node-background-hovered": "#4145597F",
"mini-map-node-background-selected": "#BABBF1FF",
"mini-map-node-outline": "#838BA7FF",
"mini-map-outline": "#838BA77F",
"mini-map-outline-hovered": "#B5BFE27F",
"node-background": "#737994FF",
"node-background-hovered": "#99D1DB7F",
"node-background-selected": "#BABBF1FF",
"node-outline": "#737994FF",
"pin": "#8CAAEE7F",
"pin-hovered": "#99D1DB7F",
"title-bar": "#414559FF",
"title-bar-hovered": "#99D1DB7F",
"title-bar-selected": "#BABBF1FF"
},
"implot": {
"axis-bg": "#C6D0F521",
"axis-bg-active": "#B5BFE27F",
"axis-bg-hovered": "#A5ADCE7F",
"axis-grid": "#303446FF",
"axis-text": "#00000000",
"axis-tick": "#B5BFE27F",
"crosshairs": "#C6D0F57F",
"error-bar": "#00000000",
"fill": "#00000000",
"frame-bg": "#303446FF",
"inlay-text": "#C6D0F5FF",
"legend-bg": "#737994FF",
"legend-border": "#838BA7FF",
"legend-text": "#C6D0F5FF",
"line": "#00000000",
"marker-fill": "#00000000",
"marker-outline": "#00000000",
"plot-bg": "#8CAAEE21",
"plot-border": "#00000000",
"selection": "#6268807F",
"title-text": "#C6D0F5FF"
},
"text-editor": {
"background": "#303446FF",
"breakpoint": "#E78284FF",
"char-literal": "#A6D189FF",
"comment": "#737994FF",
"current-line-edge": "#838BA77F",
"current-line-fill": "#838BA77F",
"current-line-fill-inactive": "#7379947F",
"cursor": "#F2D5CFFF",
"default": "#838BA7FF",
"error-marker": "#E782847F",
"identifier": "#949CBBFF",
"keyword": "#CA9EE6FF",
"known-identifier": "#E78284FF",
"line-number": "#838BA7FF",
"multi-line-comment": "#737994FF",
"number": "#EF9F76FF",
"preproc-identifier": "#BABBF1FF",
"preprocessor": "#A5ADCEFF",
"punctuation": "#C6D0F5FF",
"selection": "#6268807F",
"string": "#A6D189FF"
}
},
"image_postfix": "_dark",
"name": "Catppuccin Frappe",
"styles": {
"imgui": {
"alpha": 1.0,
"button-text-align": [
0.5,
0.5
],
"cell-padding": [
4.0,
2.0
],
"child-border-size": 1.0,
"child-rounding": 0.0,
"disabled-alpha": 0.6000000238418579,
"frame-border-size": 0.0,
"frame-padding": [
4.0,
3.0
],
"frame-rounding": 0.0,
"grab-min-size": 12.0,
"grab-rounding": 0.0,
"indent-spacing": 10.0,
"item-inner-spacing": [
4.0,
4.0
],
"item-spacing": [
8.0,
4.0
],
"popup-border-size": 1.0,
"popup-rounding": 0.0,
"scrollbar-rounding": 9.0,
"scrollbar-size": 14.0,
"selectable-text-align": [
0.0,
0.0
],
"tab-rounding": 4.0,
"window-border-size": 1.0,
"window-min-size": [
32.0,
32.0
],
"window-padding": [
8.0,
8.0
],
"window-rounding": 0.0,
"window-title-align": [
0.0,
0.5
]
},
"imnodes": {
"grid-spacing": 24.0,
"link-hover-distance": 10.0,
"link-line-segments-per-length": 0.10000000149011612,
"link-thickness": 3.0,
"mini-map-offset": [
4.0,
4.0
],
"mini-map-padding": [
8.0,
8.0
],
"node-border-thickness": 1.0,
"node-corner-rounding": 4.0,
"node-padding": [
8.0,
8.0
],
"pin-circle-radius": 4.0,
"pin-hover-radius": 10.0,
"pin-line-thickness": 1.0,
"pin-offset": 0.0,
"pin-quad-side-length": 7.0,
"pin-triangle-side-length": 9.5
},
"implot": {
"annotation-padding": [
2.0,
2.0
],
"digital-bit-gap": 4.0,
"digital-bit-height": 8.0,
"error-bar-size": 5.0,
"error-bar-weight": 1.5,
"fill-alpha": 1.0,
"fit-padding": [
0.0,
0.0
],
"label-padding": [
5.0,
5.0
],
"legend-inner-padding": [
5.0,
5.0
],
"legend-padding": [
10.0,
10.0
],
"legend-spacing": [
5.0,
0.0
],
"line-weight": 1.0,
"major-grid-size": [
1.0,
1.0
],
"major-tick-len": [
10.0,
10.0
],
"major-tick-size": [
1.0,
1.0
],
"marker-size": 4.0,
"marker-weight": 1.0,
"minor-alpha": 0.25,
"minor-grid-size": [
1.0,
1.0
],
"minor-tick-len": [
5.0,
5.0
],
"minor-tick-size": [
1.0,
1.0
],
"mouse-pos-padding": [
10.0,
10.0
],
"plot-border-size": 1.0,
"plot-default-size": [
400.0,
300.0
],
"plot-min-size": [
200.0,
150.0
],
"plot-padding": [
10.0,
10.0
]
}
}
}

View File

@@ -0,0 +1,312 @@
{
"base": "Light",
"colors": {
"imgui": {
"border": "#6C6F85FF",
"border-shadow": "#5C5F77FF",
"button": "#1E66F57F",
"button-active": "#7287FDFF",
"button-hovered": "#04A5E57F",
"check-mark": "#1E66F5FF",
"child-background": "#E6E9EFFF",
"docking-empty-background": "#EFF1F5FF",
"docking-preview": "#04A5E5FF",
"drag-drop-target": "#209FB5FF",
"frame-background": "#EFF1F5FF",
"frame-background-active": "#7287FDFF",
"frame-background-hovered": "#04A5E57F",
"header": "#209FB57F",
"header-active": "#7287FD7F",
"header-hovered": "#04A5E57F",
"menu-bar-background": "#EFF1F5FF",
"modal-window-dim-background": "#5C5F777F",
"nav-highlight": "#7287FDFF",
"nav-windowing-background": "#4C4F69FF",
"nav-windowing-highlight": "#9CA0B0FF",
"plot-histogram": "#DF8E1DFF",
"plot-histogram-hovered": "#FE640B7F",
"plot-lines": "#6C6F85FF",
"plot-lines-hovered": "#EA76CB7F",
"popup-background": "#EFF1F5FF",
"resize-grip": "#8C8FA1FF",
"resize-grip-active": "#7287FDFF",
"resize-grip-hovered": "#04A5E57F",
"scrollbar-background": "#EFF1F5FF",
"scrollbar-grab": "#8C8FA1FF",
"scrollbar-grab-active": "#7287FDFF",
"scrollbar-grab-hovered": "#04A5E57F",
"separator": "#8C8FA1FF",
"separator-active": "#7287FDFF",
"separator-hovered": "#04A5E57F",
"slider-grab": "#9CA0B0FF",
"slider-grab-active": "#7287FDFF",
"tab": "#9CA0B0FF",
"tab-active": "#7287FD7F",
"tab-hovered": "#04A5E57F",
"tab-unfocused": "#8C8FA17F",
"tab-unfocused-active": "#9CA0B07F",
"table-border-light": "#8C8FA1FF",
"table-border-strong": "#7C7F93FF",
"table-header-background": "#9CA0B0FF",
"table-row-background": "#E6E9EFFF",
"table-row-background-alt": "#DCE0E8FF",
"text": "#4C4F69FF",
"text-disabled": "#8C8FA1FF",
"text-selected-background": "#ACB0BE7F",
"title-background": "#E6E9EFFF",
"title-background-active": "#E6E9EFFF",
"title-background-collapse": "#E6E9EFFF",
"window-background": "#EFF1F5FF"
},
"imhex": {
"desc-button": "#BCC0CCFF",
"desc-button-active": "#7287FDFF",
"desc-button-hovered": "#04A5E57F",
"highlight": "#40A02BFF",
"toolbar-blue": "#1E66F5FF",
"toolbar-brown": "#DC8A78FF",
"toolbar-gray": "#8C8FA1FF",
"toolbar-green": "#40A02BFF",
"toolbar-purple": "#8839EFFF",
"toolbar-red": "#D20F39FF",
"toolbar-yellow": "#DF8E1DFF"
},
"imnodes": {
"box-selector": "#1E66F5FF",
"box-selector-outline": "#1E66F57F",
"grid-background": "#E6E9EFFF",
"grid-line": "#7C7F93FF",
"grid-line-primary": "#8C8FA1FF",
"link": "#1E66F5FF",
"link-hovered": "#04A5E5FF",
"link-selected": "#7287FDFF",
"mini-map-background": "#4C4F697F",
"mini-map-background-hovered": "#5C5F777F",
"mini-map-canvas": "#BCC0CC7F",
"mini-map-canvas-outline": "#CCD0DA7F",
"mini-map-link": "#1E66F5FF",
"mini-map-link-selected": "#7287FDFF",
"mini-map-node-background": "#ACB0BE7F",
"mini-map-node-background-hovered": "#CCD0DA7F",
"mini-map-node-background-selected": "#7287FDFF",
"mini-map-node-outline": "#8C8FA1FF",
"mini-map-outline": "#8C8FA17F",
"mini-map-outline-hovered": "#5C5F777F",
"node-background": "#9CA0B0FF",
"node-background-hovered": "#04A5E57F",
"node-background-selected": "#7287FDFF",
"node-outline": "#9CA0B0FF",
"pin": "#1E66F57F",
"pin-hovered": "#04A5E57F",
"title-bar": "#CCD0DAFF",
"title-bar-hovered": "#04A5E57F",
"title-bar-selected": "#7287FDFF"
},
"implot": {
"axis-bg": "#4C4F6921",
"axis-bg-active": "#5C5F777F",
"axis-bg-hovered": "#6C6F857F",
"axis-grid": "#EFF1F5FF",
"axis-text": "#00000000",
"axis-tick": "#5C5F777F",
"crosshairs": "#4C4F697F",
"error-bar": "#00000000",
"fill": "#00000000",
"frame-bg": "#EFF1F5FF",
"inlay-text": "#4C4F69FF",
"legend-bg": "#9CA0B0FF",
"legend-border": "#8C8FA1FF",
"legend-text": "#4C4F69FF",
"line": "#00000000",
"marker-fill": "#00000000",
"marker-outline": "#00000000",
"plot-bg": "#1E66F521",
"plot-border": "#00000000",
"selection": "#ACB0BE7F",
"title-text": "#4C4F69FF"
},
"text-editor": {
"background": "#EFF1F5FF",
"breakpoint": "#D20F39FF",
"char-literal": "#40A02BFF",
"comment": "#9CA0B0FF",
"current-line-edge": "#8C8FA17F",
"current-line-fill": "#8C8FA17F",
"current-line-fill-inactive": "#9CA0B07F",
"cursor": "#DC8A78FF",
"default": "#8C8FA1FF",
"error-marker": "#D20F397F",
"identifier": "#7C7F93FF",
"keyword": "#8839EFFF",
"known-identifier": "#D20F39FF",
"line-number": "#8C8FA1FF",
"multi-line-comment": "#9CA0B0FF",
"number": "#FE640BFF",
"preproc-identifier": "#7287FDFF",
"preprocessor": "#6C6F85FF",
"punctuation": "#4C4F69FF",
"selection": "#ACB0BE7F",
"string": "#40A02BFF"
}
},
"image_postfix": "_light",
"name": "Catppuccin Latte",
"styles": {
"imgui": {
"alpha": 1.0,
"button-text-align": [
0.5,
0.5
],
"cell-padding": [
4.0,
2.0
],
"child-border-size": 1.0,
"child-rounding": 0.0,
"disabled-alpha": 0.6000000238418579,
"frame-border-size": 0.0,
"frame-padding": [
4.0,
3.0
],
"frame-rounding": 0.0,
"grab-min-size": 12.0,
"grab-rounding": 0.0,
"indent-spacing": 10.0,
"item-inner-spacing": [
4.0,
4.0
],
"item-spacing": [
8.0,
4.0
],
"popup-border-size": 1.0,
"popup-rounding": 0.0,
"scrollbar-rounding": 9.0,
"scrollbar-size": 14.0,
"selectable-text-align": [
0.0,
0.0
],
"tab-rounding": 4.0,
"window-border-size": 1.0,
"window-min-size": [
32.0,
32.0
],
"window-padding": [
8.0,
8.0
],
"window-rounding": 0.0,
"window-title-align": [
0.0,
0.5
]
},
"imnodes": {
"grid-spacing": 24.0,
"link-hover-distance": 10.0,
"link-line-segments-per-length": 0.10000000149011612,
"link-thickness": 3.0,
"mini-map-offset": [
4.0,
4.0
],
"mini-map-padding": [
8.0,
8.0
],
"node-border-thickness": 1.0,
"node-corner-rounding": 4.0,
"node-padding": [
8.0,
8.0
],
"pin-circle-radius": 4.0,
"pin-hover-radius": 10.0,
"pin-line-thickness": 1.0,
"pin-offset": 0.0,
"pin-quad-side-length": 7.0,
"pin-triangle-side-length": 9.5
},
"implot": {
"annotation-padding": [
2.0,
2.0
],
"digital-bit-gap": 4.0,
"digital-bit-height": 8.0,
"error-bar-size": 5.0,
"error-bar-weight": 1.5,
"fill-alpha": 1.0,
"fit-padding": [
0.0,
0.0
],
"label-padding": [
5.0,
5.0
],
"legend-inner-padding": [
5.0,
5.0
],
"legend-padding": [
10.0,
10.0
],
"legend-spacing": [
5.0,
0.0
],
"line-weight": 1.0,
"major-grid-size": [
1.0,
1.0
],
"major-tick-len": [
10.0,
10.0
],
"major-tick-size": [
1.0,
1.0
],
"marker-size": 4.0,
"marker-weight": 1.0,
"minor-alpha": 0.25,
"minor-grid-size": [
1.0,
1.0
],
"minor-tick-len": [
5.0,
5.0
],
"minor-tick-size": [
1.0,
1.0
],
"mouse-pos-padding": [
10.0,
10.0
],
"plot-border-size": 1.0,
"plot-default-size": [
400.0,
300.0
],
"plot-min-size": [
200.0,
150.0
],
"plot-padding": [
10.0,
10.0
]
}
}
}

View File

@@ -0,0 +1,312 @@
{
"base": "Dark",
"colors": {
"imgui": {
"border": "#A5ADCBFF",
"border-shadow": "#B8C0E0FF",
"button": "#8AADF47F",
"button-active": "#B7BDF8FF",
"button-hovered": "#91D7E37F",
"check-mark": "#8AADF4FF",
"child-background": "#1E2030FF",
"docking-empty-background": "#24273AFF",
"docking-preview": "#91D7E3FF",
"drag-drop-target": "#7DC4E4FF",
"frame-background": "#24273AFF",
"frame-background-active": "#B7BDF8FF",
"frame-background-hovered": "#91D7E37F",
"header": "#7DC4E47F",
"header-active": "#B7BDF87F",
"header-hovered": "#91D7E37F",
"menu-bar-background": "#24273AFF",
"modal-window-dim-background": "#B8C0E07F",
"nav-highlight": "#B7BDF8FF",
"nav-windowing-background": "#CAD3F5FF",
"nav-windowing-highlight": "#6E738DFF",
"plot-histogram": "#EED49FFF",
"plot-histogram-hovered": "#F5A97F7F",
"plot-lines": "#A5ADCBFF",
"plot-lines-hovered": "#F5BDE67F",
"popup-background": "#24273AFF",
"resize-grip": "#8087A2FF",
"resize-grip-active": "#B7BDF8FF",
"resize-grip-hovered": "#91D7E37F",
"scrollbar-background": "#24273AFF",
"scrollbar-grab": "#8087A2FF",
"scrollbar-grab-active": "#B7BDF8FF",
"scrollbar-grab-hovered": "#91D7E37F",
"separator": "#8087A2FF",
"separator-active": "#B7BDF8FF",
"separator-hovered": "#91D7E37F",
"slider-grab": "#6E738DFF",
"slider-grab-active": "#B7BDF8FF",
"tab": "#6E738DFF",
"tab-active": "#B7BDF87F",
"tab-hovered": "#91D7E37F",
"tab-unfocused": "#8087A27F",
"tab-unfocused-active": "#6E738D7F",
"table-border-light": "#8087A2FF",
"table-border-strong": "#939AB7FF",
"table-header-background": "#6E738DFF",
"table-row-background": "#1E2030FF",
"table-row-background-alt": "#181926FF",
"text": "#CAD3F5FF",
"text-disabled": "#8087A2FF",
"text-selected-background": "#5B60787F",
"title-background": "#1E2030FF",
"title-background-active": "#1E2030FF",
"title-background-collapse": "#1E2030FF",
"window-background": "#24273AFF"
},
"imhex": {
"desc-button": "#494D64FF",
"desc-button-active": "#B7BDF8FF",
"desc-button-hovered": "#91D7E37F",
"highlight": "#A6DA95FF",
"toolbar-blue": "#8AADF4FF",
"toolbar-brown": "#F4DBD6FF",
"toolbar-gray": "#8087A2FF",
"toolbar-green": "#A6DA95FF",
"toolbar-purple": "#C6A0F6FF",
"toolbar-red": "#ED8796FF",
"toolbar-yellow": "#EED49FFF"
},
"imnodes": {
"box-selector": "#8AADF4FF",
"box-selector-outline": "#8AADF47F",
"grid-background": "#1E2030FF",
"grid-line": "#939AB7FF",
"grid-line-primary": "#8087A2FF",
"link": "#8AADF4FF",
"link-hovered": "#91D7E3FF",
"link-selected": "#B7BDF8FF",
"mini-map-background": "#CAD3F57F",
"mini-map-background-hovered": "#B8C0E07F",
"mini-map-canvas": "#494D647F",
"mini-map-canvas-outline": "#363A4F7F",
"mini-map-link": "#8AADF4FF",
"mini-map-link-selected": "#B7BDF8FF",
"mini-map-node-background": "#5B60787F",
"mini-map-node-background-hovered": "#363A4F7F",
"mini-map-node-background-selected": "#B7BDF8FF",
"mini-map-node-outline": "#8087A2FF",
"mini-map-outline": "#8087A27F",
"mini-map-outline-hovered": "#B8C0E07F",
"node-background": "#6E738DFF",
"node-background-hovered": "#91D7E37F",
"node-background-selected": "#B7BDF8FF",
"node-outline": "#6E738DFF",
"pin": "#8AADF47F",
"pin-hovered": "#91D7E37F",
"title-bar": "#363A4FFF",
"title-bar-hovered": "#91D7E37F",
"title-bar-selected": "#B7BDF8FF"
},
"implot": {
"axis-bg": "#CAD3F521",
"axis-bg-active": "#B8C0E07F",
"axis-bg-hovered": "#A5ADCB7F",
"axis-grid": "#24273AFF",
"axis-text": "#00000000",
"axis-tick": "#B8C0E07F",
"crosshairs": "#CAD3F57F",
"error-bar": "#00000000",
"fill": "#00000000",
"frame-bg": "#24273AFF",
"inlay-text": "#CAD3F5FF",
"legend-bg": "#6E738DFF",
"legend-border": "#8087A2FF",
"legend-text": "#CAD3F5FF",
"line": "#00000000",
"marker-fill": "#00000000",
"marker-outline": "#00000000",
"plot-bg": "#8AADF421",
"plot-border": "#00000000",
"selection": "#5B60787F",
"title-text": "#CAD3F5FF"
},
"text-editor": {
"background": "#24273AFF",
"breakpoint": "#ED8796FF",
"char-literal": "#A6DA95FF",
"comment": "#6E738DFF",
"current-line-edge": "#8087A27F",
"current-line-fill": "#8087A27F",
"current-line-fill-inactive": "#6E738D7F",
"cursor": "#F4DBD6FF",
"default": "#8087A2FF",
"error-marker": "#ED87967F",
"identifier": "#939AB7FF",
"keyword": "#C6A0F6FF",
"known-identifier": "#ED8796FF",
"line-number": "#8087A2FF",
"multi-line-comment": "#6E738DFF",
"number": "#F5A97FFF",
"preproc-identifier": "#B7BDF8FF",
"preprocessor": "#A5ADCBFF",
"punctuation": "#CAD3F5FF",
"selection": "#5B60787F",
"string": "#A6DA95FF"
}
},
"image_postfix": "_dark",
"name": "Catppuccin Macchiato",
"styles": {
"imgui": {
"alpha": 1.0,
"button-text-align": [
0.5,
0.5
],
"cell-padding": [
4.0,
2.0
],
"child-border-size": 1.0,
"child-rounding": 0.0,
"disabled-alpha": 0.6000000238418579,
"frame-border-size": 0.0,
"frame-padding": [
4.0,
3.0
],
"frame-rounding": 0.0,
"grab-min-size": 12.0,
"grab-rounding": 0.0,
"indent-spacing": 10.0,
"item-inner-spacing": [
4.0,
4.0
],
"item-spacing": [
8.0,
4.0
],
"popup-border-size": 1.0,
"popup-rounding": 0.0,
"scrollbar-rounding": 9.0,
"scrollbar-size": 14.0,
"selectable-text-align": [
0.0,
0.0
],
"tab-rounding": 4.0,
"window-border-size": 1.0,
"window-min-size": [
32.0,
32.0
],
"window-padding": [
8.0,
8.0
],
"window-rounding": 0.0,
"window-title-align": [
0.0,
0.5
]
},
"imnodes": {
"grid-spacing": 24.0,
"link-hover-distance": 10.0,
"link-line-segments-per-length": 0.10000000149011612,
"link-thickness": 3.0,
"mini-map-offset": [
4.0,
4.0
],
"mini-map-padding": [
8.0,
8.0
],
"node-border-thickness": 1.0,
"node-corner-rounding": 4.0,
"node-padding": [
8.0,
8.0
],
"pin-circle-radius": 4.0,
"pin-hover-radius": 10.0,
"pin-line-thickness": 1.0,
"pin-offset": 0.0,
"pin-quad-side-length": 7.0,
"pin-triangle-side-length": 9.5
},
"implot": {
"annotation-padding": [
2.0,
2.0
],
"digital-bit-gap": 4.0,
"digital-bit-height": 8.0,
"error-bar-size": 5.0,
"error-bar-weight": 1.5,
"fill-alpha": 1.0,
"fit-padding": [
0.0,
0.0
],
"label-padding": [
5.0,
5.0
],
"legend-inner-padding": [
5.0,
5.0
],
"legend-padding": [
10.0,
10.0
],
"legend-spacing": [
5.0,
0.0
],
"line-weight": 1.0,
"major-grid-size": [
1.0,
1.0
],
"major-tick-len": [
10.0,
10.0
],
"major-tick-size": [
1.0,
1.0
],
"marker-size": 4.0,
"marker-weight": 1.0,
"minor-alpha": 0.25,
"minor-grid-size": [
1.0,
1.0
],
"minor-tick-len": [
5.0,
5.0
],
"minor-tick-size": [
1.0,
1.0
],
"mouse-pos-padding": [
10.0,
10.0
],
"plot-border-size": 1.0,
"plot-default-size": [
400.0,
300.0
],
"plot-min-size": [
200.0,
150.0
],
"plot-padding": [
10.0,
10.0
]
}
}
}

View File

@@ -0,0 +1,312 @@
{
"base": "Dark",
"colors": {
"imgui": {
"border": "#A6ADC8FF",
"border-shadow": "#BAC2DEFF",
"button": "#89B4FA7F",
"button-active": "#B4BEFEFF",
"button-hovered": "#89DCEB7F",
"check-mark": "#89B4FAFF",
"child-background": "#181825FF",
"docking-empty-background": "#1E1E2EFF",
"docking-preview": "#89DCEBFF",
"drag-drop-target": "#74C7ECFF",
"frame-background": "#1E1E2EFF",
"frame-background-active": "#B4BEFEFF",
"frame-background-hovered": "#89DCEB7F",
"header": "#74C7EC7F",
"header-active": "#B4BEFE7F",
"header-hovered": "#89DCEB7F",
"menu-bar-background": "#1E1E2EFF",
"modal-window-dim-background": "#BAC2DE7F",
"nav-highlight": "#B4BEFEFF",
"nav-windowing-background": "#CDD6F4FF",
"nav-windowing-highlight": "#6C7086FF",
"plot-histogram": "#F9E2AFFF",
"plot-histogram-hovered": "#FAB3877F",
"plot-lines": "#A6ADC8FF",
"plot-lines-hovered": "#F5C2E77F",
"popup-background": "#1E1E2EFF",
"resize-grip": "#7F849CFF",
"resize-grip-active": "#B4BEFEFF",
"resize-grip-hovered": "#89DCEB7F",
"scrollbar-background": "#1E1E2EFF",
"scrollbar-grab": "#7F849CFF",
"scrollbar-grab-active": "#B4BEFEFF",
"scrollbar-grab-hovered": "#89DCEB7F",
"separator": "#7F849CFF",
"separator-active": "#B4BEFEFF",
"separator-hovered": "#89DCEB7F",
"slider-grab": "#6C7086FF",
"slider-grab-active": "#B4BEFEFF",
"tab": "#6C7086FF",
"tab-active": "#B4BEFE7F",
"tab-hovered": "#89DCEB7F",
"tab-unfocused": "#7F849C7F",
"tab-unfocused-active": "#6C70867F",
"table-border-light": "#7F849CFF",
"table-border-strong": "#9399B2FF",
"table-header-background": "#6C7086FF",
"table-row-background": "#181825FF",
"table-row-background-alt": "#11111BFF",
"text": "#CDD6F4FF",
"text-disabled": "#7F849CFF",
"text-selected-background": "#585B707F",
"title-background": "#181825FF",
"title-background-active": "#181825FF",
"title-background-collapse": "#181825FF",
"window-background": "#1E1E2EFF"
},
"imhex": {
"desc-button": "#45475AFF",
"desc-button-active": "#B4BEFEFF",
"desc-button-hovered": "#89DCEB7F",
"highlight": "#A6E3A1FF",
"toolbar-blue": "#89B4FAFF",
"toolbar-brown": "#F5E0DCFF",
"toolbar-gray": "#7F849CFF",
"toolbar-green": "#A6E3A1FF",
"toolbar-purple": "#CBA6F7FF",
"toolbar-red": "#F38BA8FF",
"toolbar-yellow": "#F9E2AFFF"
},
"imnodes": {
"box-selector": "#89B4FAFF",
"box-selector-outline": "#89B4FA7F",
"grid-background": "#181825FF",
"grid-line": "#9399B2FF",
"grid-line-primary": "#7F849CFF",
"link": "#89B4FAFF",
"link-hovered": "#89DCEBFF",
"link-selected": "#B4BEFEFF",
"mini-map-background": "#CDD6F47F",
"mini-map-background-hovered": "#BAC2DE7F",
"mini-map-canvas": "#45475A7F",
"mini-map-canvas-outline": "#3132447F",
"mini-map-link": "#89B4FAFF",
"mini-map-link-selected": "#B4BEFEFF",
"mini-map-node-background": "#585B707F",
"mini-map-node-background-hovered": "#3132447F",
"mini-map-node-background-selected": "#B4BEFEFF",
"mini-map-node-outline": "#7F849CFF",
"mini-map-outline": "#7F849C7F",
"mini-map-outline-hovered": "#BAC2DE7F",
"node-background": "#6C7086FF",
"node-background-hovered": "#89DCEB7F",
"node-background-selected": "#B4BEFEFF",
"node-outline": "#6C7086FF",
"pin": "#89B4FA7F",
"pin-hovered": "#89DCEB7F",
"title-bar": "#313244FF",
"title-bar-hovered": "#89DCEB7F",
"title-bar-selected": "#B4BEFEFF"
},
"implot": {
"axis-bg": "#CDD6F421",
"axis-bg-active": "#BAC2DE7F",
"axis-bg-hovered": "#A6ADC87F",
"axis-grid": "#1E1E2EFF",
"axis-text": "#00000000",
"axis-tick": "#BAC2DE7F",
"crosshairs": "#CDD6F47F",
"error-bar": "#00000000",
"fill": "#00000000",
"frame-bg": "#1E1E2EFF",
"inlay-text": "#CDD6F4FF",
"legend-bg": "#6C7086FF",
"legend-border": "#7F849CFF",
"legend-text": "#CDD6F4FF",
"line": "#00000000",
"marker-fill": "#00000000",
"marker-outline": "#00000000",
"plot-bg": "#89B4FA21",
"plot-border": "#00000000",
"selection": "#585B707F",
"title-text": "#CDD6F4FF"
},
"text-editor": {
"background": "#1E1E2EFF",
"breakpoint": "#F38BA8FF",
"char-literal": "#A6E3A1FF",
"comment": "#6C7086FF",
"current-line-edge": "#7F849C7F",
"current-line-fill": "#7F849C7F",
"current-line-fill-inactive": "#6C70867F",
"cursor": "#F5E0DCFF",
"default": "#7F849CFF",
"error-marker": "#F38BA87F",
"identifier": "#9399B2FF",
"keyword": "#CBA6F7FF",
"known-identifier": "#F38BA8FF",
"line-number": "#7F849CFF",
"multi-line-comment": "#6C7086FF",
"number": "#FAB387FF",
"preproc-identifier": "#B4BEFEFF",
"preprocessor": "#A6ADC8FF",
"punctuation": "#CDD6F4FF",
"selection": "#585B707F",
"string": "#A6E3A1FF"
}
},
"image_postfix": "_dark",
"name": "Catppuccin Mocha",
"styles": {
"imgui": {
"alpha": 1.0,
"button-text-align": [
0.5,
0.5
],
"cell-padding": [
4.0,
2.0
],
"child-border-size": 1.0,
"child-rounding": 0.0,
"disabled-alpha": 0.6000000238418579,
"frame-border-size": 0.0,
"frame-padding": [
4.0,
3.0
],
"frame-rounding": 0.0,
"grab-min-size": 12.0,
"grab-rounding": 0.0,
"indent-spacing": 10.0,
"item-inner-spacing": [
4.0,
4.0
],
"item-spacing": [
8.0,
4.0
],
"popup-border-size": 1.0,
"popup-rounding": 0.0,
"scrollbar-rounding": 9.0,
"scrollbar-size": 14.0,
"selectable-text-align": [
0.0,
0.0
],
"tab-rounding": 4.0,
"window-border-size": 1.0,
"window-min-size": [
32.0,
32.0
],
"window-padding": [
8.0,
8.0
],
"window-rounding": 0.0,
"window-title-align": [
0.0,
0.5
]
},
"imnodes": {
"grid-spacing": 24.0,
"link-hover-distance": 10.0,
"link-line-segments-per-length": 0.10000000149011612,
"link-thickness": 3.0,
"mini-map-offset": [
4.0,
4.0
],
"mini-map-padding": [
8.0,
8.0
],
"node-border-thickness": 1.0,
"node-corner-rounding": 4.0,
"node-padding": [
8.0,
8.0
],
"pin-circle-radius": 4.0,
"pin-hover-radius": 10.0,
"pin-line-thickness": 1.0,
"pin-offset": 0.0,
"pin-quad-side-length": 7.0,
"pin-triangle-side-length": 9.5
},
"implot": {
"annotation-padding": [
2.0,
2.0
],
"digital-bit-gap": 4.0,
"digital-bit-height": 8.0,
"error-bar-size": 5.0,
"error-bar-weight": 1.5,
"fill-alpha": 1.0,
"fit-padding": [
0.0,
0.0
],
"label-padding": [
5.0,
5.0
],
"legend-inner-padding": [
5.0,
5.0
],
"legend-padding": [
10.0,
10.0
],
"legend-spacing": [
5.0,
0.0
],
"line-weight": 1.0,
"major-grid-size": [
1.0,
1.0
],
"major-tick-len": [
10.0,
10.0
],
"major-tick-size": [
1.0,
1.0
],
"marker-size": 4.0,
"marker-weight": 1.0,
"minor-alpha": 0.25,
"minor-grid-size": [
1.0,
1.0
],
"minor-tick-len": [
5.0,
5.0
],
"minor-tick-size": [
1.0,
1.0
],
"mouse-pos-padding": [
10.0,
10.0
],
"plot-border-size": 1.0,
"plot-default-size": [
400.0,
300.0
],
"plot-min-size": [
200.0,
150.0
],
"plot-padding": [
10.0,
10.0
]
}
}
}