HexLab
Development reference from Hylang-Compiler. Commands and source paths on this page are relative to that repository checkout. For current task status, use the development project.
HexLab demonstrates byte-oriented file tooling with the C++ SDK. It uses Buffer, BinaryPrimitives, and unsafe operations that the native Hydrogen compiler does not support. It is a pure-Hylang workspace with:
HexLab.CoreHexLab.CliHexLab.Tests
From the repo root:
./build/hy build samples/hexlab/HexLab.hyproj./build/hy test samples/hexlab/HexLab.hyproj./build/hy fmt --check samples/hexlab./build/hy check samples/hexlab/HexLab.Cli/HexLab.Cli.hyproj --json./build/hy package pack samples/hexlab/HexLab.Cli/HexLab.Cli.hyprojUseful demo commands:
./build/hy run samples/hexlab/HexLab.Cli/HexLab.Cli.hyproj -- inspect samples/hexlab/demo.bin./build/hy run samples/hexlab/HexLab.Cli/HexLab.Cli.hyproj -- dump samples/hexlab/demo.bin./build/hy run samples/hexlab/HexLab.Cli/HexLab.Cli.hyproj -- search samples/hexlab/demo.bin 89504E47./build/hy run samples/hexlab/HexLab.Cli/HexLab.Cli.hyproj -- diff samples/hexlab/demo.bin samples/hexlab/demo.binExpected results (the dump below uses the default width of 16):
format=PNG width=1 height=10: 89 50 4E 47 0D 0A 1A 0A 00 00 00 0D 49 48 44 5216: 00 00 00 01 00 00 00 01found offset=0equalAPI usage:
HexLab.Coreroutes dump, diff, search, and slice hot paths through the bootstrapSystem.Runtime.Buffer- PNG inspection exercises the 64-bit
BinaryPrimitivespath - search includes an explicit
unsafefast path throughBuffer.DangerousData()to demonstrate the systems surface
Command surface:
usage: hexlab dump <file> [width] [start] [count] or: hexlab inspect <file> or: hexlab diff <left> <right> or: hexlab search <file> <hex-pattern> or: hexlab slice <file> <start> <count> <out>