-
Notifications
You must be signed in to change notification settings - Fork 7
Testing
capture-bypass ships a dedicated stress-test window for verifying injection end-to-end without needing a real DRM application.
The stress tester is included in the installer. Launch it from the π¨ Stress Test button in the GUI header, or run it directly:
# If installed:
"C:\Program Files\capture-bypass\stress_tester.exe"
# If built from source:
target\release\stress_tester.exeNo Administrator rights are required β SetWindowDisplayAffinity works on your own windows without elevation.
On launch, the window:
- Applies
WDA_EXCLUDEFROMCAPTUREto itself β the window appears black in OBS immediately. - Starts a monitor thread that polls
GetWindowDisplayAffinityevery 100 ms and updates the display. - Changes the window background and title bar text based on protection state, so the result is visible in OBS as well as in the window itself.
| State | Background | Title |
|---|---|---|
Protected (WDA_EXCLUDEFROMCAPTURE) |
Deep red | π΄ PROTECTED β Capture Bypass Stress Tester |
Clear (WDA_NONE) |
Deep green | β NOT PROTECTED β Capture Bypass Stress Tester |
Monitor-only (WDA_MONITOR) |
Deep red | π‘ MONITOR-ONLY β Capture Bypass Stress Tester |
- Launch
stress_tester.exeβ it opens with a red background (protected). - Launch
capture_bypass_gui.exeas Administrator. - Find the stress tester row in the window list (filter for "stress" if needed).
- Click Strip Protection.
- The stress tester window should turn green within one 100 ms poll cycle.
- The External strips counter increments by 1.
Fight Mode simulates an application that actively resists injection by re-applying WDA_EXCLUDEFROMCAPTURE on a timer.
- In the stress tester, adjust the Re-apply every slider (50β2000 ms, default 500 ms).
- Click βΆ Start Fight Mode.
- The Fight re-applies counter starts climbing β each tick re-protects the window.
- In the main app, switch to π Persistent mode.
- Click Strip Protection on the stress tester row.
- Watch the counters:
- Fight re-applies keeps climbing (the stress tester is fighting back)
- External strips also increments β the persistent DLL is re-stripping every 500 ms
- The window should stay green once the persistent DLL is installed, because it re-strips at the same or faster rate than the fight interval.
- Set the fight interval below 500 ms (e.g. 100 ms) to simulate an aggressive app. The persistent DLL re-strips every 500 ms, so it will lose the race β this is expected and shows the limits of the persistent interval.
- Set the fight interval above 500 ms (e.g. 1000 ms) to simulate a typical DRM app. Persistent mode wins comfortably.
- Click βΊ Reset Counters at any time to zero both counters for a fresh test.
Some applications defend themselves by scanning the running-process list and re-applying protection whenever they see the injector's exe name.
The stress tester can simulate this: when Scenario A is active, it polls CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS) every 250 ms. If it finds a process whose name matches the configured Injector name (default capture_bypass_gui.exe), it immediately re-applies WDA_EXCLUDEFROMCAPTURE and increments the Detections counter.
- Start Scenario A with the default injector name.
- Launch
capture_bypass_gui.exeβ detections climb and the window stays protected. - Now test the defence: capture-bypass renames its injected DLL to a random
.tmpand usesinject_dll_stealth. If you also renamed the injector exe itself, Scenario A finds nothing and detections stay at 0.
The Injector name field is live β you can change it while the thread runs.
A more aggressive defence: the target app periodically scans its own loaded modules and calls FreeLibrary on anything that looks like an injected payload, then re-applies protection.
The stress tester simulates this by polling CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, self_pid) every 250 ms. Any module whose name contains the DLL name pattern (default payload_dll) gets FreeLibrary'd immediately, protection is re-applied, and the Modules ejected counter increments.
The stealth injection in capture-bypass copies the payload to %TEMP%\<random>.tmp before loading it, so the module name visible in the snapshot is an opaque hex string rather than payload_dll.dll. Tick Also eject .tmp modules to test whether a paranoid app can still catch the stealth copy by ejecting all .tmp modules regardless of name.
| Scenario B config | Non-stealth injection | Stealth injection |
|---|---|---|
Pattern: payload_dll, no .tmp |
β Ejected immediately | β
Survives (name is a .tmp) |
Pattern: payload_dll, .tmp ON |
β Ejected | β Ejected (even the .tmp is caught) |
- Start Scenario B (pattern:
payload_dll, .tmp unchecked). - Inject the non-stealth DLL (
payload_dll.dll) β ejections climb. - Switch to stealth injection β ejections stay at 0, confirming the rename defence works.
- Tick Also eject .tmp modules and re-inject stealth β ejections climb again, showing a sufficiently paranoid app can still evict it.
The stress tester has two buttons for manual control:
-
π΄ Apply Protection β manually re-applies
WDA_EXCLUDEFROMCAPTURE -
β
Remove Protection β manually clears to
WDA_NONE
These are useful for quick before/after screenshots or OBS source tests without using the main app.