From 84e3cb5a77c564aed479c9eb920d259c596c7661 Mon Sep 17 00:00:00 2001 From: erik Date: Mon, 9 Feb 2026 00:15:06 +0100 Subject: [PATCH] Update docs with Phase 6 progress CLAUDE.md: Update status to Phase 6 in progress, add new pitfalls and key files discovered during verification. PLAN.md: Mark Steps 1, 2, and 2b complete with results (50/50 CLSIDs, 13/13 DAT tests). Add DecalDat functional test as Step 2b. Co-Authored-By: Claude Opus 4.6 --- CLAUDE.md | 24 +++++++++++++++++++----- docs/PLAN.md | 34 +++++++++++++++++----------------- 2 files changed, 36 insertions(+), 22 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index cdae6c1..2120ddb 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -5,26 +5,35 @@ Open-source rebuild of **Decal**, the plugin framework for Asheron's Call. The original v2.9.8.3 is closed-source. This project produces a fully open-source drop-in replacement with identical COM interfaces and GUIDs for plugin compatibility. -## Current Status: All 5 Phases Complete (Skeleton) +## Current Status: Phase 6 — Verification In Progress The solution compiles with **25 C# projects, 0 errors**. Most COM server methods are **stubs** that need real implementations. See `docs/PLAN.md` for the full plan. -### What's built: +### What's built (Phases 1-5): - **Phase 1**: 14 decompiled .NET projects (Interop.*, Adapter, FileService, DecalUtil) - **Phase 2**: 10 native DLLs rewritten as C# COM servers with matching GUIDs - **Phase 3**: C++ shims — Inject.DLL (D3D9 hooking) + LauncherHook.DLL - **Phase 4**: DenAgent WinForms tray app replacing the MFC original - **Phase 5**: WiX installer + build script -### What's next (Phase 6): -Bottom-up verification — swap one original DLL at a time with our C# version, -test against a running AC client, fix what breaks. See `docs/PLAN.md` "Phase 6". +### Phase 6 Progress: +- **DecalDat**: WORKING — 13/13 tests pass against real AC DAT files +- **COM Registration**: PASS — 50/50 CLSIDs register and verify (0 GUID mismatches) +- **Tools**: `tools/Test-ComRegistration.ps1` — regasm + registry verification +- **Tests**: `Managed/Decal.DecalDat.Tests/` — console app smoke tests + +### What's next: +- Smoke test DenAgent tray app +- Integration test — swap one DLL at a time vs original Decal +- Plugin compatibility (VTank, Mag-Tools) ## Key Files - `Managed/Decal.sln` — Main solution (25 projects) - `Managed/Directory.Build.props` — Shared build settings (net472, x86) - `Managed/Decal.Interop.*/` — COM interface contracts (the spec for everything) +- `Managed/Decal.DecalDat.Tests/` — Smoke tests for DAT file I/O +- `tools/Test-ComRegistration.ps1` — COM registration verification (regasm + registry check) - `Native/InjectModern/` — Inject.DLL C++ source (~530 lines) - `Native/LauncherHookModern/` — LauncherHook.DLL C++ source (~330 lines) - `Native/` — Old C++ source (reference for algorithms, NOT part of the build) @@ -57,6 +66,11 @@ cmake --build build --config Release - LongValueKey enum: correct names are `keyStackCount`, `keyContainer` - tagPOINT defined in Interop.Inject, needed by Interop.Render → add ProjectReference - ICommandEvents delegates ambiguous between Interop.Controls and Interop.Inject → use `using` aliases +- `GenerateAssemblyInfo=False` → use `[assembly: InternalsVisibleTo()]` attribute, not MSBuild items +- `AppendTargetFrameworkToOutputPath=false` → DLLs at `bin\Release\`, NOT `bin\Release\net472\` +- 32-bit regasm registers to `WOW6432Node` on 64-bit Windows — check both registry views +- DAT file BTree root is at offset 0x160, NOT 0x148 (old C++ code was wrong) +- BTree entries are 24 bytes (not 12) — see `dat-format.md` in memory ## Goal **Pixel-perfect drop-in replacement** for closed-source Decal v2.9.8.3, diff --git a/docs/PLAN.md b/docs/PLAN.md index 843032a..d0ba53a 100644 --- a/docs/PLAN.md +++ b/docs/PLAN.md @@ -92,32 +92,32 @@ All preserve original CLSIDs/GUIDs for plugin compatibility. --- -## Phase 6: Verification & Implementation (NEXT) +## Phase 6: Verification & Implementation (IN PROGRESS) Goal: **Pixel-perfect drop-in replacement** for the closed-source Decal v2.9.8.3. Strategy: **Bottom-up, one DLL at a time.** Replace one original DLL with our C# version while keeping all other original DLLs in place. Test. Move to the next. -### Step 1: Build on Windows +### Step 1: Build on Windows ✅ COMPLETE ``` -# C++ native projects (requires VS 2022 + Windows SDK) -cd Native -cmake -G "Visual Studio 17 2022" -A Win32 -B build -cmake --build build --config Release - -# Managed solution -dotnet build Managed\Decal.sln -c Release +dotnet build Managed\Decal.sln -c Release # 25 projects, 0 errors ``` -### Step 2: COM Registration Test -Register all C# COM servers and verify GUIDs match originals: -``` -regasm /codebase Managed\bin\Release\Decal.Core.dll -regasm /codebase Managed\bin\Release\Decal.DecalDat.dll -... (all 10 COM server DLLs) -``` -Then verify in registry: `HKCR\CLSID\{GUID}\InprocServer32` points to our DLLs. +### Step 2: COM Registration Test ✅ COMPLETE +Automated script: `tools/Test-ComRegistration.ps1 -Build` +- 10/10 DLLs register successfully with regasm /codebase +- 50/50 CLSIDs verified in registry (WOW6432Node for 32-bit on 64-bit Windows) +- 0 GUID mismatches vs original Decal .rgs files +- 35 CLSIDs match original .rgs files exactly +- 15 additional CLSIDs from decompiled interops (no .rgs source available) +- 23 original CLSIDs not in scope (Inject module C++, internal action classes) + +### Step 2b: DecalDat Functional Test ✅ COMPLETE +`Managed/Decal.DecalDat.Tests/` — 13/13 tests pass against real AC DAT files: +- Opens portal.dat (884 MB, sector size 1024) and cell.dat (332 MB, sector size 256) +- Reads 6 known file IDs from portal.dat (SpellTable, ComponentTable, etc.) +- DatStream: Read, Restart, ReadBinary with Tell tracking ### Step 3: Smoke Test — DenAgent Run `Decal.DenAgent.exe` and verify: