# 12 — Tool: GmkSplitter (pattern reference)

**Repo**: `github.com/Medo42/Gmk-Splitter`
**Artifact**: `gmksplit.jar`
**Original target**: `.gmk` and `.gm81` (GameMaker 7+/8.1)

Not a 5.3a tool directly, but the **pattern** is the endgame for any RE pipeline.

## What it does

Disassembles a monolithic GameMaker binary into a **hierarchical directory tree**:

- One `.xml` per resource descriptor.
- One `.gml` per script.
- Sprite frames as discrete image files.
- Reassembles the tree back into a single `.gmk` / `.gm81`.

## Why it matters for `.gmd`

Same paradigm applies. After [10](10-tool-gm-decompiler-v21.md) or [09](09-tool-gmd-recovery.md) recovers a `.gmd`, feed it through a parser ([11-tool-lateralgm](11-tool-lateralgm.md)) and emit a similar tree:

```
project/
├── scripts/
│   ├── scrPlayerMove.gml
│   └── scrSaveGame.gml
├── objects/
│   └── objPlayer/
│       ├── meta.xml
│       └── events/
│           └── create.gml
├── sprites/
│   └── sprPlayer/
│       ├── meta.xml
│       └── img_0.png
├── rooms/...
└── ...
```

Benefits:

- **Git-friendly** — diffable text per resource.
- **Greppable** — find function uses across the project.
- **Mergeable** — collaborate without monolithic-binary conflicts.

GmkSplitter itself targets `.gmk`/`.gm81`, not `.gmd`. To replicate the workflow for 5.3a output, write a `.gmd` → tree exporter modeled on `LibReader.java` from LateralGM.

## See also

- [03-gmd-format](03-gmd-format.md) — what the splitter must walk
- [11-tool-lateralgm](11-tool-lateralgm.md) — reference parser
- [04-dnd-serialization](04-dnd-serialization.md) — DnD nodes need GML transcription for clean diffs
