paavohtl Claude Opus 4.6 (1M context) commited on
Commit
e5f8547
Β·
1 Parent(s): 1b797a7

refactor: rename openwa-wormkit crate to openwa-dll, output openwa.dll

Browse files

The project hasn't been a WormKit DLL for a long time β€” it requires a
custom launcher. Rename the crate to openwa-dll with output openwa.dll
to match the rest of the naming convention (openwa-core, openwa-launcher).

Updates all references across Cargo.toml, Rust sources, PowerShell scripts,
CLAUDE.md, skill files, and docs. Replaces stale "wormkit hook/shim"
comments with accurate descriptions. Three remaining "WormKit" references
are legitimate (refer to the actual WA modding framework).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

This view is limited to 50 files because it contains too many changes. Β  See raw diff
Files changed (50) hide show
  1. .claude/skills/debug-cli/SKILL.md +1 -1
  2. .claude/skills/desync-debug/SKILL.md +3 -3
  3. .claude/skills/type-struct/SKILL.md +1 -1
  4. CLAUDE.md +4 -4
  5. Cargo.lock +13 -13
  6. crates/openwa-core/src/audio/sound_ops.rs +1 -1
  7. crates/openwa-core/src/audio/speech_ops.rs +1 -1
  8. crates/openwa-core/src/engine/ddgame_constructor.rs +1 -1
  9. crates/openwa-core/src/engine/team_ops.rs +1 -1
  10. crates/openwa-core/src/game/frontend.rs +1 -1
  11. crates/openwa-core/src/game/weapon_fire.rs +1 -1
  12. crates/openwa-core/src/game/weapon_release.rs +1 -1
  13. crates/openwa-core/src/render/spr.rs +4 -4
  14. crates/openwa-debugui/src/lib.rs +1 -1
  15. crates/{openwa-wormkit β†’ openwa-dll}/CLAUDE.md +2 -2
  16. crates/{openwa-wormkit β†’ openwa-dll}/Cargo.toml +3 -2
  17. crates/{openwa-wormkit β†’ openwa-dll}/src/debug_server.rs +0 -0
  18. crates/{openwa-wormkit β†’ openwa-dll}/src/debug_sync.rs +0 -0
  19. crates/{openwa-wormkit β†’ openwa-dll}/src/debug_ui.rs +0 -0
  20. crates/{openwa-wormkit β†’ openwa-dll}/src/debug_watchpoint.rs +0 -0
  21. crates/{openwa-wormkit β†’ openwa-dll}/src/hook.rs +0 -0
  22. crates/{openwa-wormkit β†’ openwa-dll}/src/lib.rs +1 -1
  23. crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/config.rs +0 -0
  24. crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/ddgame_init.rs +0 -0
  25. crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/debug_utils.rs +0 -0
  26. crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/display.rs +0 -0
  27. crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/file_isolation.rs +0 -0
  28. crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/frame_hook.rs +0 -0
  29. crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/frontend.rs +0 -0
  30. crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/game_session.rs +0 -0
  31. crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/game_state_hooks.rs +0 -0
  32. crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/hardware_init.rs +0 -0
  33. crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/headless.rs +0 -0
  34. crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/mod.rs +0 -0
  35. crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/music.rs +0 -0
  36. crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/render.rs +0 -0
  37. crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/replay.rs +0 -0
  38. crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/replay_test.rs +0 -0
  39. crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/scheme.rs +0 -0
  40. crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/sound.rs +1 -1
  41. crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/speech.rs +0 -0
  42. crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/sprite.rs +0 -0
  43. crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/task/cloud.rs +1 -1
  44. crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/task/filter.rs +1 -1
  45. crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/task/mod.rs +0 -0
  46. crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/team.rs +1 -1
  47. crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/trace_desync.rs +0 -0
  48. crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/weapon.rs +1 -1
  49. crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/weapon_release.rs +1 -1
  50. crates/{openwa-wormkit β†’ openwa-dll}/src/snapshot.rs +0 -0
.claude/skills/debug-cli/SKILL.md CHANGED
@@ -278,4 +278,4 @@ Use `inspect` to see all named fields with formatted values, or `read` with a fi
278
  - Both are independent β€” you can use the CLI without the UI and vice versa
