Initial commit

Rust workspace for VIctory: PE analysis, loader, HLE skeleton,
DXBC/DXIL parsing with a GFX10 decoder, conversion cache, CLI and
asset-policy enforcement.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
MarvisandClaude Sonnet 5.5 committed 2026-11-23 01:15:26 +01:00
commit f4504f6413
69 files changed
+7952

No files matched your search

+57
View File
@@ -0,0 +1,57 @@
# Architecture
```
user's files (outside repo) VIctory
─────────────────────────── ─────────────────────────────────────────
game assets ──────────────────────────► victory-pipeline + victory-game
(victory-formats, victory-shader)
│
▼
cache_dir: converted data
│
game executable ─► victory-loader ────► title code (native x86-64)
prepare, map, bind │ imports
▼
victory-hle ── host Windows (shared APIs)
│ D3D12.X
▼
victory-gpu ─► host D3D12
│ shaders at pipeline creation
▼
victory-shader ◄─► cache_dir
```
Shaders are translated when the title creates a pipeline, from the bytes it
passes, wherever it loaded them from (executable, archive, memory).
Converting them ahead of time from files is only a warm-up.
## Crates
| Crate | Role |
|-------|------|
| `victory-core` | config, asset-policy guard, logging |
| `victory-pe` | read-only PE32+ and import-library analysis |
| `victory-loader` | prepare, map, bind and start the title image |
| `victory-hle` | console API implementations, host pass-through policy |
| `victory-gpu` | D3D12.X packet streams and GPU memory → host D3D12 (skeleton) |
| `victory-shader` | Xbox shader containers → host shaders |
| `victory-formats` | texture layouts, BCPack, audio codecs (skeleton) |
| `victory-pipeline` | converter trait, content-addressed cache |
| `victory-game` | Grand Theft Auto VI-specific formats, build identities, hooks |
| `apps/victory` | command-line front end |
| `xtask` | asset-policy check, git hooks |
| `tests/fixtures/hle-probe` | a stand-in "title" (our own code) for loader tests |
Everything except `victory-game` is platform-level and can be tested with
any Xbox Series title.
## Import resolution
For every `dll!function` the title imports, in order:
1. our implementation in `victory-hle::modules` (always wins);
2. the host's own function, if `HostPolicy` allows that DLL;
3. a generated stub that names the import when called (`--unimplemented
trap` breaks into the debugger and aborts; `zero` logs once and returns 0).
`victory census` shows this classification without running anything.
+49
View File
@@ -0,0 +1,49 @@
# Asset policy (rule #1)
**Nothing from the game is ever stored in this repository.** Everything is
built on the user's machine from files the user supplies. The same applies
to other titles used for testing, and to any other proprietary material.
## Not allowed
In any form (files, string literals, fixtures, snapshots, docs):
* assets: models, textures, shaders, audio, video, text, archives;
* the executable or any part of it: data sections, strings, tables,
resources, code beyond the signatures below;
* anything derived from those: converted assets, decompiled or
disassembled code, shader dumps, extracted tables, screenshots.
## Allowed
* our own code that understands formats;
* build identities: BLAKE3 of an executable, CodeView GUID/age;
* per-build offsets of functions we hook, under names we choose;
* byte-pattern signatures that locate functions or data in the executable;
* small interoperability constants (magic numbers, enum values) we write;
* synthetic test data generated by our own code.
## Where data lives
Outside the repository, configured in `victory.toml`: `game_dir` (the
user's dump), `test_titles`, and `cache_dir` for everything derived
(default `%LOCALAPPDATA%\victory\cache`).
## Enforcement
1. `.gitignore` keeps common data types out of `git status`.
2. `cargo xtask policy` (run by the pre-commit hook; install with
`cargo xtask install-hooks`) is an allowlist: files must have an allowed
type, be under 512 KiB, contain no binary data or known binary
signatures, and hold no long hex/base64 runs. Exceptions need an entry
with a reason in `xtask/src/policy.rs`.
3. At runtime, everything that writes derived data calls
`victory_core::ensure_outside_repo`.
4. Tests that need real files take their paths from environment variables
and skip when unset. They assert on properties, never on snapshots.
## If something slips through
A follow-up commit is not enough. Rewrite history
(`git filter-repo --path <file> --invert-paths`), force-push, and have
everyone re-clone.