docs: update README and VitePress docs with latest architecture, backup paths, and CLI commands

This commit is contained in:
tomasalias 2026-10-06 19:32:23 +02:00
parent 4e19e6f54e
commit 404e82abf6
3 changed files with 44 additions and 38 deletions

View file

@ -19,10 +19,10 @@
## ✨ Features ## ✨ Features
- 🚫 **Complete Zero-Ad Experience**: Multi-layer ad elimination: - 🚫 **Complete Zero-Ad Experience**: Multi-layer ad elimination without breaking React Fiber:
- Electron `session.webRequest` network request blocker stops Overwolf/Adrta/DoubleClick ad calls before they start. - Electron `session.webRequest` network request blocker stops Overwolf/Adrta/DoubleClick ad calls before they start.
- React component interception replaces ad renderers with clean empty nodes. - Fail-safe CSS rules completely neutralize, hide, and collapse all ad frames, banners, and swap buttons to 0px.
- Fail-safe CSS rules neutralize ad frames, banners, and swap buttons. - Safe non-destructive DOM handling preserves React Fiber reconciliation, preventing `insertBefore` exceptions.
- 🎨 **First-Class Theme Engine**: - 🎨 **First-Class Theme Engine**:
- Seamlessly embedded into CurseForge's native **Settings > Themes** screen. - Seamlessly embedded into CurseForge's native **Settings > Themes** screen.
- Live CSS injection with instant hot-reloading (no launcher restarts needed). - Live CSS injection with instant hot-reloading (no launcher restarts needed).
@ -62,6 +62,9 @@
# Restore original vanilla CurseForge # Restore original vanilla CurseForge
.\BetterCurseForge.exe unpatch .\BetterCurseForge.exe unpatch
# Run background watcher daemon directly
.\BetterCurseForge.exe watch
``` ```
--- ---
@ -73,17 +76,17 @@ Whenever CurseForge downloads an update, the Overwolf installer replaces `resour
```mermaid ```mermaid
flowchart TD flowchart TD
A[CurseForge Launcher Update] -->|Installer downloads update| B[CurseForge Quitting / Replacing Files] A[CurseForge Launcher Update] -->|Installer downloads update| B[CurseForge Quitting / Replacing Files]
B -->|Hook & Watcher Detect Update| C[Auto-Repatch Triggered] B -->|Watcher Detects Update| C[Auto-Repatch Triggered]
C -->|Wait for Installer to Settle| D[Settle Verified] C -->|Wait for Installer Files to Settle| D[Settle Verified]
D -->|Offline Extraction & Patch <3s| E[Dist & BetterCF Injected] D -->|Offline Extraction & Patch <3s| E[Dist & BetterCF Injected]
E -->|Recalculate ASAR SHA-256| F[Synchronize OWEASARSIG in CurseForge.exe] E -->|Recalculate ASAR SHA-256| F[Synchronize OWEASARSIG in CurseForge.exe]
F -->|Autonomous Relaunch| G[Modded CurseForge Launcher Ready!] F -->|Autonomous Relaunch| G[Modded CurseForge Launcher Ready!]
``` ```
1. **Permanent Daemon Installation**: On first patch, BetterCurseForge installs to `%LOCALAPPDATA%\BetterCurseForge` with an autostart registry entry in `HKCU\...\Run`. 1. **Permanent Daemon Installation**: On first patch, BetterCurseForge installs to `%LOCALAPPDATA%\BetterCurseForge` with an autostart registry entry in `HKCU\...\Run` and a task scheduler fallback.
2. **Proactive In-App Update Interceptor**: BetterCurseForge monitors updater states on app quit (`before-quit`) to initiate patching before the new launcher process initializes. 2. **Global Mutex Synchronization**: Uses Windows kernel named mutexes (`BetterCurseForgePatchMutex`) to guarantee atomic, single-process patching with zero race conditions.
3. **Resilient Win32 Watcher Daemon**: A silent background process monitors CurseForge's installation directory with 0% CPU consumption. If an unpatched state is detected (e.g., after an update), it terminates the unpatched process, reapplies the patch, and relaunches the modded client. 3. **Resilient Win32 Watcher Daemon**: A silent background process monitors CurseForge's installation directory with 0% CPU consumption. If an unpatched state is detected (e.g., after an update), it waits for installer files to settle, terminates the unpatched process, reapplies the patch, and relaunches the modded client seamlessly without console window popups.
4. **100% Offline Zero-Delay ASAR Engine**: Unpacking and repacking use bundled tools combined with CurseForge's built-in Node runtime (`ELECTRON_RUN_AS_NODE=1`), completing the entire repatch cycle in 3–4 seconds without requiring an internet connection. 4. **100% Offline Zero-Delay ASAR Engine**: Unpacking and repacking use bundled tools combined with CurseForge's built-in Node runtime (`ELECTRON_RUN_AS_NODE=1`), completing the entire repatch cycle in 2–3 seconds without requiring an internet connection.
--- ---

View file

@ -13,7 +13,7 @@ Before using BetterCurseForge, make sure you have:
- CurseForge closed before running the patcher - CurseForge closed before running the patcher
::: tip SAFE & 100% REVERSIBLE ::: tip SAFE & 100% REVERSIBLE
Before modifying any files, BetterCurseForge creates an untouched vanilla backup at `resources/app.asar.vanilla.bak`. You can cleanly revert to stock CurseForge at any time with a single click. Before modifying any files, BetterCurseForge creates untouched vanilla backups at `resources/app.asar.vanilla` and `CurseForge.exe.vanilla`. You can cleanly revert to stock CurseForge at any time with a single click.
::: :::
--- ---
@ -48,13 +48,16 @@ The application automatically:
3. You will see live output in the log panel confirming: 3. You will see live output in the log panel confirming:
```text ```text
[+] Found CurseForge at: C:\Users\Username\AppData\Local\Programs\CurseForge Windows [+] Found CurseForge at: C:\Users\Username\AppData\Local\Programs\CurseForge Windows
[+] Disabled React ad component (eV -> return null) [+] Unlocked native premium themes (2 route checks)
[+] Disabled swap ads button [+] Unlocked premium theme state validation
[+] Unlocked all native premium themes (Settings route) [+] Unlocked subscription plan status for themes (4 checks)
[+] Unlocked all native premium themes (Popup route)
[+] Injected zero-ad and theme CSS rules into desktop.css [+] Injected zero-ad and theme CSS rules into desktop.css
[+] Bundled BetterCurseForge runtime into asar [+] Bundled BetterCurseForge runtime into asar
[+] Injected main-process hooks into background.js
[+] Injected renderer script into desktop.html
[+] Injected renderer loader into preload.js
[+] Updated CurseForge.exe integrity signature [+] Updated CurseForge.exe integrity signature
[+] Auto-repatch watcher active and persistent across updates.
[*] CurseForge successfully patched! Ads removed, themes & plugins enabled. [*] CurseForge successfully patched! Ads removed, themes & plugins enabled.
``` ```
4. Click **Launch CurseForge** or open your usual desktop shortcut—you're done! 4. Click **Launch CurseForge** or open your usual desktop shortcut—you're done!
@ -114,22 +117,23 @@ When the official CurseForge Launcher downloads an automatic update, it overwrit
BetterCurseForge solves this with **Auto-Repatch**: BetterCurseForge solves this with **Auto-Repatch**:
### Enabling Auto-Repatch in the GUI ### Managing Auto-Repatch in the GUI
- In the BetterCurseForge desktop application, simply toggle the **Auto-Repatch on Update** checkbox. - In the BetterCurseForge desktop application, simply toggle the **Auto-Repatch on Update** button (turns green when active).
### Enabling Auto-Repatch via CLI ### Managing Auto-Repatch via CLI
```powershell ```powershell
.\BetterCurseForge.exe --auto-repatch enable # Run the background watcher daemon directly:
.\BetterCurseForge.exe watch
# BetterCurseForge also manages watcher persistence automatically on patch/unpatch:
.\BetterCurseForge.exe patch # Applies patch and activates watcher autostart
.\BetterCurseForge.exe unpatch # Restores vanilla client and stops watcher
``` ```
### How Auto-Repatch Works ### How Auto-Repatch Works
1. Registers a lightweight Windows background task. 1. **Background Watcher**: Runs silently with 0% CPU consumption via Windows directory event notifications.
2. Detects whenever CurseForge's files are modified or updated by Overwolf/CurseForge. 2. **Global Mutex Lock**: Uses kernel named mutexes to guarantee single-instance execution and avoid race conditions.
3. Automatically closes the client, creates a new backup of the updated version, applies the BetterCurseForge patches, updates the binary signature, and re-launches your modded client silently. 3. **Automatic Re-Patching**: Whenever CurseForge updates, the watcher waits for the installer to finish, reapplies BetterCurseForge modifications offline in 2–3 seconds, synchronizes executable signatures, and relaunches the modded client seamlessly without popping command prompt windows.
4. To disable anytime:
```powershell
.\BetterCurseForge.exe --auto-repatch disable
```
--- ---
@ -140,19 +144,18 @@ Modern versions of CurseForge include **ASAR Code Integrity Verification** enfor
```mermaid ```mermaid
flowchart TD flowchart TD
A["BetterCurseForge.exe"] --> B["Locate CurseForge Windows Installation"] A["BetterCurseForge.exe"] --> B["Locate CurseForge Windows Installation"]
B --> C["Extract app.asar & Create app.asar.vanilla.bak"] B --> C["Extract app.asar & Create Vanilla Backup"]
C --> D["Disable React Ad Components & Swap Ads"] C --> D["Unlock Native Premium Themes & Validate Subscription State"]
D --> E["Unlock Native Premium Themes (Pixelforge, Lifeforge, etc.)"] D --> E["Inject Zero-Ad & Theme CSS into desktop.css"]
E --> F["Inject Zero-Ad & Responsive CSS into desktop.css"] E --> F["Bundle BetterCurseForge Runtime (Main, Preload, Renderer)"]
F --> G["Bundle BetterCurseForge Core Runtime into asar"] F --> G["Repack app.asar & Calculate SHA256 Header Hash"]
G --> H["Repack app.asar & Calculate SHA256 Header Hash"] G --> H["Update CurseForge.exe OWEASARSIG Integrity Signature"]
H --> I["Update CurseForge.exe ASAR Integrity Signature"] H --> I["Launch Modded CurseForge with Full Permissions"]
I --> J["Launch Modded CurseForge with Full Permissions"]
``` ```
1. **AST & Component Patching**: Replaces the React ad rendering module (`eV -> return null`) to ensure ad frames are never mounted in the virtual DOM. 1. **Multi-Layer Ad Elimination**: Blocks ad network requests at the Electron session level (`session.webRequest`) and collapses ad frames to 0px using CSS rules, completely preserving React Fiber virtual DOM reconciliation.
2. **Premium Skin Unlock**: Patches the client-side plan validation routes so all 4 native CurseForge skins (*Pixelforge*, *Lifeforge*, *Fantasyforge*, *Spookyforge*) can be freely selected in **Settings -> Themes**. 2. **Premium Skin Unlock**: Uses version-resilient AST/regex matching to unlock all official CurseForge skins (*Pixelforge*, *Lifeforge*, *Fantasyforge*, *Halloween*, etc.) in **Settings -> Themes**.
3. **ASAR Signature Patching**: Calculates the cryptographic SHA256 hash of the modified ASAR archive header and writes the new signature into `CurseForge.exe`, ensuring Electron boots without security errors or corruption alerts. 3. **ASAR Signature Synchronization**: Calculates the cryptographic SHA256 hash of the modified ASAR archive header and writes the new signature directly into `CurseForge.exe`, ensuring Electron boots without security errors or corruption alerts.
--- ---

View file

@ -16,7 +16,7 @@ hero:
features: features:
- icon: 🚫 - icon: 🚫
title: Complete Ad Removal title: Complete Ad Removal
details: Multi-layer elimination (React component neutralization, zero-ad CSS rules, and network blocking) removes all video ads, banners, and empty containers. details: Multi-layer elimination (zero-ad CSS rules, network-level request blocking, and layout collapsing) removes all video ads, banners, and empty containers without disrupting React reconciliation.
- icon: 🎨 - icon: 🎨
title: Client Themes & Free Skins title: Client Themes & Free Skins
details: Integrated directly into Settings -> Themes with live hover previews, theme folder shortcuts, and all native CurseForge Premium themes unlocked for free. details: Integrated directly into Settings -> Themes with live hover previews, theme folder shortcuts, and all native CurseForge Premium themes unlocked for free.
@ -31,7 +31,7 @@ features:
details: Extend launcher capabilities with lightweight JavaScript plugins using our runtime monkey-patcher and persistent settings API. details: Extend launcher capabilities with lightweight JavaScript plugins using our runtime monkey-patcher and persistent settings API.
- icon: 🛡️ - icon: 🛡️
title: Safe & 100% Reversible title: Safe & 100% Reversible
details: Automatically creates a clean vanilla backup (`app.asar.vanilla.bak`). You can restore stock CurseForge at any time with a single click. details: Automatically creates clean vanilla backups (`app.asar.vanilla` and `CurseForge.exe.vanilla`). You can restore stock CurseForge at any time with a single click.
--- ---
<div class="quickstart-section" style="margin-top: 3rem; text-align: center;"> <div class="quickstart-section" style="margin-top: 3rem; text-align: center;">