279
  - Protocol: MessagePack over TCP with 4-byte LE length-prefix framing
280
  - The `openwa-debug` binary is built to `target/i686-pc-windows-msvc/release/openwa-debug.exe`
281
- - Source: `crates/openwa-debug-cli/` (CLI), `crates/openwa-debug-proto/` (protocol), `crates/openwa-wormkit/src/debug_server.rs` (server)
 
278
  - Both are independent β€” you can use the CLI without the UI and vice versa
279
  - Protocol: MessagePack over TCP with 4-byte LE length-prefix framing
280
  - The `openwa-debug` binary is built to `target/i686-pc-windows-msvc/release/openwa-debug.exe`
281
+ - Source: `crates/openwa-debug-cli/` (CLI), `crates/openwa-debug-proto/` (protocol), `crates/openwa-dll/src/debug_server.rs` (server)
.claude/skills/desync-debug/SKILL.md CHANGED
@@ -47,9 +47,9 @@ See "Hardware Watchpoints" in CLAUDE.md for watchpoint env vars (`OPENWA_WATCH_F
47
 
48
  ## Key Files
49
 
50
- - `crates/openwa-wormkit/src/replacements/trace_desync.rs` -- Per-frame checksum logging
51
- - `crates/openwa-wormkit/src/debug_watchpoint.rs` -- Hardware watchpoint instrumentation
52
- - `crates/openwa-wormkit/src/replacements/frame_hook.rs` -- Frame hook (watchpoint arming)
53
  - `crates/openwa-test-runner/` -- Test runner that detects failures
54
  - `docs/re-notes/desync-investigation.md` -- Detailed case study
55
  - `trace-desync.ps1` -- Convenience script
 
47
 
48
  ## Key Files
49
 
50
+ - `crates/openwa-dll/src/replacements/trace_desync.rs` -- Per-frame checksum logging
51
+ - `crates/openwa-dll/src/debug_watchpoint.rs` -- Hardware watchpoint instrumentation
52
+ - `crates/openwa-dll/src/replacements/frame_hook.rs` -- Frame hook (watchpoint arming)
53
  - `crates/openwa-test-runner/` -- Test runner that detects failures
54
  - `docs/re-notes/desync-investigation.md` -- Detailed case study
55
  - `trace-desync.ps1` -- Convenience script
.claude/skills/type-struct/SKILL.md CHANGED
@@ -63,7 +63,7 @@ Compute offsets relative to the struct base. Verify with:
63
 
64
  ### 7. Verify
65
 
66
- - `cargo build --release -p openwa-wormkit` β€” must compile clean, zero warnings
67
  - Run `/replay-test` (headful + headless) to verify runtime correctness
68
  - Check that `sizeof` assertion passes (struct size matches allocation size)
69
 
 
63
 
64
  ### 7. Verify
65
 
66
+ - `cargo build --release -p openwa-dll` β€” must compile clean, zero warnings
67
  - Run `/replay-test` (headful + headless) to verify runtime correctness
68
  - Check that `sizeof` assertion passes (struct size matches allocation size)
69
 
CLAUDE.md CHANGED
@@ -2,7 +2,7 @@
2
 
3
  ## Project
4
 
5
- OpenWA (short for "Open Worms Armageddon") is an incremental Rust reimplementation of Worms Armageddon 3.8.1 (Steam). The replacement strategy is the same as was used in OpenRCT2: a custom launcher (`openwa-launcher`) injects a DLL (`openwa-wormkit`) into a suspended game process, which replaces game functions with Rust implementations (from `openwa-core`).
6
 
7
  The original WA.exe is a 32-bit x86 Windows PE binary built with MSVC 2005 + MFC. All Rust code targets `i686-pc-windows-msvc`.
8
 
@@ -10,7 +10,7 @@ The original WA.exe is a 32-bit x86 Windows PE binary built with MSVC 2005 + MFC
10
 
11
  - **`openwa-core`** β€” Types, addresses, parsers, ASLR rebasing, typed WA function wrappers, **and game logic**. The source of truth for all reverse-engineered type layouts, known addresses, and Rust reimplementations of WA functions. Contains `registry` (structured address database + field registries), `rebase` (ASLR delta), `wa_call` (calling convention helpers), `wa/` (typed handle wrappers), and game logic modules (`game/weapon_fire.rs`, `game/weapon_release.rs`, `audio/sound_ops.rs`, `engine/team_ops.rs`).
12
  - **`openwa-derive`** β€” Proc macro crate. Provides `#[derive(FieldRegistry)]` for struct field maps and `#[vtable(...)]` for typed vtable definitions with introspection, calling wrappers, and replacement support.
13
- - **`openwa-wormkit`** β€” Unified WormKit cdylib: thin hook installation shims (trampolines, `usercall_trampoline!`, `install()`) that wire core's game logic into WA.exe via MinHook. Logs to `OpenWA.log`. Runs registry-driven startup checks automatically at load.
14
  - **`openwa-test-runner`** β€” Headless replay test runner (`openwa-test` binary). Discovers replay tests, runs them concurrently via WA.exe's `/getlog` mode, compares output logs. See "Replay Testing" section.
15
  - **`openwa-launcher`** β€” Launches WA.exe with the DLL injected via CREATE_SUSPENDED + remote thread.
16
  - **`openwa-debugui`** β€” In-process egui debug window (entity census, struct inspector, cheats). Enabled via `OPENWA_DEBUG_UI=1` + `debug-ui` cargo feature.
@@ -60,7 +60,7 @@ Use the `/debug-cli` skill for live memory inspection, struct inspection, frame-
60
 
61
  ## Hardware Watchpoints
62
 
63
- `crates/openwa-wormkit/src/debug_watchpoint.rs` β€” x86 debug register instrumentation (DR0-DR3) for answering "who writes this memory?" without an external debugger. Uses INT3β†’VEH trick, logs symbolicated stack traces via `registry::format_va()`. Max 4 watchpoints per run (hardware limit).
64
 
65
  **API:** `arm_watchpoint(base_ptr, offset, size)` sets a write watchpoint. `prepare()` initializes the VEH handler, `teardown()` removes it. Can be armed at any point during execution β€” on object allocation, at a specific frame via env var, or manually from debug server commands.
66
 
@@ -91,7 +91,7 @@ These are critical β€” wrong conventions cause stack corruption and crashes.
91
 
92
  ## Hooking & Desync Debugging
93
 
94
- See `crates/openwa-wormkit/CLAUDE.md` for hooking patterns (passthrough, full replacement, vtable, trap), bridge function patterns, `usercall_trampoline!` macro, and hook installation details.
95
 
96
  Use the `/desync-debug` skill for desync diagnosis (trace-desync, per-frame analysis). Only after a headless test has already detected a failure.
97
 
 
2
 
3
  ## Project
4
 
5
+ OpenWA (short for "Open Worms Armageddon") is an incremental Rust reimplementation of Worms Armageddon 3.8.1 (Steam). The replacement strategy is the same as was used in OpenRCT2: a custom launcher (`openwa-launcher`) injects a DLL (`openwa-dll`) into a suspended game process, which replaces game functions with Rust implementations (from `openwa-core`).
6
 
7
  The original WA.exe is a 32-bit x86 Windows PE binary built with MSVC 2005 + MFC. All Rust code targets `i686-pc-windows-msvc`.
8
 
 
10
 
11
  - **`openwa-core`** β€” Types, addresses, parsers, ASLR rebasing, typed WA function wrappers, **and game logic**. The source of truth for all reverse-engineered type layouts, known addresses, and Rust reimplementations of WA functions. Contains `registry` (structured address database + field registries), `rebase` (ASLR delta), `wa_call` (calling convention helpers), `wa/` (typed handle wrappers), and game logic modules (`game/weapon_fire.rs`, `game/weapon_release.rs`, `audio/sound_ops.rs`, `engine/team_ops.rs`).
12
  - **`openwa-derive`** β€” Proc macro crate. Provides `#[derive(FieldRegistry)]` for struct field maps and `#[vtable(...)]` for typed vtable definitions with introspection, calling wrappers, and replacement support.
13
+ - **`openwa-dll`** β€” Injected DLL (`openwa.dll`): thin hook installation shims (trampolines, `usercall_trampoline!`, `install()`) that wire core's game logic into WA.exe via MinHook. Logs to `OpenWA.log`. Runs registry-driven startup checks automatically at load.
14
  - **`openwa-test-runner`** β€” Headless replay test runner (`openwa-test` binary). Discovers replay tests, runs them concurrently via WA.exe's `/getlog` mode, compares output logs. See "Replay Testing" section.
15
  - **`openwa-launcher`** β€” Launches WA.exe with the DLL injected via CREATE_SUSPENDED + remote thread.
16
  - **`openwa-debugui`** β€” In-process egui debug window (entity census, struct inspector, cheats). Enabled via `OPENWA_DEBUG_UI=1` + `debug-ui` cargo feature.
 
60
 
61
  ## Hardware Watchpoints
62
 
63
+ `crates/openwa-dll/src/debug_watchpoint.rs` β€” x86 debug register instrumentation (DR0-DR3) for answering "who writes this memory?" without an external debugger. Uses INT3β†’VEH trick, logs symbolicated stack traces via `registry::format_va()`. Max 4 watchpoints per run (hardware limit).
64
 
65
  **API:** `arm_watchpoint(base_ptr, offset, size)` sets a write watchpoint. `prepare()` initializes the VEH handler, `teardown()` removes it. Can be armed at any point during execution β€” on object allocation, at a specific frame via env var, or manually from debug server commands.
66
 
 
91
 
92
  ## Hooking & Desync Debugging
93
 
94
+ See `crates/openwa-dll/CLAUDE.md` for hooking patterns (passthrough, full replacement, vtable, trap), bridge function patterns, `usercall_trampoline!` macro, and hook installation details.
95
 
96
  Use the `/desync-debug` skill for desync diagnosis (trace-desync, per-frame analysis). Only after a headless test has already detected a failure.
97
 
Cargo.lock CHANGED
@@ -1524,32 +1524,32 @@ dependencies = [
1524
  ]
1525
 
1526
  [[package]]
1527
- name = "openwa-launcher"
1528
  version = "0.1.0"
1529
  dependencies = [
1530
- "openwa-config",
 
 
 
 
 
 
 
1531
  ]
1532
 
1533
  [[package]]
1534
- name = "openwa-test-runner"
1535
  version = "0.1.0"
1536
  dependencies = [
1537
- "chrono",
1538
  "openwa-config",
1539
  ]
1540
 
1541
  [[package]]
1542
- name = "openwa-wormkit"
1543
  version = "0.1.0"
1544
  dependencies = [
1545
- "heapless",
1546
- "hound",
1547
- "minhook",
1548
- "openwa-core",
1549
- "openwa-debug-proto",
1550
- "openwa-debugui",
1551
- "windows",
1552
- "windows-sys 0.59.0",
1553
  ]
1554
 
1555
  [[package]]
 
1524
  ]
