TradeManager::Slot13RngCalleeA, entered 0 times in every measurement any lane had taken, is entered 1x/turn once a player fleet is parked on a trade-sector node, and OnAllCombatDone_Tail's RNG word delta goes 0 -> 1. Lane W3's open risk is realised, not retired: the RNG ledger and the standalone's generator model need extending by one draw site. The gate is neither freighters nor a deployed spy. It is a fleet whose LocID resolves to a node of kind 2 (TradeSector), positioned bit-equal to the sector, whose owner's bit is set in the sector's tscr mask -- which the CCC_ComRaid tech sets, taking tscr from 252 to 253 and setting ServerPlayer CnRad. Before the tech the game refuses in as many words: 'Alpha Fleet cannot raid trade sector.' Control: same guest, same build, same shim.cfg.l3probe, one End Turn on lane L3's turn-15 save -> all three inner callees 0, tail delta 0. Guest adoption: ref-turn2 hooks=off reproduces the published determinism oracle exactly. Corrects lane L3 §3.5 (the turn-15 save already had a freighter in service -- the AI's -- so 'freighters' was falsified before this lane started) and lane V2's 'trade slot 13 is draw-free'. The spy half is decoded but NOT reached: no AI system in that game has an asteroid belt, so a deploy was impossible, and spies2 is therefore still untested and stays a rule-6 hypothesis. Two new corpus saves; expect the coverage ratchet to break on CnRad, tscr=253, three rt records and a fleet whose LocID is a TradeSector. |
||
|---|---|---|
| campaign | ||
| findings | ||
| ghidra | ||
| guides | ||
| notes | ||
| objects | ||
| scripts | ||
| tools | ||
| verify | ||
| .gitignore | ||
| README.md | ||
sots-re
Reverse-engineering worklog for Sword of the Stars (2006, SOTS1) — the 32-bit DX9 original + expansions. The nitty-gritty: static/dynamic analysis notes, Ghidra & ReVa scripts, function/struct maps, D3D9 call traces, decomp progress, findings.
Where this runs
Analysis lab on spicy (PVE, 192.168.3.201):
- CT111
sots-re— Linux workspace: Ghidra + headless ReVa server, radare2/rizin/cutter, binwalk. Hosts the Samba share and this repo's working tree at/srv/re-lab/notes. - VM140
sots-re-win10— Win10 runtime + dynamic analysis (x64dbg, Cheat Engine, RenderDoc/apitrace, DXVK→CPU-Vulkan for GPU-less rendering).
Infra (guests, storage, network, share, ReVa endpoint) is documented from the
system-maintainer POV in trikilli → services/re-lab.md. This repo is everything else.
Layout
findings/— the running findings log (append-only), one file per subsystem.ghidra/— exported scripts, data-type archives, struct definitions.traces/— D3D9 / Win32 API call captures + analysis.scripts/— helper tooling (loaders, extractors, parsers).notes/— session notes, scratch, hypotheses.
Ownership / legality
Game binaries come from the owner's own GOG/Steam copy. RE is for personal
interoperability, bug-fixing, and preservation. Binaries themselves are not committed
here (see .gitignore) — they live on the lab's Samba share /srv/re-lab/samples.
Campaign (how this repo is run)
A 4-agent crew (defined in ~/.claude/agents/re-*.md) runs the exploration:
re-quartermaster (backlog + board) → re-analyst (maps via ReVa) →
re-verifier (proves vs real data; old-vs-new differential once reimpl starts) →
re-scribe (files the note, links it, commits).
campaign/board.md— live status board (start here).- Live tracking = Forgejo issues on
alex/sots-re(labelsstatus/*are the kanban columns;type/*,conf/*).campaign/board.mdis the editable mirror — publish withscripts/forgejo_campaign.py bootstrap(needsFORGEJO_TOKEN). campaign/backlog.md— prioritized target queue.campaign/open-questions.md— unresolved threads.findings/_template.md— the record format every finding follows.findings/{objects,control-flow,subsystems}/— the growing engine map.verify/{parsers,traces,harness,results}/— validation: struct parsers now, golden-trace replay + shim compare-mode for reimplementation.ghidra/— exported scripts + datatype archives.
Approach & north star: findings/00-strategy.md. Binary facts: findings/01-fingerprint.md.
Sibling repo
alex/sots-engine — the from-scratch engine source (clean-room, public-capable). This repo keeps the
evidence + planning for both; binary facts cross over only via ghidra/addresses.json → tools/gen_addresses.py.
guides/re-windows-2000s-howto.md— annotated bibliography + how-to for RE of mid-2000s MSVC/DX9 Windows games, with our-experience call-outs.