diff --git a/NFC-Payload-Layout.md b/NFC-Payload-Layout.md new file mode 100644 index 0000000..f6d2033 --- /dev/null +++ b/NFC-Payload-Layout.md @@ -0,0 +1,36 @@ +# Creature Cards NFC Payload Layout + +This document summarizes the parts of the `mysteryhack.com:cc1` NFC payload that are currently understood from the sample cards. + +## Visual Map + +```mermaid +flowchart LR + A[Bytes 0-1
E9 24
Event encoding
GPN24] --> B[Byte 2
Palette / type selector] + B --> C[Bytes 3-4
Card UUID suffix
47 F2 / DA 45] + C --> D[Bytes 5-8
Reserved / padding] + D --> E[Bytes 9-730
Sprite blob
722 bytes
Packed 38x38 4bpp
Hex range: 0x09-0x2DA] + E --> F[Bytes 731-784
Packed card text
72 chars in 6-bit alphabet
Name + 3 traits
Hex range: 0x2DB-0x310] + F --> G[Bytes 785-808
Secret field
UTF-8, up to 24 bytes
Hex range: 0x311-0x328] + G --> H[Bytes 809-857
Opaque trailer
Remaining metadata still not fully identified
Hex range: 0x329-0x359] +``` + +## Byte Ranges + +| Offset | Length | Meaning | Notes | +| --- | ---: | --- | --- | +| `0x00-0x01` | 2 | Event encoding | `E9 24` maps to the event identifier `GPN24`. | +| `0x02` | 1 | Palette / card type byte | In the current samples, `0x01` maps to `Default` and `0x03` maps to `CYBER`. The full palette order appears to be one-based: Default, Blueprint, CYBER, Nature, Fossil, Ghost, Daemon, Fairy. | +| `0x03-0x04` | 2 | Card UUID suffix | Sample values are `47 F2` for Blue Portal and `DA 45` for GLaDOS. | +| `0x05-0x08` | 4 | Reserved / padding | Not yet decoded. | +| `0x09-0x2DA` | 722 | Sprite blob | Packed 38x38 image data. This is embedded directly in the payload and matches the sprite PNG metadata. | +| `0x2DB-0x310` | 54 | Packed card text | LSB-first 6-bit packing using the alphabet ` ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-`. This decodes to 72 characters total: 24 for `name`, 16 for `trait1`, 16 for `trait2`, 16 for `trait3`. | +| `0x311-0x328` | 24 | Secret | UTF-8 text, right-padded with `0x00` when shorter than 24 bytes. | +| `0x329-0x359` | 49 | Opaque trailer | Remaining metadata that is still not fully identified. | + +## Known Samples + +| Card | Event bytes | Palette byte | UUID suffix | Quote text | +| --- | --- | --- | --- | --- | +| Blue Portal | `E9 24` | `01` | `47 F2` | `Speedy thing goes in` | +| GLaDOS | `E9 24` | `03` | `DA 45` | `The cake is a lie` | \ No newline at end of file