1525
 
1526
  [[package]]
1527
+ name = "openwa-dll"
1528
  version = "0.1.0"
1529
  dependencies = [
1530
+ "heapless",
1531
+ "hound",
1532
+ "minhook",
1533
+ "openwa-core",
1534
+ "openwa-debug-proto",
1535
+ "openwa-debugui",
1536
+ "windows",
1537
+ "windows-sys 0.59.0",
1538
  ]
1539
 
1540
  [[package]]
1541
+ name = "openwa-launcher"
1542
  version = "0.1.0"
1543
  dependencies = [
 
1544
  "openwa-config",
1545
  ]
1546
 
1547
  [[package]]
1548
+ name = "openwa-test-runner"
1549
  version = "0.1.0"
1550
  dependencies = [
1551
+ "chrono",
1552
+ "openwa-config",
 
 
 
 
 
 
1553
  ]
1554
 
1555
  [[package]]
crates/openwa-core/src/audio/sound_ops.rs CHANGED
@@ -1,7 +1,7 @@
1
  //! Sound playback operations.
2
  //!
3
  //! Pure Rust reimplementations of WA.exe sound functions. Called from
4
- //! wormkit hook trampolines and from other core game logic (weapon fire, etc.).
5
  //!
6
  //! Original WA functions:
7
  //! - PlaySoundGlobal queue insertion (0x546E20)
 
