|
|
||
|---|---|---|
| cscrypt | ||
| csctapi | ||
| devtools | ||
| Distribution | ||
| extapi | ||
| images | ||
| minilzo | ||
| tommyDS_hashlin | ||
| toolchains | ||
| utils | ||
| webif | ||
| wiki@d29a5a8242 | ||
| .gitignore | ||
| .gitmodules | ||
| CMakeLists.txt | ||
| CODING.RULES.txt | ||
| config.h | ||
| config.sh | ||
| COPYING | ||
| git-done.sh | ||
| git-start.sh | ||
| git-sync.sh | ||
| globals.h | ||
| globals.h.orig | ||
| Makefile | ||
| Makefile.extra | ||
| module-anticasc.c | ||
| module-anticasc.h | ||
| module-cacheex.c | ||
| module-cacheex.h | ||
| module-camd33.c | ||
| module-camd35-cacheex.c | ||
| module-camd35-cacheex.c.orig | ||
| module-camd35-cacheex.h | ||
| module-camd35.c | ||
| module-camd35.h | ||
| module-cccam-cacheex.c | ||
| module-cccam-cacheex.h | ||
| module-cccam-data.h | ||
| module-cccam.c | ||
| module-cccam.h | ||
| module-cccshare.c | ||
| module-cccshare.h | ||
| module-constcw.c | ||
| module-csp.c | ||
| module-cw-cycle-check.c | ||
| module-cw-cycle-check.h | ||
| module-dvbapi-azbox.c | ||
| module-dvbapi-azbox.h | ||
| module-dvbapi-chancache.c | ||
| module-dvbapi-chancache.h | ||
| module-dvbapi-coolapi-legacy.c | ||
| module-dvbapi-coolapi.c | ||
| module-dvbapi-coolapi.h | ||
| module-dvbapi-mca.c | ||
| module-dvbapi-mca.h | ||
| module-dvbapi-stapi.c | ||
| module-dvbapi-stapi.h | ||
| module-dvbapi-stapi5.c | ||
| module-dvbapi.c | ||
| module-dvbapi.h | ||
| module-emulator-biss.c | ||
| module-emulator-biss.h | ||
| module-emulator-cryptoworks.c | ||
| module-emulator-cryptoworks.h | ||
| module-emulator-director.c | ||
| module-emulator-director.h | ||
| module-emulator-irdeto.c | ||
| module-emulator-irdeto.h | ||
| module-emulator-nagravision.c | ||
| module-emulator-nagravision.h | ||
| module-emulator-omnicrypt.c | ||
| module-emulator-omnicrypt.h | ||
| module-emulator-osemu.c | ||
| module-emulator-osemu.h | ||
| module-emulator-powervu.c | ||
| module-emulator-powervu.h | ||
| module-emulator-viaccess.c | ||
| module-emulator-viaccess.h | ||
| module-emulator.c | ||
| module-gbox-cards.c | ||
| module-gbox-cards.h | ||
| module-gbox-helper.c | ||
| module-gbox-helper.h | ||
| module-gbox-remm.c | ||
| module-gbox-remm.h | ||
| module-gbox-sms.c | ||
| module-gbox-sms.h | ||
| module-gbox.c | ||
| module-gbox.h | ||
| module-ghttp.c | ||
| module-lcd.c | ||
| module-lcd.h | ||
| module-led.c | ||
| module-led.h | ||
| module-monitor.c | ||
| module-monitor.h | ||
| module-newcamd-des.c | ||
| module-newcamd-des.h | ||
| module-newcamd.c | ||
| module-newcamd.h | ||
| module-pandora.c | ||
| module-radegast.c | ||
| module-scam.c | ||
| module-serial.c | ||
| module-stat.c | ||
| module-stat.h | ||
| module-streamrelay.c | ||
| module-streamrelay.h | ||
| module-webif-lib.c | ||
| module-webif-lib.h | ||
| module-webif-tpl.c | ||
| module-webif-tpl.h | ||
| module-webif.c | ||
| module-webif.c.orig | ||
| module-webif.h | ||
| modules.h | ||
| oscam-aes.c | ||
| oscam-aes.h | ||
| oscam-array.c | ||
| oscam-array.h | ||
| oscam-cache.c | ||
| oscam-cache.h | ||
| oscam-chk.c | ||
| oscam-chk.c.orig | ||
| oscam-chk.c.rej | ||
| oscam-chk.h | ||
| oscam-client.c | ||
| oscam-client.h | ||
| oscam-conf-chk.c | ||
| oscam-conf-chk.h | ||
| oscam-conf-mk.c | ||
| oscam-conf-mk.h | ||
| oscam-conf.c | ||
| oscam-conf.h | ||
| oscam-config-account.c | ||
| oscam-config-global.c | ||
| oscam-config-reader.c | ||
| oscam-config.c | ||
| oscam-config.c.orig | ||
| oscam-config.h | ||
| oscam-ecm.c | ||
| oscam-ecm.c.orig | ||
| oscam-ecm.h | ||
| oscam-emm-cache.c | ||
| oscam-emm-cache.h | ||
| oscam-emm.c | ||
| oscam-emm.h | ||
| oscam-failban.c | ||
| oscam-failban.h | ||
| oscam-files.c | ||
| oscam-files.h | ||
| oscam-garbage.c | ||
| oscam-garbage.h | ||
| oscam-hashtable.c | ||
| oscam-hashtable.h | ||
| oscam-llist.c | ||
| oscam-llist.h | ||
| oscam-lock.c | ||
| oscam-lock.h | ||
| oscam-log-reader.c | ||
| oscam-log-reader.h | ||
| oscam-log.c | ||
| oscam-log.h | ||
| oscam-net.c | ||
| oscam-net.h | ||
| oscam-reader.c | ||
| oscam-reader.h | ||
| oscam-signing.c | ||
| oscam-signing.h | ||
| oscam-simples.c | ||
| oscam-string-isotables.h | ||
| oscam-string.c | ||
| oscam-string.h | ||
| oscam-time.c | ||
| oscam-time.h | ||
| oscam-work.c | ||
| oscam-work.h | ||
| oscam.c | ||
| reader-bulcrypt.c | ||
| reader-common.c | ||
| reader-common.h | ||
| reader-conax.c | ||
| reader-cryptoworks.c | ||
| reader-dgcrypt.c | ||
| reader-dre-cas.c | ||
| reader-dre-common.c | ||
| reader-dre-common.h | ||
| reader-dre-st20.c | ||
| reader-dre-st20.h | ||
| reader-dre.c | ||
| reader-griffin.c | ||
| reader-irdeto.c | ||
| reader-irdeto.h | ||
| reader-nagra-common.c | ||
| reader-nagra-common.h | ||
| reader-nagra.c | ||
| reader-nagracak7.c | ||
| reader-seca.c | ||
| reader-tongfang.c | ||
| reader-viaccess.c | ||
| reader-videoguard-common.c | ||
| reader-videoguard-common.h | ||
| reader-videoguard1.c | ||
| reader-videoguard2.c | ||
| reader-videoguard12.c | ||
| readers.h | ||
| README.build | ||
| README.config | ||
| README.dvbapi_protocol | ||
| README.md | ||
| SoftCam.Key | ||
| tests.c | ||
OSCam with AI Fake DCW Detector Test
Overview
This repository contains a modified version of OSCam enhanced with an advanced AI-inspired Fake DCW Detection and Voting System.
The goal of this system is to improve stability and reliability when multiple Control Word (CW) sources are available, such as:
- Local readers
- CacheEx peers
- CSP sources
- Virtual readers
Instead of accepting the first CW received, this implementation collects multiple candidates and selects the most reliable one using weighted voting logic.
🔍 Problem It Solves
In multi-reader or CacheEx environments, fake or unstable DCWs can appear.
Default behavior:
- First CW wins
- Possible glitches, freezing, or unstable decoding
With AI Fake DCW Detector:
- Multiple CWs are collected
- Sources are tracked
- Votes are counted
- Local readers can be weighted higher
- Majority or timeout logic is applied
- A reliable CW is selected
Result:
✔ Reduced fake DCWs
✔ Increased decoding stability
✔ Better CacheEx reliability
✔ Smarter CW selection
🧠 Core Functions
1️⃣ cw_vote_add()
This function is called whenever a new CW is received.
It:
- Compares the CW with existing candidates
- Increases vote count if it matches
- Adds a new candidate if it is unique
- Tracks:
- Total votes
- Local votes
- Reader source
- CW value
- Identifies whether the source is:
- Local reader
- Virtual reader
- CacheEx client
- CSP source
Each CW candidate is stored in a voting pool.
2️⃣ cw_vote_decide()
This function determines the final CW to use.
Decision Process
- Count total votes
- Verify minimum vote requirement
- Calculate effective score:
- Check for majority (> 50%)
- Apply timeout logic
- Apply fallback strategy if necessary
If a winner is found:
- CW is copied into
er->cw - CacheEx hit statistics are updated
- Optional logging is performed
If no clear winner exists, the system waits for more votes unless timeout rules apply.
⚙ Configuration Options
| Parameter | Description |
|---|---|
cwvote_enabled |
Enable/disable voting system |
cwvote_max_candidates |
Maximum CW candidates stored |
cwvote_compare_len |
Number of bytes used for CW comparison |
cwvote_local_weight |
Weight multiplier for local votes |
cwvote_min_votes |
Minimum required votes before decision |
cwvote_timeout |
Timeout in milliseconds |
cwvote_fallback |
Fallback mode (1 = best candidate, 2 = first candidate) |
cwvote_log_enabled |
Enable detailed debug logging |
🏆 Winner Selection Logic
A CW is selected if:
- It has a strict majority (> 50%)
OR - Timeout is reached and fallback mode allows selection
If timeout occurs and:
fallback = 1→ best scoring candidate is selectedfallback = 2→ first candidate (slot 0) is selected
📊 Intelligent Source Awareness
The system distinguishes between:
- Trusted local readers
- Virtual readers
- CacheEx clients
- CSP sources
Local readers can be weighted higher using cwvote_local_weight, improving reliability in hybrid environments.
📈 CacheEx Integration
If the winning CW originates from CacheEx:
cwcacheexhitcounters are incremented- Client and account statistics are updated
- Global hit statistics are updated
This improves monitoring accuracy and performance analysis.
🚀 Advantages
- Detects and filters fake DCWs
- Improves stability in multi-reader setups
- Reduces glitching and freezing
- Configurable and flexible logic
- Seamlessly integrated into OSCam core
🧩 AI Concept
Although not based on machine learning, this system applies AI-style decision logic:
- Aggregates multiple inputs
- Applies weighted scoring
- Uses majority validation
- Implements adaptive timeout fallback
It behaves like deterministic intelligence for CW selection.
Intended Use
Designed for:
- Emulated environments
- CacheEx-heavy setups
- Multi-reader configurations
- Advanced OSCam tuning
- High-stability streaming environments
License
Based on the OSCam open-source project.
This repository includes custom modifications implementing advanced CW voting and fake DCW detection logic.
