[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-81735":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":8,"htmlUrl":8,"language":9,"languages":8,"totalLinesOfCode":8,"stars":10,"forks":11,"watchers":12,"openIssues":13,"contributorsCount":13,"subscribersCount":13,"size":13,"stars1d":13,"stars7d":13,"stars30d":13,"stars90d":13,"forks30d":13,"starsTrendScore":13,"compositeScore":14,"rankGlobal":8,"rankLanguage":8,"license":8,"archived":15,"fork":15,"defaultBranch":16,"hasWiki":17,"hasPages":15,"topics":18,"createdAt":8,"pushedAt":8,"updatedAt":19,"readmeContent":20,"aiSummary":21,"trendingCount":13,"starSnapshotCount":13,"syncStatus":11,"lastSyncTime":22,"discoverSource":23},81735,"replay-tool","wnc-replay\u002Freplay-tool","wnc-replay",null,"Go",31,2,1,0,1.43,false,"main",true,[],"2026-06-12 02:04:19","# r6-replay-tool\n\nComprehensive Rainbow Six Siege `.rec` replay file analyzer. Extracts position tracking, bone\u002Faim data, weapon analytics, equipment loadouts, shot reconstruction, health monitoring, entity classification, camera frames, kill TLVs, defuser ticks, scoreboard, and derived analytics from replay files.\n\n## Features\n\n### Position & Movement\n- **SPAWN + FC-UPDATE extraction** — decodes all entity position packets (pattern `60 73 85 FE`)\n- **Rotation\u002Fquaternion** from 0x03xx type packets (yaw + pitch from trail quaternion)\n- **Stance detection** — standing\u002Fcrouching\u002Fprone inferred from Z-height deviation\n- **Yaw unwrapping** — continuous yaw without ±180° discontinuities\n\n### Bone & Aim Data\n- **Head bone** (BMA: `02 00 70 88 98 58`) — head offset + aim quaternion (36-byte payload)\n- **Chest bone** (BMB: `00 2C 36 14 9B`) — chest offset + rotation quaternion\n- ~74% coverage of position updates, enables precise aim direction reconstruction\n\n### Weapons & Ammo\n- **Decoded ammo TLV hashes** (`0x29C80A40` mag, `0x3E6D5B6D` loaded, `0xAA4BBC34` reserve, etc.)\n- **Hash2 weapon-slot decoder** — `0x00000000`=primary, `0x29C80A40`=secondary, `0xAA4BBC34`=grenade, `0x653E26DD`=op_gadget\n- **Shot detection** — counts magazine decrements per weapon\n- **Per-loadout slot metadata** — `slotType`, `maxCap`, `shotCount` populated from real ammo events\n- **Session-variable ID resolver** — prefers `slotSecondaryWeapon` (canonical) over `slotMeleeWeapon` (session)\n\n### Equipment Loadouts\n- **All 5 loadout slots decoded**: primary weapon, secondary weapon, **operator gadget** (auxHash `0x1DA32C08`), secondary gadget, reinforcement\n- **Y11 game-data dump integrated** — ~500 weapon\u002Fgadget hashes including all V2 instances, drone families, OSP grenades\n- All Y11 operator signature gadgets resolve: SHOCK WIRE (Bandit), KIBA BARRIER (Azami), KULAKOV (Tachanka), ERC-7 (Vigil), GLANCE SMART GLASSES (Warden), RTILA ELECTROCLAW (Kaid), BANSHEE (Melusi), WELCOME MAT (Frost), SIGNAL DISRUPTOR (Mute), VIPERSTRIKE MINE (Denari), RADAR (SolidSnake), RAM BU-GI AUTOBREACHER (Ram), and more\n- **Library loadouts** (`libraryLoadouts[]`) — top-level array with weapon entity refs, init capacities, hashes\n\n### Health Tracking\n- Health property hash `0x4171D3C3` with co-located sub-properties:\n  - `0xC2D846F8` — max HP\n  - `0x475BB68B` — damage rate\n  - `0xF634093A` — hit counter\n  - `0x848F67CF` — health-event time\n- **Health state labels** — `alive` \u002F `dbno` (1–5 hp range, bleed-out fraction) \u002F `dead`\n- Per-player health state changes with full sub-property decoding\n\n### Kill \u002F DBNO Events (extended TLVs, Y11S1+)\n- **DBNO window** widened from 70 to 256 bytes for Y11S1 layout\n- **Decoded kill TLV fields**:\n  - `0x790009E3` — weapon entity ref (u64)\n  - `0x8F0292B5` — kill flag (u8)\n  - `0x5BC4BC84` `0x37BF3E90` `0xD13DA88D` `0x3187B853` `0x0B64ADA5` — five kill enums\n  - `0x65DD6CF8` — canonical weapon hash per kill (consistent across same-weapon kills)\n  - `0x4EA45BC3` — corroborating headshot byte\n- **Decoded enums**: `KillEnum3 - 1 = AttackerTeam`, `KillEnum4 - 1 = VictimTeam` (verified across 7 kills)\n- **DBNO attribution** — `dbnoBy`, `finishedBy` fields on `matchFeedback` entries\n\n### Round-End Scoreboard\n- `header.scoreboard[]` — final tallies per player ID (score, assists, round-assists)\n- Eliminates need to sum scoreUpdate deltas\n\n### Defuser Timer Ticks\n- `defuserTicks[]` — per-frame tick stream with `state` (\"planting\" \u002F \"disabling\" \u002F \"planted_idle\")\n- Enables progress-bar rendering and exact frame completion detection\n\n### Entity Classification\n- **SPAWN counters**: 494=player, 154=drone, 146=gadget, 130=barricade, 138\u002F254=weapon\n- **FC-UPDATE flag fingerprinting** for projectile sub-types\n- **Transient entity filter** — drops single-frame entities with no spawn counter (visual stubs \u002F particles)\n\n### Camera Frames\n- Per-entity camera detection\n- **Spectator POV periods** — recording-player camera target as contiguous time windows\n\n### Timer & Game Events\n- Timer ticks + prep\u002Faction phase detection\n- Match feedback with raw countdown (`timeSecs`) AND decoded countdown→elapsed conversion\n- Game actions: reinforce, gadget deploy\n- Operator-swap events (Y10S4+ via `MatchFeedback`, pre-Y10S4 via binary scan)\n\n### Derived Analytics (post-pipeline enrichments)\n- **`hits[]`** — kill→shot correlation: every kill \u002F DBNO mapped to the killer's last shot\n- **`trades[]`** — kills within a 5s trade window of teammate's death\n- **`reinforcements[]`** — wall reinforce events deduped + attributed to nearest defender XYZ (capped at game-rule max of 10)\n- **`spectatorPeriods[]`** — recording-player POV target with frame counts\n- **`bombPlant`** — planter index, time, XYZ\n- **`bombSite`** — floor + description from defender spawn metadata + Z-cluster center\n- **`outcome`** — winning team + role + win condition (KilledOpponents \u002F DefusedBomb \u002F DisabledDefuser \u002F PlantDetonation \u002F Time)\n- **`shotDamages[]`** — per-shot damage estimates from kill events\n- **`destructionEvents[]`** — entity destructions from `TrackedEntities.HealthEvents` with entity-type classification\n\n### Maps\n- All Y9–Y11 map IDs including `HouseY11` (`434715462383`) added to `dissect\u002Fmap_string.go`\n\n## Installation\n\n```bash\n# Clone\ngit clone https:\u002F\u002Fgithub.com\u002Fwnc-replay\u002Freplay-tool.git\ncd replay-tool\n\n# Build\ngo build -o r6-replay-tool.exe .\n```\n\n### Requirements\n- Go 1.23+\n- Dependencies auto-resolved via `go mod`\n\n## Usage\n\n```bash\n# Analyze a round and output JSON to stdout\nr6-replay-tool match-R01.rec\n\n# Pretty-printed JSON\nr6-replay-tool -pretty match-R01.rec\n\n# Write to file\nr6-replay-tool -o analysis.json match-R01.rec\n\n# Header only (fast, no binary analysis)\nr6-replay-tool -header match-R01.rec\n```\n\n### RE Inspection Tools\n\nThe `cmd\u002F` directory contains binary inspection tools used for reverse engineering. Each is built and run independently:\n\n| Tool | Purpose |\n|------|---------|\n| `cmd\u002Finspect` | Dump context around mystery hashes + low-HP samples |\n| `cmd\u002Fprobe` | Kill-marker neighborhood + event-name string search |\n| `cmd\u002Fdeepscan` | Exhaustive byte survey (HP histogram, hash freq, ASCII strings, ammo refs, sg auxHash anchors) |\n| `cmd\u002Fkilldecode` | Per-kill TLV table for enum decoding |\n| `cmd\u002Fhealthdump` | Health sub-property distance\u002Fcoverage analysis |\n| `cmd\u002Fsesweapon` | Loadout slot trace + per-kill weapon-ID extraction |\n| `cmd\u002Fopslot` | auxHash discovery for operator-gadget slot |\n| `cmd\u002Fammoref` | Per-player weapon entity refs + Hash1\u002FHash2 |\n| `cmd\u002Fhashscan` | Cross-replay hash search (locate-by-block-index) |\n| `cmd\u002Fenumstats` | Aggregate kill TLV stats across many replays (decoded killEnum \u002F weaponEntRef64 across 402 kills \u002F 85 replays) |\n\n```bash\ngo run .\u002Fcmd\u002Fprobe match-R01.rec\ngo run .\u002Fcmd\u002Fkilldecode match-R01.rec\n```\n\n## Output Format\n\n```jsonc\n{\n  \"header\": {\n    \"gameVersion\": \"Y11S1_Alpha03\",\n    \"matchId\": \"...\",\n    \"mapName\": \"HouseY11\",\n    \"gameMode\": \"Bomb\",\n    \"roundNumber\": 5,\n    \"teams\": [...],\n    \"players\": [...],\n    \"matchFeedback\": [\n      {\n        \"type\": \"Kill\",\n        \"username\": \"Killer\",\n        \"target\": \"Victim\",\n        \"headshot\": true,\n        \"time\": \"1:03\",       \u002F\u002F mm:ss countdown\n        \"timeSecs\": 63,        \u002F\u002F raw countdown seconds\n        \"dbnoBy\": \"Knocker\",   \u002F\u002F who downed first (if different)\n        \"finishedBy\": \"Killer\"\n      }\n    ],\n    \"scoreboard\": [\n      { \"playerId\": \"d28713f0\", \"score\": 3513, \"assists\": 2, \"assistsFromRound\": 2 }\n    ]\n  },\n  \"analysis\": {\n    \"players\": [...],\n    \"entities\": [...],\n    \"weapons\": {...},\n    \"loadouts\": [\n      {\n        \"playerIndex\": 3,\n        \"operatorName\": \"Bandit\",\n        \"primaryWeapon\": { \"name\": \"MP7\", \"slotType\": \"primary\", \"shotCount\": 8, \"maxCap\": 150 },\n        \"secondaryWeapon\": { \"name\": \"KERATOS .357\", \"slotType\": \"secondary\", \"shotCount\": 50, \"maxCap\": 148 },\n        \"primaryGadget\": { \"name\": \"SHOCK WIRE\", \"slotType\": \"op_gadget\" },\n        \"secondaryGadget\": { \"name\": \"NITRO CELL (BANDIT)\", \"slotType\": \"grenade\" },\n        \"reinforcement\": { \"name\": \"REINFORCEMENT\" }\n      }\n    ],\n    \"shots\": [...],\n    \"healthUpdates\": [\n      {\n        \"playerIndex\": 5, \"health\": 100, \"state\": \"alive\",\n        \"maxHealth\": 100, \"damageRate\": 0.08, \"hitCounter\": 1, \"healthTime\": 0\n      }\n    ],\n    \"binaryFeedback\": [\n      {\n        \"type\": \"kill\", \"attacker\": \"...\", \"target\": \"...\", \"headshot\": true,\n        \"weaponId\": \"0x516BCE20\",      \u002F\u002F canonical weapon hash for this kill\n        \"attackerTeam\": 0, \"victimTeam\": 1,\n        \"killEnum1\": 2, \"killEnum2\": 1, \"killEnum3\": 1, \"killEnum4\": 2, \"killEnum5\": 0\n      }\n    ],\n    \"gameEvents\": [...],            \u002F\u002F all event types: kill\u002Fdbno\u002Fplant_*\u002Fdefuse_*\u002Flocate_objective\u002Foperator_swap\n    \"hits\": [...],                  \u002F\u002F kill→shot correlation\n    \"trades\": [...],                \u002F\u002F 5s trade-window kills\n    \"reinforcements\": [...],        \u002F\u002F deduped reinforce + deployer XYZ\n    \"spectatorPeriods\": [...],\n    \"bombPlant\": { \"planterIndex\": 5, \"timeSecs\": 142, \"x\": ..., \"y\": ..., \"z\": ... },\n    \"bombSite\": { \"floor\": \"1F\", \"description\": \"1F Kitchen, 1F Cafeteria\", \"centerX\": 58.9, ... },\n    \"outcome\": { \"winningTeam\": 0, \"winningRole\": \"Defense\", \"winCondition\": \"KilledOpponents\", \"attackersDead\": 5, \"defendersDead\": 2 },\n    \"destructionEvents\": [...],\n    \"recordingPlayer\": 2,\n    \"roundDuration\": 193\n  },\n  \"libraryLoadouts\": [\n    {\n      \"playerIndex\": 2, \"username\": \"...\",\n      \"primary\":   { \"entityRef\": 4028433332, \"initialCapacity\": 125, \"hash1\": 1047608685, \"hash2\": 2857960500, \"isPrimary\": true },\n      \"secondary\": { \"entityRef\": 4028433329, \"initialCapacity\": 91,  \"hash1\": 1047608685, \"hash2\": 2857960500, \"isPrimary\": false }\n    }\n  ],\n  \"defuserTicks\": [\n    { \"timeSecs\": 142, \"time\": \"1:18\", \"rawValue\": 7.0, \"prevValue\": 7.4, \"state\": \"disabling\" }\n  ]\n}\n```\n\n## Binary Format Reference\n\nSee [docs\u002FBINARY_FORMAT.md](docs\u002FBINARY_FORMAT.md) for the full hash table, packet layouts, and TLV semantics.\n\n### Key Patterns\n\n| Pattern | Purpose |\n|---------|---------|\n| `60 73 85 FE` | FC-UPDATE archetype (movement) |\n| `61 73 85 FE` | SPAWN archetype (entity init) |\n| `77 CA 96 DE` | Ammo event marker |\n| `1F 07 EF C9` | Timer tick |\n| `22 D9 13 3C BA` | Kill event indicator |\n| `22 96 E2 29 7F` | DBNO marker (within ±256 bytes of kill in Y11S1+) |\n| `02 00 70 88 98 58` | Head bone magic (BMA) |\n| `00 2C 36 14 9B` | Chest bone magic (BMB) |\n| `5F 85 CC 85` | Weapon init block |\n| `0xa5b2f3a5` | Camera quaternion signature |\n| `61 78 8C 1D` | Operator gadget slot auxHash (`0x1DA32C08`) |\n\n## Project Structure\n\n```\nr6-replay-tool\u002F\n├── main.go              # CLI + buildOutput pipeline + scoreboard\u002Floadout\u002Fdefuser wiring\n├── enrich.go            # Post-pipeline analytics (hits, trades, bomb plant, outcome, etc.)\n├── analysis\u002F\n│   ├── analysis.go      # Main pipeline\n│   ├── types.go         # All data structures\n│   ├── positions.go     # Position extraction + entity mapping\n│   ├── ammo.go          # Ammo tracking + shot reconstruction\n│   ├── bone.go          # Head\u002Fchest bone data\n│   ├── camera.go        # Camera frame detection\n│   ├── events.go        # Kill\u002FDBNO + extended TLVs, game actions, loadouts (6 slots), classification\n│   ├── health.go        # Health monitoring + sub-property decoder (FillHealthSubProps)\n│   ├── timer.go         # Timer ticks + phases\n│   └── names.go         # Y11 game-data hash → name database (~500 entries)\n├── cmd\u002F                 # RE inspection tools (run with: go run .\u002Fcmd\u002F\u003Ctool> file.rec)\n│   ├── ammoref\u002F\n│   ├── deepscan\u002F\n│   ├── hashscan\u002F\n│   ├── healthdump\u002F\n│   ├── inspect\u002F\n│   ├── killdecode\u002F\n│   ├── opslot\u002F\n│   ├── probe\u002F\n│   └── sesweapon\u002F\n├── dissect\u002F             # Vendored r6-dissect fork with extensions\n│   ├── defuse.go        # ext: DefuserTick + per-frame recording\n│   ├── reader.go        # ext: DefuserTicks []DefuserTick field\n│   ├── header.go        # ext: HouseY11 = 434715462383\n│   ├── map_string.go    # ext: HouseY11 in stringer table\n│   └── ... (rest of upstream library)\n├── docs\u002F\n│   └── BINARY_FORMAT.md # Extended format reference\n├── README.md\n├── LICENSE\n└── go.mod\n```\n\n## TODO\n\n### Open\n- [ ] **Map Y11 Sledge secondary `0x63DC6FC00D`** — likely Reaper MK2 (family `0x63DC6FC0__`); not in current dump\n- [ ] **Refine `killEnum1=2` semantics** — verified Y11S1-only flag (39% of Y11 kills); specific meaning still unknown (wallbang? DBNO finish? marked target?)\n- [ ] **Web UI** — browser-based 2D\u002F3D replay viewer with timeline scrubbing\n- [ ] **Multi-round batch processing** — analyze entire match folders, aggregate stats across rounds\n- [ ] **Hostage\u002Fbomb objective detection** — identify objective entities in the binary\n- [ ] **Per-round entity prefix validation** — empirical findings contradict R01=0xF006\u002FR02=0xF005 docs\n\n### Done\n- [x] Position extraction (SPAWN + FC-UPDATE)\n- [x] Rotation\u002Fquaternion from 0x03xx packets\n- [x] Head + chest bone data (BMA\u002FBMB)\n- [x] Ammo tracking (TLV hashes + slot decoder)\n- [x] Equipment loadout extraction with all 6 slots (primary\u002Fsecondary weapon, melee, op gadget, sec gadget, reinforcement)\n- [x] Health property scanning + sub-property decoder\n- [x] Timer tick extraction + phase detection\n- [x] Binary match feedback (kill\u002FDBNO\u002Fdeath) + extended TLVs\n- [x] DBNO window expansion to 256 bytes (Y11S1+)\n- [x] Kill enum decoding (attacker\u002Fvictim team derivation)\n- [x] Game action detection (reinforce, gadget deploy)\n- [x] Camera frame detection (per-entity)\n- [x] Stance inference (standing\u002Fcrouching\u002Fprone)\n- [x] Entity classification (drone\u002Fgadget\u002Fbarricade\u002Fweapon\u002Fprojectile)\n- [x] Weapon\u002Fgadget name database (~500 items from Y11 game-data dump)\n- [x] HouseY11 map ID\n- [x] Operator gadget slot decoding (auxHash `0x1DA32C08`)\n- [x] Hit detection (kill→shot correlation)\n- [x] Trade kill detection\n- [x] Reinforcement positions\n- [x] Spectator POV periods\n- [x] Bomb plant location + bomb site classification\n- [x] Round outcome (winning team + win condition)\n- [x] Round-end scoreboard\n- [x] DBNO attribution (`dbnoBy` \u002F `finishedBy`)\n- [x] Library loadouts (entity refs + capacities)\n- [x] Defuser timer ticks\n- [x] Operator swap events (Y10S4+ library + pre-Y10S4 binary)\n- [x] Drone connect\u002Fdisconnect lifecycle\n- [x] Score delta tracking\n- [x] Destruction events from TrackedEntities.HealthEvents\n- [x] CLI with JSON output\n\n## Credits\n\n- [Nam-Nam](https:\u002F\u002Fgithub.com\u002FN4m-N4m) — original binary format research, ammo\u002Floadout\u002Fweapon tracking, equipment name database, entity classification\n- [SorrowXXX](https:\u002F\u002Fgithub.com\u002FSorrowXXX) — extended kill TLVs, health sub-properties, DBNO window expansion, scoreboard surfacing, library loadouts, defuser tick stream, DBNO attribution (PR #1, PR #2)\n- Based on [r6-dissect](https:\u002F\u002Fgithub.com\u002Fredraskal\u002Fr6-dissect) by redraskal\n\n## License\n\nMIT\n","r6-replay-tool 是一个全面的《彩虹六号：围攻》.rec 回放文件分析工具。它能够从回放文件中提取位置追踪、骨骼\u002F瞄准数据、武器分析、装备配置、射击重建、健康监测、实体分类、摄像机帧、击杀TLVs、拆弹器计时、记分板等信息及其衍生分析。项目使用Go语言编写，具有强大的位置和移动解析功能，包括解码所有实体位置包、旋转\u002F四元数计算、姿态检测和连续偏航角处理。此外，该工具还支持精准的骨骼与瞄准数据分析，武器与弹药管理，以及详细的装备配置解析。特别适合于游戏开发者、电竞分析师或希望深入研究游戏机制的玩家使用。","2026-06-11 04:06:12","CREATED_QUERY"]