1
  //! Sound playback operations.
2
  //!
3
  //! Pure Rust reimplementations of WA.exe sound functions. Called from
4
+ //! hook trampolines in openwa-dll and from other core game logic (weapon fire, etc.).
5
  //!
6
  //! Original WA functions:
7
  //! - PlaySoundGlobal queue insertion (0x546E20)
crates/openwa-core/src/audio/speech_ops.rs CHANGED
@@ -1,7 +1,7 @@
1
  //! Speech / fanfare / FE SFX operations.
2
  //!
3
  //! Pure Rust reimplementations of WA.exe speech and fanfare functions.
4
- //! Called from wormkit hook trampolines.
5
  //!
6
  //! Original WA functions:
7
  //! - PlayFeSfx (0x4D7960)
 
1
  //! Speech / fanfare / FE SFX operations.
2
  //!
3
  //! Pure Rust reimplementations of WA.exe speech and fanfare functions.
4
+ //! Called from hook trampolines in openwa-dll.
5
  //!
6
  //! Original WA functions:
7
  //! - PlayFeSfx (0x4D7960)
crates/openwa-core/src/engine/ddgame_constructor.rs CHANGED
@@ -36,7 +36,7 @@ pub use crate::task::bit_grid::bit_grid_init;
36
  // Pure Rust implementations of DDGame sub-functions
