Sources
Every fact about the PRG format that macacac relies on is tied to a public source. docs/format.md in the archive gives the source of each one, down to the file and its SHA-256. This page is the short version.
Published research
| Source | Author | What macacac takes from it |
|---|---|---|
ciq.ksy, a Kaitai Struct description of the PRG format | Tao Sauvage, Anvil Secure (April 2023) | Section magics, head, entry points, class and field layouts, link table, exception table, signature, opcode names and sizes, six structural symbol ids |
| Compromising Garmin’s Sport Watches | Tao Sauvage, Anvil Secure | The description of the virtual machine that the file above accompanies |
| Reverse Engineering Garmin Watch Applications with Ghidra and GhidraGarminApp | Luigi Fragale, Anvil Secure (February 2026) | Background on the same file format |
macacac does not include ciq.ksy, because its repository states no licence. The facts it records are reproduced in macacac’s own code and notes: the opcode table, for example, lists the same names and numbers, with three operand sizes corrected from the reference apps.
Reference apps
These four apps are published on GitHub by their authors, as sources and as compiled PRG files. What ciq.ksy does not describe was read from the compiled files and by comparing them with macacac’s own build of the same sources. That covers the resource and settings sections, bitmaps, the glance layout and the compiler’s idioms.
| App | Repository | What is used |
|---|---|---|
| GRun, a data field | gcormier9/GRun | Sources at tag v1.40; the fēnix 5 and Venu 3 builds inside the release file GRun.iq |
| SimpTemp, a widget with a glance | zivke/SimpTemp | Sources at tag v1.4.1; an Instinct 2 build inside the release file SimpTemp.v1.4.1.zip |
| SnakeIQ, a watch app | mazefest/SnakeIQ | Sources and bin/SnakeIQ.prg at commit 02ff329 |
| BBWF, a watch face | cemheren/GarminInstinct2s-BBWF | Sources and instinct/test2.prg at commit ae58bb7 |
macacac redistributes none of them. tools/fetch_references.py downloads them from their authors’ repositories onto your computer and checks each file against a recorded SHA-256. The apps stay under their authors’ terms.
The watch
A few facts were observed by running macacac’s own builds on my own Instinct 2S: for example, that the watch accepts apps signed with a self-generated key, and which form of the header and signature it accepts. They are tagged [watch] in the notes. The watch firmware was not decompiled or disassembled.
What has no public source
Some forms appear in no reference app. macacac writes them by analogy with the forms that do, and marks them hypothesis:
- a typed
catch; - global enums and constants folded into their value;
returnorbreakinside atrywith a non-emptyfinally,do … while, an assignment used as a value;- drawable shapes other than
circle, and somemenu2attributes; - scaled bitmaps, and palettes at 1, 4 or 8 bits per pixel;
- permissions other than SensorHistory, UserProfile and Positioning.
The symbol ids
The numeric ids of the watch’s API are not in the archive. tools/build_symbols.py reads them on your computer from the name tables the reference apps publish, then learns the rest by aligning each app with macacac’s build of it. The result is about 2,500 names.
Six structural ids do appear in the code and notes: the root module, the module of top-level code, the hidden initialiser, the string and drawable tables, and the default language. They are listed in the symbol enum of ciq.ksy and are the same in every reference app. docs/format.md gives them.