37
  // ============================================================
38
  // These are called both by create_ddgame() and by MinHook
39
- // trampolines in openwa-wormkit/replacements/ddgame_init.rs.
40
 
41
  /// Pure Rust implementation of DDGame__InitFields (0x526120).
42
  ///
 
36
  // Pure Rust implementations of DDGame sub-functions
37
  // ============================================================
38
  // These are called both by create_ddgame() and by MinHook
39
+ // trampolines in openwa-dll/replacements/ddgame_init.rs.
40
 
41
  /// Pure Rust implementation of DDGame__InitFields (0x526120).
42
  ///
crates/openwa-core/src/engine/team_ops.rs CHANGED
@@ -1,7 +1,7 @@
1
  //! Team and worm state accessor functions.
2
  //!
3
  //! Pure Rust reimplementations of WA.exe functions that access the TeamArenaState
4
- //! area (DDGame + 0x4628). These are called from wormkit hook trampolines.
5
  //!
6
  //! Original WA functions:
7
  //! - CountTeamsByAlliance (0x522030)
 
1
  //! Team and worm state accessor functions.
2
  //!
3
  //! Pure Rust reimplementations of WA.exe functions that access the TeamArenaState
4
+ //! area (DDGame + 0x4628). Called from hook trampolines in openwa-dll.
5
  //!
6
  //! Original WA functions:
7
  //! - CountTeamsByAlliance (0x522030)
crates/openwa-core/src/game/frontend.rs CHANGED
@@ -16,7 +16,7 @@
16
  ///
17
  /// Source: Ghidra decompilation of Frontend__MainNavigationLoop (0x4E6440),
18
  /// 65 FrontendChangeScreen call sites, wkJellyWorm Lobby.cpp,
19
- /// + runtime observation via openwa-wormkit
20
  #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
21
  #[repr(i32)]
22
  pub enum ScreenId {
 
16
  ///
17
  /// Source: Ghidra decompilation of Frontend__MainNavigationLoop (0x4E6440),
18
  /// 65 FrontendChangeScreen call sites, wkJellyWorm Lobby.cpp,
19
+ /// + runtime observation via openwa-dll
20
  #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
21
  #[repr(i32)]
22
  pub enum ScreenId {
crates/openwa-core/src/game/weapon_fire.rs CHANGED
@@ -1,7 +1,7 @@
1
  //! Weapon fire dispatch, ammo management, and object creation.
2
  //!
3
  //! Pure Rust reimplementations of WA.exe weapon functions. Called from
4
- //! wormkit hook trampolines.
5
  //!
6
  //! Original WA functions:
7
  //! - AddAmmo (0x522640), SubtractAmmo (0x522680), GetAmmo (0x5225E0)
 
1
  //! Weapon fire dispatch, ammo management, and object creation.
2
  //!
3
  //! Pure Rust reimplementations of WA.exe weapon functions. Called from
4
+ //! hook trampolines in openwa-dll.
5
  //!
6
  //! Original WA functions:
7
  //! - AddAmmo (0x522640), SubtractAmmo (0x522680), GetAmmo (0x5225E0)
crates/openwa-core/src/game/weapon_release.rs CHANGED
@@ -1,7 +1,7 @@
1
  //! WeaponRelease orchestration and spawn effect.
2
  //!
3
  //! Pure Rust reimplementation of WA.exe WeaponRelease (0x51C3D0) and
4
- //! SpawnEffect (0x547C30). Called from wormkit hook trampolines.
5
 
6
  use crate::audio::{KnownSoundId, SoundId};
7
  use crate::fixed::Fixed;
 
1
  //! WeaponRelease orchestration and spawn effect.
2
  //!
3
  //! Pure Rust reimplementation of WA.exe WeaponRelease (0x51C3D0) and
4
+ //! SpawnEffect (0x547C30). Called from hook trampolines in openwa-dll.
5
 
6
  use crate::audio::{KnownSoundId, SoundId};
7
  use crate::fixed::Fixed;
crates/openwa-core/src/render/spr.rs CHANGED
@@ -2,8 +2,8 @@
2
  //!
3
  //! WA's sprite format stores paletted animated sprites with per-frame metadata.
4
  //! This module provides both a clean Rust parser (`ParsedSprite`) for tooling
5
- //! and shared metadata extraction (`parse_spr_header`) used by WormKit hook
6
- //! replacements.
7
 
8
  use crate::render::sprite::SpriteFrame;
9
 
@@ -86,7 +86,7 @@ fn align4(offset: usize) -> usize {
86
  /// Parse `.spr` header and compute data region offsets.
87
  ///
88
  /// This is a pure function with no WA dependencies. Both `ParsedSprite::parse`
89
- /// and the WormKit ProcessSprite hook build on this.
90
  pub fn parse_spr_header(data: &[u8]) -> Result<SprHeader, SprError> {
91
  // Minimum: 4 (unused) + 4 (data_size) + 2 (header_flags) + 2 (palette_count) = 12
92
  if data.len() < 12 {
@@ -207,7 +207,7 @@ pub fn parse_spr_header(data: &[u8]) -> Result<SprHeader, SprError> {
207
  /// raw bitmap pixel indices, and frame metadata. Suitable for standalone
208
  /// tooling, tests, and debugging.
209
  ///
210
- /// For WormKit hook replacements, `parse_spr_header` is used directly
211
  /// with in-place buffer operations instead.
212
  #[derive(Debug, Clone)]
213
  pub struct ParsedSprite {
 
2
  //!
3
  //! WA's sprite format stores paletted animated sprites with per-frame metadata.
4
  //! This module provides both a clean Rust parser (`ParsedSprite`) for tooling
5
+ //! and shared metadata extraction (`parse_spr_header`) used by hook
6
+ //! replacements in openwa-dll.
7
 
8
  use crate::render::sprite::SpriteFrame;
9
 
 
86
  /// Parse `.spr` header and compute data region offsets.
87
  ///
88
  /// This is a pure function with no WA dependencies. Both `ParsedSprite::parse`
89
+ /// and the ProcessSprite hook replacement build on this.
90
  pub fn parse_spr_header(data: &[u8]) -> Result<SprHeader, SprError> {
91
  // Minimum: 4 (unused) + 4 (data_size) + 2 (header_flags) + 2 (palette_count) = 12
92
  if data.len() < 12 {
 
207
  /// raw bitmap pixel indices, and frame metadata. Suitable for standalone
208
  /// tooling, tests, and debugging.
209
  ///
210
+ /// For hook replacements in openwa-dll, `parse_spr_header` is used directly
211
  /// with in-place buffer operations instead.
212
  #[derive(Debug, Clone)]
213
  pub struct ParsedSprite {
crates/openwa-debugui/src/lib.rs CHANGED
@@ -7,7 +7,7 @@
7
  //! # Usage
8
  //!
9
  //! ```rust
10
- //! // In openwa-wormkit lib.rs, after rebase::init() and hook installation:
11
  //! if std::env::var("OPENWA_DEBUG_UI").is_ok() {
12
  //! openwa_debugui::spawn();
13
  //! }
 
7
  //! # Usage
8
  //!
9
  //! ```rust
10
+ //! // In openwa-dll lib.rs, after rebase::init() and hook installation:
11
  //! if std::env::var("OPENWA_DEBUG_UI").is_ok() {
12
  //! openwa_debugui::spawn();
13
  //! }
crates/{openwa-wormkit β†’ openwa-dll}/CLAUDE.md RENAMED
@@ -1,6 +1,6 @@
1
- # openwa-wormkit
2
 
3
- Unified WormKit cdylib (`wkOpenWA.dll`). Contains thin hook installation shims that wire `openwa-core` game logic into WA.exe via MinHook. Game logic itself lives in `openwa-core` β€” this crate is purely the wiring layer.
4
 
5
  See the root `CLAUDE.md` for project-wide rules: architecture, calling conventions, ASLR rebasing, FFI style, design conventions.
6
 
 
1
+ # openwa-dll
2
 
3
+ Injected DLL (`openwa.dll`). Contains thin hook installation shims that wire `openwa-core` game logic into WA.exe via MinHook. Game logic itself lives in `openwa-core` β€” this crate is purely the wiring layer.
4
 
5
  See the root `CLAUDE.md` for project-wide rules: architecture, calling conventions, ASLR rebasing, FFI style, design conventions.
6
 
crates/{openwa-wormkit β†’ openwa-dll}/Cargo.toml RENAMED
@@ -1,10 +1,11 @@
1
  [package]
2
- name = "openwa-wormkit"
3
  version = "0.1.0"
4
  edition = "2021"
5
- description = "WormKit DLL that replaces WA.exe functions with Rust reimplementations"
6
 
7
  [lib]
 
8
  crate-type = ["cdylib"]
9
 
10
  [features]
 
1
  [package]
2
+ name = "openwa-dll"
3
  version = "0.1.0"
4
  edition = "2021"
5
+ description = "Injected DLL that replaces WA.exe functions with Rust reimplementations"
6
 
7
  [lib]
8
+ name = "openwa"
9
  crate-type = ["cdylib"]
10
 
11
  [features]
crates/{openwa-wormkit β†’ openwa-dll}/src/debug_server.rs RENAMED
File without changes
crates/{openwa-wormkit β†’ openwa-dll}/src/debug_sync.rs RENAMED
File without changes
crates/{openwa-wormkit β†’ openwa-dll}/src/debug_ui.rs RENAMED
File without changes
crates/{openwa-wormkit β†’ openwa-dll}/src/debug_watchpoint.rs RENAMED
File without changes
crates/{openwa-wormkit β†’ openwa-dll}/src/hook.rs RENAMED
File without changes
crates/{openwa-wormkit β†’ openwa-dll}/src/lib.rs RENAMED
@@ -73,7 +73,7 @@ fn run() -> Result<(), String> {
73
 
74
  let delta = openwa_core::rebase::init();
75
  let _ = log_line(&format!(
76
- "=== OpenWA WormKit DLL loaded ===\n ASLR delta: 0x{delta:08X}"
77
  ));
78
 
79
  replacements::install_all()?;
 
73
 
74
  let delta = openwa_core::rebase::init();
75
  let _ = log_line(&format!(
76
+ "=== OpenWA DLL loaded ===\n ASLR delta: 0x{delta:08X}"
77
  ));
78
 
79
  replacements::install_all()?;
crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/config.rs RENAMED
File without changes
crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/ddgame_init.rs RENAMED
File without changes
crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/debug_utils.rs RENAMED
File without changes
crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/display.rs RENAMED
File without changes
crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/file_isolation.rs RENAMED
File without changes
crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/frame_hook.rs RENAMED
File without changes
crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/frontend.rs RENAMED
File without changes
crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/game_session.rs RENAMED
File without changes
crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/game_state_hooks.rs RENAMED
File without changes
crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/hardware_init.rs RENAMED
File without changes
crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/headless.rs RENAMED
File without changes
crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/mod.rs RENAMED
File without changes
crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/music.rs RENAMED
File without changes
crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/render.rs RENAMED
File without changes
crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/replay.rs RENAMED
File without changes
crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/replay_test.rs RENAMED
File without changes
crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/scheme.rs RENAMED
File without changes
crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/sound.rs RENAMED
@@ -1,6 +1,6 @@
1
  //! Sound playback hooks.
2
  //!
3
- //! Thin wormkit shim β€” game logic lives in `openwa_core::audio::sound_ops`.
4
  //! This file contains hook entry points, trampolines, and installation.
5
  //!
6
  //! Hooks:
 
1
  //! Sound playback hooks.
2
  //!
3
+ //! Thin hook shim β€” game logic lives in `openwa_core::audio::sound_ops`.
4
  //! This file contains hook entry points, trampolines, and installation.
5
  //!
6
  //! Hooks:
crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/speech.rs RENAMED
File without changes
crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/sprite.rs RENAMED
File without changes
crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/task/cloud.rs RENAMED
@@ -1,6 +1,6 @@
1
  //! CTaskCloud vtable hooks and CreateWeatherFilter replacement.
2
  //!
3
- //! Thin wormkit shim β€” game logic lives in `openwa_core::task::cloud`.
4
 
5
  use openwa_core::address::va;
6
  use openwa_core::log::log_line;
 
1
  //! CTaskCloud vtable hooks and CreateWeatherFilter replacement.
2
  //!
3
+ //! Thin hook shim β€” game logic lives in `openwa_core::task::cloud`.
4
 
5
  use openwa_core::address::va;
6
  use openwa_core::log::log_line;
crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/task/filter.rs RENAMED
@@ -1,6 +1,6 @@
1
  //! CTaskFilter vtable hooks.
2
  //!
3
- //! Thin wormkit shim β€” game logic lives in `openwa_core::task::filter::filter_handle_message`.
4
 
5
  use openwa_core::address::va;
6
  use openwa_core::log::log_line;
 
1
  //! CTaskFilter vtable hooks.
2
  //!
3
+ //! Thin hook shim β€” game logic lives in `openwa_core::task::filter::filter_handle_message`.
4
 
5
  use openwa_core::address::va;
6
  use openwa_core::log::log_line;
crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/task/mod.rs RENAMED
File without changes
crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/team.rs RENAMED
@@ -1,6 +1,6 @@
1
  //! Team and worm state accessor hooks.
2
  //!
3
- //! Thin wormkit shim β€” all game logic lives in `openwa_core::engine::team_ops`.
4
  //! This file contains only usercall trampolines and hook installation.
5
 
6
  use openwa_core::address::va;
 
1
  //! Team and worm state accessor hooks.
2
  //!
3
+ //! Thin hook shim β€” all game logic lives in `openwa_core::engine::team_ops`.
4
  //! This file contains only usercall trampolines and hook installation.
5
 
6
  use openwa_core::address::va;
crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/trace_desync.rs RENAMED
File without changes
crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/weapon.rs RENAMED
@@ -1,6 +1,6 @@
1
  //! Weapon hooks.
2
  //!
3
- //! Thin wormkit shim β€” all game logic lives in `openwa_core::game::weapon_fire`.
4
  //! This file contains usercall trampolines, passthrough hooks, and installation.
5
  //!
6
  //! Hooks:
 
1
  //! Weapon hooks.
2
  //!
3
+ //! Thin hook shim β€” all game logic lives in `openwa_core::game::weapon_fire`.
4
  //! This file contains usercall trampolines, passthrough hooks, and installation.
5
  //!
6
  //! Hooks:
crates/{openwa-wormkit β†’ openwa-dll}/src/replacements/weapon_release.rs RENAMED
@@ -1,6 +1,6 @@
1
  //! WeaponRelease hook (0x51C3D0) and SpawnEffect (0x547C30).
2
  //!
3
- //! Thin wormkit shim β€” game logic lives in `openwa_core::game::weapon_release`.
4
  //! This file contains usercall trampolines and hook installation.
5
 
6
  use openwa_core::address::va;
 
1
  //! WeaponRelease hook (0x51C3D0) and SpawnEffect (0x547C30).
2
  //!
3
+ //! Thin hook shim β€” game logic lives in `openwa_core::game::weapon_release`.
4
  //! This file contains usercall trampolines and hook installation.
5
 
6
  use openwa_core::address::va;
crates/{openwa-wormkit β†’ openwa-dll}/src/snapshot.rs RENAMED
File without changes