Compare commits

..

No commits in common. "d637c99e9e2cefc893e2d5fe6d2158ad161be767" and "efee87086bca60489c9b61b2673897d15d6168ff" have entirely different histories.

701 changed files with 3035 additions and 24215 deletions

0
.gitignore vendored Normal file → Executable file
View File

0
.gitmodules vendored Normal file → Executable file
View File

42
CMakeLists.txt Normal file → Executable file
View File

@ -517,6 +517,7 @@ if (CONFIG_STREAMRELAY MATCHES "Y" AND NOT MODULE_STREAMRELAY EQUAL 1)
set (LIBDVBCSA_LIBRARY "${LIBDVBCSADIR}/libdvbcsa.so") set (LIBDVBCSA_LIBRARY "${LIBDVBCSADIR}/libdvbcsa.so")
else (LIBDVBCSADIR) else (LIBDVBCSADIR)
check_include_file ("dvbcsa/dvbcsa.h" FOUND_LIBDVBCSA) check_include_file ("dvbcsa/dvbcsa.h" FOUND_LIBDVBCSA)
set(HAVE_LIBDVBCSA ${FOUND_LIBDVBCSA})
find_library (LIBADVBCSA_LIBRARY NAMES libdvbcsa.a) find_library (LIBADVBCSA_LIBRARY NAMES libdvbcsa.a)
find_library (LIBDVBCSA_LIBRARY NAMES dvbcsa) find_library (LIBDVBCSA_LIBRARY NAMES dvbcsa)
endif (LIBDVBCSADIR) endif (LIBDVBCSADIR)
@ -546,6 +547,22 @@ endif (CONFIG_STREAMRELAY MATCHES "Y" AND NOT MODULE_STREAMRELAY EQUAL 1)
# Manage config.h based on command line parameters # Manage config.h based on command line parameters
# Manipulate config file based on given parameters and read unset parameters # Manipulate config file based on given parameters and read unset parameters
execute_process (COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/config.sh --enabled WITH_EMU OUTPUT_VARIABLE CONFIG_WITH_EMU OUTPUT_STRIP_TRAILING_WHITESPACE)
if (CONFIG_WITH_EMU MATCHES "Y" AND NOT WITH_EMU EQUAL 1)
add_definitions ("-DWITH_EMU")
set (WITH_EMU "1")
message (STATUS " EMU is added by config compiling with EMU")
endif (CONFIG_WITH_EMU MATCHES "Y" AND NOT WITH_EMU EQUAL 1)
if (WITH_EMU)
execute_process (COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/config.sh --enabled WITH_SOFTCAM OUTPUT_VARIABLE CONFIG_WITH_SOFTCAM OUTPUT_STRIP_TRAILING_WHITESPACE)
if (CONFIG_WITH_SOFTCAM MATCHES "Y" AND NOT WITH_SOFTCAM EQUAL 1)
add_definitions ("-DWITH_SOFTCAM")
set (WITH_SOFTCAM "1")
message (STATUS " SOFTCAM is added by config linking SoftCam.Key")
endif (CONFIG_WITH_SOFTCAM MATCHES "Y" AND NOT WITH_SOFTCAM EQUAL 1)
endif (WITH_EMU)
execute_process (COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/config.sh --show-valid OUTPUT_VARIABLE config_vars_string OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process (COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/config.sh --show-valid OUTPUT_VARIABLE config_vars_string OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REGEX MATCHALL "[A-Z0-9_]+" config_vars ${config_vars_string}) string(REGEX MATCHALL "[A-Z0-9_]+" config_vars ${config_vars_string})
@ -888,6 +905,24 @@ endif( HAVE_LIBRT OR HAVE_LIBRT_STATIC)
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------
if (NOT OSCamOperatingSystem MATCHES "Mac OS X")
if (NOT DEFINED ENV{ANDROID_NDK})
if (NOT DEFINED ENV{ANDROID_STANDALONE_TOOLCHAIN})
if (WITH_SOFTCAM)
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/SoftCam.Key)
execute_process (COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/SoftCam.Key ${CMAKE_CURRENT_BINARY_DIR}/SoftCam.Key)
else (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/SoftCam.Key)
execute_process (COMMAND touch ${CMAKE_CURRENT_BINARY_DIR}/SoftCam.Key)
endif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/SoftCam.Key)
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--format=binary -Wl,SoftCam.Key -Wl,--format=default")
if (NOT OSCamOperatingSystem MATCHES "Windows/Cygwin")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,noexecstack")
endif (NOT OSCamOperatingSystem MATCHES "Windows/Cygwin")
endif (WITH_SOFTCAM)
endif (NOT DEFINED ENV{ANDROID_STANDALONE_TOOLCHAIN})
endif (NOT DEFINED ENV{ANDROID_NDK})
endif (NOT OSCamOperatingSystem MATCHES "Mac OS X")
#----------------------- installation ----------------------------- #----------------------- installation -----------------------------
file (GLOB config_files "${CMAKE_CURRENT_SOURCE_DIR}/Distribution/oscam.*") file (GLOB config_files "${CMAKE_CURRENT_SOURCE_DIR}/Distribution/oscam.*")
@ -1000,4 +1035,11 @@ if (HAVE_LIBDVBCSA)
endif(STATICLIBDVBCSA AND NOT LIBDVBCSADIR) endif(STATICLIBDVBCSA AND NOT LIBDVBCSADIR)
endif (HAVE_LIBDVBCSA) endif (HAVE_LIBDVBCSA)
if (WITH_EMU)
message (STATUS " Compile with EMU support")
if (WITH_SOFTCAM)
message (STATUS " SoftCam.Key will be linked as well")
endif (WITH_SOFTCAM)
endif (WITH_EMU)
message (STATUS "") message (STATUS "")

0
CODING.RULES.txt Normal file → Executable file
View File

0
COPYING Normal file → Executable file
View File

0
Distribution/doc/example/oscam.ac Normal file → Executable file
View File

0
Distribution/doc/example/oscam.cacheex Normal file → Executable file
View File

0
Distribution/doc/example/oscam.cert Normal file → Executable file
View File

0
Distribution/doc/example/oscam.conf Normal file → Executable file
View File

0
Distribution/doc/example/oscam.dvbapi Normal file → Executable file
View File

0
Distribution/doc/example/oscam.guess Normal file → Executable file
View File

0
Distribution/doc/example/oscam.ird Normal file → Executable file
View File

0
Distribution/doc/example/oscam.provid Normal file → Executable file
View File

0
Distribution/doc/example/oscam.server Normal file → Executable file
View File

0
Distribution/doc/example/oscam.services Normal file → Executable file
View File

0
Distribution/doc/example/oscam.srvid Normal file → Executable file
View File

0
Distribution/doc/example/oscam.tiers Normal file → Executable file
View File

0
Distribution/doc/example/oscam.user Normal file → Executable file
View File

0
Distribution/doc/example/oscam.whitelist Normal file → Executable file
View File

0
Distribution/doc/html/list_smargo.1.html Normal file → Executable file
View File

0
Distribution/doc/html/oscam.1.html Normal file → Executable file
View File

0
Distribution/doc/html/oscam.ac.5.html Normal file → Executable file
View File

0
Distribution/doc/html/oscam.cacheex.5.html Normal file → Executable file
View File

0
Distribution/doc/html/oscam.cert.5.html Normal file → Executable file
View File

0
Distribution/doc/html/oscam.conf.5.html Normal file → Executable file
View File

0
Distribution/doc/html/oscam.dvbapi.5.html Normal file → Executable file
View File

0
Distribution/doc/html/oscam.guess.5.html Normal file → Executable file
View File

0
Distribution/doc/html/oscam.ird.5.html Normal file → Executable file
View File

0
Distribution/doc/html/oscam.provid.5.html Normal file → Executable file
View File

0
Distribution/doc/html/oscam.ratelimit.5.html Normal file → Executable file
View File

7
Distribution/doc/html/oscam.server.5.html Normal file → Executable file
View File

@ -840,6 +840,13 @@ set reader's CCcam reshare hop, default:0
<P> <P>
<B>cccwantemu</B> = <B>0</B>|<B>1</B>
<DL COMPACT><DT><DD>
1 = request to provide emu from CCCam server, too, default:0
</DL>
<P>
<B>ccckeepalive</B> = <B>0</B>|<B>1</B> <B>ccckeepalive</B> = <B>0</B>|<B>1</B>
<DL COMPACT><DT><DD> <DL COMPACT><DT><DD>
1 = send keepalive messages to keep connection to remote CCCam server up, default:0 1 = send keepalive messages to keep connection to remote CCCam server up, default:0

0
Distribution/doc/html/oscam.services.5.html Normal file → Executable file
View File

0
Distribution/doc/html/oscam.srvid.5.html Normal file → Executable file
View File

0
Distribution/doc/html/oscam.srvid2.5.html Normal file → Executable file
View File

0
Distribution/doc/html/oscam.tiers.5.html Normal file → Executable file
View File

0
Distribution/doc/html/oscam.user.5.html Normal file → Executable file
View File

0
Distribution/doc/html/oscam.whitelist.5.html Normal file → Executable file
View File

0
Distribution/doc/man/list_smargo.1 Normal file → Executable file
View File

0
Distribution/doc/man/oscam.1 Normal file → Executable file
View File

0
Distribution/doc/man/oscam.ac.5 Normal file → Executable file
View File

0
Distribution/doc/man/oscam.cacheex.5 Normal file → Executable file
View File

0
Distribution/doc/man/oscam.cert.5 Normal file → Executable file
View File

0
Distribution/doc/man/oscam.conf.5 Normal file → Executable file
View File

0
Distribution/doc/man/oscam.dvbapi.5 Normal file → Executable file
View File

0
Distribution/doc/man/oscam.guess.5 Normal file → Executable file
View File

0
Distribution/doc/man/oscam.ird.5 Normal file → Executable file
View File

0
Distribution/doc/man/oscam.provid.5 Normal file → Executable file
View File

0
Distribution/doc/man/oscam.ratelimit.5 Normal file → Executable file
View File

5
Distribution/doc/man/oscam.server.5 Normal file → Executable file
View File

@ -649,6 +649,11 @@ set reader's CCcam reshare hop, default:0
\fBx\fP = resharing for direct peer and share level x \fBx\fP = resharing for direct peer and share level x
.RE .RE
.PP .PP
\fBcccwantemu\fP = \fB0\fP|\fB1\fP
.RS 3n
1 = request to provide emu from CCCam server, too, default:0
.RE
.PP
\fBccckeepalive\fP = \fB0\fP|\fB1\fP \fBccckeepalive\fP = \fB0\fP|\fB1\fP
.RS 3n .RS 3n
1 = send keepalive messages to keep connection to remote CCCam server up, default:0 1 = send keepalive messages to keep connection to remote CCCam server up, default:0

0
Distribution/doc/man/oscam.services.5 Normal file → Executable file
View File

0
Distribution/doc/man/oscam.srvid.5 Normal file → Executable file
View File

0
Distribution/doc/man/oscam.srvid2.5 Normal file → Executable file
View File

0
Distribution/doc/man/oscam.tiers.5 Normal file → Executable file
View File

0
Distribution/doc/man/oscam.user.5 Normal file → Executable file
View File

0
Distribution/doc/man/oscam.whitelist.5 Normal file → Executable file
View File

0
Distribution/doc/txt/list_smargo.txt Normal file → Executable file
View File

0
Distribution/doc/txt/oscam.ac.txt Normal file → Executable file
View File

0
Distribution/doc/txt/oscam.cacheex.txt Normal file → Executable file
View File

0
Distribution/doc/txt/oscam.cert.txt Normal file → Executable file
View File

0
Distribution/doc/txt/oscam.conf.txt Normal file → Executable file
View File

0
Distribution/doc/txt/oscam.dvbapi.txt Normal file → Executable file
View File

0
Distribution/doc/txt/oscam.guess.txt Normal file → Executable file
View File

0
Distribution/doc/txt/oscam.ird.txt Normal file → Executable file
View File

0
Distribution/doc/txt/oscam.provid.txt Normal file → Executable file
View File

0
Distribution/doc/txt/oscam.ratelimit.txt Normal file → Executable file
View File

3
Distribution/doc/txt/oscam.server.txt Normal file → Executable file
View File

@ -509,6 +509,9 @@ DESCRIPTIONS
0 = resharing for direct peer only 0 = resharing for direct peer only
x = resharing for direct peer and share level x x = resharing for direct peer and share level x
cccwantemu = 0|1
1 = request to provide emu from CCCam server, too, default:0
ccckeepalive = 0|1 ccckeepalive = 0|1
1 = send keepalive messages to keep connection to remote CCCam server up, default:0 1 = send keepalive messages to keep connection to remote CCCam server up, default:0

0
Distribution/doc/txt/oscam.services.txt Normal file → Executable file
View File

0
Distribution/doc/txt/oscam.srvid.txt Normal file → Executable file
View File

0
Distribution/doc/txt/oscam.srvid2.txt Normal file → Executable file
View File

0
Distribution/doc/txt/oscam.tiers.txt Normal file → Executable file
View File

0
Distribution/doc/txt/oscam.txt Normal file → Executable file
View File

0
Distribution/doc/txt/oscam.user.txt Normal file → Executable file
View File

0
Distribution/doc/txt/oscam.whitelist.txt Normal file → Executable file
View File

0
Distribution/monitor/mpcsmon-src-0.6.tar.bz2 Normal file → Executable file
View File

0
Distribution/monitor/mpcsmon.sh Normal file → Executable file
View File

32
Makefile Normal file → Executable file
View File

@ -32,6 +32,9 @@ ifeq "$(shell ./config.sh --enabled WITH_SSL)" "Y"
override USE_SSL=1 override USE_SSL=1
override USE_LIBCRYPTO=1 override USE_LIBCRYPTO=1
endif endif
ifeq "$(shell ./config.sh --enabled WITH_EMU)" "Y"
override USE_LIBCRYPTO=1
endif
ifdef USE_SSL ifdef USE_SSL
override USE_LIBCRYPTO=1 override USE_LIBCRYPTO=1
endif endif
@ -371,6 +374,32 @@ SRC-$(CONFIG_CS_CACHEEX) += module-cccam-cacheex.c
SRC-$(CONFIG_MODULE_CCCAM) += module-cccam.c SRC-$(CONFIG_MODULE_CCCAM) += module-cccam.c
SRC-$(CONFIG_MODULE_CCCSHARE) += module-cccshare.c SRC-$(CONFIG_MODULE_CCCSHARE) += module-cccshare.c
SRC-$(CONFIG_MODULE_CONSTCW) += module-constcw.c SRC-$(CONFIG_MODULE_CONSTCW) += module-constcw.c
SRC-$(CONFIG_WITH_EMU) += module-emulator.c
SRC-$(CONFIG_WITH_EMU) += module-emulator-osemu.c
SRC-$(CONFIG_WITH_EMU) += module-emulator-biss.c
SRC-$(CONFIG_WITH_EMU) += module-emulator-cryptoworks.c
SRC-$(CONFIG_WITH_EMU) += module-emulator-director.c
SRC-$(CONFIG_WITH_EMU) += module-emulator-irdeto.c
SRC-$(CONFIG_WITH_EMU) += module-emulator-nagravision.c
SRC-$(CONFIG_WITH_EMU) += module-emulator-omnicrypt.c
SRC-$(CONFIG_WITH_EMU) += module-emulator-powervu.c
SRC-$(CONFIG_WITH_EMU) += module-emulator-viaccess.c
ifeq "$(CONFIG_WITH_EMU)" "y"
ifeq "$(CONFIG_WITH_SOFTCAM)" "y"
UNAME := $(shell uname -s)
ifneq ($(UNAME),Darwin)
ifndef ANDROID_NDK
ifndef ANDROID_STANDALONE_TOOLCHAIN
TOUCH_SK := $(shell touch SoftCam.Key)
override LDFLAGS += -Wl,--format=binary -Wl,SoftCam.Key -Wl,--format=default
ifneq ($(uname_S),Cygwin)
override LDFLAGS += -Wl,-z,noexecstack
endif
endif
endif
endif
endif
endif
SRC-$(CONFIG_CS_CACHEEX) += module-csp.c SRC-$(CONFIG_CS_CACHEEX) += module-csp.c
SRC-$(CONFIG_CW_CYCLE_CHECK) += module-cw-cycle-check.c SRC-$(CONFIG_CW_CYCLE_CHECK) += module-cw-cycle-check.c
SRC-$(CONFIG_WITH_AZBOX) += module-dvbapi-azbox.c SRC-$(CONFIG_WITH_AZBOX) += module-dvbapi-azbox.c
@ -931,6 +960,3 @@ debug: all
-include Makefile.extra -include Makefile.extra
-include Makefile.local -include Makefile.local
EXTRA_LIBS += -lm
LIBS += $(EXTRA_LIBS)

0
Makefile.extra Normal file → Executable file
View File

0
README.build Normal file → Executable file
View File

2
README.config Normal file → Executable file
View File

@ -81,7 +81,7 @@ Examples:
./config.sh --create-cert ecdsa prime256v1 ca 'My OSCam Distribution' ./config.sh --create-cert ecdsa prime256v1 ca 'My OSCam Distribution'
Available options: Available options:
addons: WEBIF WEBIF_LIVELOG WEBIF_JQUERY WITH_COMPRESS_WEBIF WITH_SSL HAVE_DVBAPI WITH_EXTENDED_CW WITH_NEUTRINO READ_SDT_CHARSETS CS_ANTICASC WITH_DEBUG MODULE_MONITOR WITH_LB CS_CACHEEX CS_CACHEEX_AIO CW_CYCLE_CHECK LCDSUPPORT LEDSUPPORT CLOCKFIX IPV6SUPPORT WITH_ARM_NEON WITH_SIGNING addons: WEBIF WEBIF_LIVELOG WEBIF_JQUERY WITH_COMPRESS_WEBIF WITH_SSL HAVE_DVBAPI WITH_EXTENDED_CW WITH_NEUTRINO READ_SDT_CHARSETS CS_ANTICASC WITH_DEBUG MODULE_MONITOR WITH_LB CS_CACHEEX CS_CACHEEX_AIO CW_CYCLE_CHECK LCDSUPPORT LEDSUPPORT CLOCKFIX IPV6SUPPORT WITH_ARM_NEON WITH_SIGNING WITH_EMU WITH_SOFTCAM
protocols: MODULE_CAMD33 MODULE_CAMD35 MODULE_CAMD35_TCP MODULE_NEWCAMD MODULE_CCCAM MODULE_CCCSHARE MODULE_GBOX MODULE_RADEGAST MODULE_SCAM MODULE_SERIAL MODULE_CONSTCW MODULE_PANDORA MODULE_GHTTP MODULE_STREAMRELAY protocols: MODULE_CAMD33 MODULE_CAMD35 MODULE_CAMD35_TCP MODULE_NEWCAMD MODULE_CCCAM MODULE_CCCSHARE MODULE_GBOX MODULE_RADEGAST MODULE_SCAM MODULE_SERIAL MODULE_CONSTCW MODULE_PANDORA MODULE_GHTTP MODULE_STREAMRELAY
readers: READER_NAGRA READER_NAGRA_MERLIN READER_IRDETO READER_CONAX READER_CRYPTOWORKS READER_SECA READER_VIACCESS READER_VIDEOGUARD READER_DRE READER_TONGFANG READER_BULCRYPT READER_GRIFFIN READER_DGCRYPT readers: READER_NAGRA READER_NAGRA_MERLIN READER_IRDETO READER_CONAX READER_CRYPTOWORKS READER_SECA READER_VIACCESS READER_VIDEOGUARD READER_DRE READER_TONGFANG READER_BULCRYPT READER_GRIFFIN READER_DGCRYPT
card_readers: CARDREADER_PHOENIX CARDREADER_INTERNAL CARDREADER_SC8IN1 CARDREADER_MP35 CARDREADER_SMARGO CARDREADER_DB2COM CARDREADER_STAPI CARDREADER_STAPI5 CARDREADER_STINGER CARDREADER_DRECAS card_readers: CARDREADER_PHOENIX CARDREADER_INTERNAL CARDREADER_SC8IN1 CARDREADER_MP35 CARDREADER_SMARGO CARDREADER_DB2COM CARDREADER_STAPI CARDREADER_STAPI5 CARDREADER_STINGER CARDREADER_DRECAS

0
README.dvbapi_protocol Normal file → Executable file
View File

221
README.md Normal file → Executable file
View File

@ -1,81 +1,188 @@
# OSCam: Open Source Conditional Access Module # OSCam with AI Fake DCW Detector Test
[![GitLab Last Commit](https://img.shields.io/gitlab/last-commit/11?gitlab_url=https%3A%2F%2Fgit.streamboard.tv&style=for-the-badge)](https://git.streamboard.tv/common/oscam/-/commits/master) ![AI Fake DCW Detector](images/image1.jpg)
[![GitLab Tag](https://img.shields.io/gitlab/v/tag/11?gitlab_url=https%3A%2F%2Fgit.streamboard.tv&style=for-the-badge)](https://git.streamboard.tv/common/oscam/-/tags)
[![GitLab License](https://img.shields.io/gitlab/license/11?gitlab_url=https%3A%2F%2Fgit.streamboard.tv&style=for-the-badge)](https://git.streamboard.tv/common/oscam/-/blob/master/COPYING)
## Quick links ## Overview
- [Releases](https://git.streamboard.tv/common/oscam/-/commits/master) This repository contains a modified version of **OSCam** enhanced with an advanced **AI-inspired Fake DCW Detection and Voting System**.
- [GitLab repository](https://git.streamboard.tv/common/oscam)
- [Wiki](https://git.streamboard.tv/common/oscam/-/wikis/home)
- [Issue tracker](https://git.streamboard.tv/common/oscam/-/issues)
- [Support forum](https://board.streamboard.tv/forum/)
The goal of this system is to improve stability and reliability when multiple Control Word (CW) sources are available, such as:
## Releases - Local readers
- CacheEx peers
- CSP sources
- Virtual readers
For the latest changes and release history, see the Instead of accepting the first CW received, this implementation collects multiple candidates and selects the most reliable one using weighted voting logic.
[OSCam commits](https://git.streamboard.tv/common/oscam/-/commits/master) page.
## GitLab repository ---
Project page: # 🔍 Problem It Solves
https://git.streamboard.tv/common/oscam
## Building & Dependencies In multi-reader or CacheEx environments, fake or unstable DCWs can appear.
For detailed information about building OSCam, cross-compilation for Default behavior:
different CPUs, required and optional dependencies, SSL support, hardware - First CW wins
modules, and platform-specific or distribution-specific notes, please - Possible glitches, freezing, or unstable decoding
refer to the OSCam wiki:
- [Wiki Home](https://git.streamboard.tv/common/oscam/-/wikis/home) 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
## License Result:
OSCam: Open Source CAM ✔ Reduced fake DCWs
✔ Increased decoding stability
✔ Better CacheEx reliability
✔ Smarter CW selection
Copyright (C) 2009-2026 OSCam developers ---
OSCam is based on the Streamboard mp-cardserver 0.9d by dukat and has been # 🧠 Core Functions
extended and worked on by many more since then.
This program is free software: you can redistribute it and/or modify it under ## 1`cw_vote_add()`
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT This function is called whenever a new CW is received.
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
You should have received a copy of the GNU General Public License along with It:
this program. If not, see <https://www.gnu.org/licenses/>.
For the full text of the license, please see the - Compares the CW with existing candidates
[COPYING](https://git.streamboard.tv/common/oscam/-/blob/master/COPYING) - Increases vote count if it matches
file in the OSCam repository. - 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
## Contributing Each CW candidate is stored in a voting pool.
Contributions are welcome. If you want to help improve OSCam: ---
- Browse the existing [issues](https://git.streamboard.tv/common/oscam/-/issues) ## 2`cw_vote_decide()`
and open a new issue if you find a bug or have a feature request.
- Fork the [GitLab repository](https://git.streamboard.tv/common/oscam),
create a topic branch, and submit a merge request.
- Check the [OSCam wiki](https://git.streamboard.tv/common/oscam/-/wikis/home)
for additional project information and guidelines.
## Help and Support This function determines the final CW to use.
### Decision Process
1. Count total votes
2. Verify minimum vote requirement
3. Calculate effective score:
4. Check for majority (> 50%)
5. Apply timeout logic
6. 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 selected
- `fallback = 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:
- `cwcacheexhit` counters 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.
- Man pages and configuration examples are available in the
`Distribution/doc` directory of the source tree.
- For bug reports and feature requests, please use the
[GitLab issue tracker](https://git.streamboard.tv/common/oscam/-/issues).
- For community help and general discussion (mainly German and English),
visit the [support forum](https://board.streamboard.tv/forum/).
- For configuration guides, FAQs, and detailed documentation, see the
[OSCam wiki](https://git.streamboard.tv/common/oscam/-/wikis/home).

0
caid,
View File

View File

@ -1,15 +1,17 @@
#ifndef CONFIG_H_ #ifndef CONFIG_H_
#define CONFIG_H_ #define CONFIG_H_
#define WITH_EMU 1
#define WITH_SOFTCAM 1
#define WEBIF 1 #define WEBIF 1
#define WEBIF_LIVELOG 1 #define WEBIF_LIVELOG 1
#define WEBIF_JQUERY 1 #define WEBIF_JQUERY 1
//#define WEBIF_WIKI 1 #define WEBIF_WIKI 1
#define WITH_COMPRESS_WEBIF 1 //#define WITH_COMPRESS_WEBIF 1
//#define WITH_SSL 1 //#define WITH_SSL 1
#if defined(__linux__) || defined(__CYGWIN__) #if defined(__linux__) || defined(__CYGWIN__)
//#define HAVE_DVBAPI 1 #define HAVE_DVBAPI 1
//#define WITH_EXTENDED_CW 1 #define WITH_EXTENDED_CW 1
#endif #endif
//#define WITH_NEUTRINO 1 //#define WITH_NEUTRINO 1
#define READ_SDT_CHARSETS 1 #define READ_SDT_CHARSETS 1
@ -22,46 +24,46 @@
#define CW_CYCLE_CHECK 1 #define CW_CYCLE_CHECK 1
//#define LCDSUPPORT 1 //#define LCDSUPPORT 1
//#define LEDSUPPORT 1 //#define LEDSUPPORT 1
//#define IPV6SUPPORT 1 #define IPV6SUPPORT 1
//#define WITH_ARM_NEON 1 //#define WITH_ARM_NEON 1
//#define WITH_SIGNING 1 //#define WITH_SIGNING 1
//#define MODULE_MONITOR 1 #define MODULE_MONITOR 1
//#define MODULE_CAMD33 1 #define MODULE_CAMD33 1
//#define MODULE_CAMD35 1 #define MODULE_CAMD35 1
#define MODULE_CAMD35_TCP 1 #define MODULE_CAMD35_TCP 1
#define MODULE_NEWCAMD 1 #define MODULE_NEWCAMD 1
#define MODULE_CCCAM 1 #define MODULE_CCCAM 1
#define MODULE_CCCSHARE 1 #define MODULE_CCCSHARE 1
//#define MODULE_GBOX 1 #define MODULE_GBOX 1
//#define MODULE_RADEGAST 1 #define MODULE_RADEGAST 1
//#define MODULE_SERIAL 1 //#define MODULE_SERIAL 1
//#define MODULE_CONSTCW 1 #define MODULE_CONSTCW 1
//#define MODULE_PANDORA 1 //#define MODULE_PANDORA 1
//#define MODULE_GHTTP 1 #define MODULE_GHTTP 1
//#define MODULE_SCAM 1 //#define MODULE_SCAM 1
//#define MODULE_STREAMRELAY 1 #define MODULE_STREAMRELAY 1
//#define WITH_CARDREADER 1 #define WITH_CARDREADER 1
#ifdef WITH_CARDREADER #ifdef WITH_CARDREADER
//#define READER_NAGRA 1 #define READER_NAGRA 1
//#define READER_NAGRA_MERLIN 1 #define READER_NAGRA_MERLIN 1
//#define READER_IRDETO 1 #define READER_IRDETO 1
//#define READER_CONAX 1 #define READER_CONAX 1
//#define READER_CRYPTOWORKS 1 #define READER_CRYPTOWORKS 1
//#define READER_SECA 1 #define READER_SECA 1
//#define READER_VIACCESS 1 #define READER_VIACCESS 1
//#define READER_VIDEOGUARD 1 #define READER_VIDEOGUARD 1
//#define READER_DRE 1 #define READER_DRE 1
//#define READER_TONGFANG 1 #define READER_TONGFANG 1
//#define READER_BULCRYPT 1 #define READER_BULCRYPT 1
//#define READER_GRIFFIN 1 #define READER_GRIFFIN 1
//#define READER_DGCRYPT 1 #define READER_DGCRYPT 1
//#define CARDREADER_PHOENIX 1 #define CARDREADER_PHOENIX 1
//#define CARDREADER_INTERNAL 1 #define CARDREADER_INTERNAL 1
//#define CARDREADER_MP35 1 //#define CARDREADER_MP35 1
//#define CARDREADER_SC8IN1 1 //#define CARDREADER_SC8IN1 1
//#define CARDREADER_SMARGO 1 //#define CARDREADER_SMARGO 1
@ -70,7 +72,7 @@
//#define CARDREADER_DRECAS 1 //#define CARDREADER_DRECAS 1
#ifdef WITH_PCSC #ifdef WITH_PCSC
#define CARDREADER_PCSC 1 //#define CARDREADER_PCSC 1
#endif #endif
#ifdef WITH_LIBUSB #ifdef WITH_LIBUSB

View File

@ -1 +0,0 @@
EXTRA_LIBS += -lm

64
config.sh Normal file → Executable file
View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
addons="WEBIF WEBIF_LIVELOG WEBIF_JQUERY WEBIF_WIKI WITH_COMPRESS_WEBIF WITH_SSL HAVE_DVBAPI WITH_EXTENDED_CW WITH_NEUTRINO READ_SDT_CHARSETS CS_ANTICASC WITH_DEBUG MODULE_MONITOR WITH_LB CS_CACHEEX CS_CACHEEX_AIO CW_CYCLE_CHECK LCDSUPPORT LEDSUPPORT CLOCKFIX IPV6SUPPORT WITH_ARM_NEON WITH_SIGNING" addons="WEBIF WEBIF_LIVELOG WEBIF_JQUERY WEBIF_WIKI WITH_COMPRESS_WEBIF WITH_SSL HAVE_DVBAPI WITH_EXTENDED_CW WITH_NEUTRINO READ_SDT_CHARSETS CS_ANTICASC WITH_DEBUG MODULE_MONITOR WITH_LB CS_CACHEEX CS_CACHEEX_AIO CW_CYCLE_CHECK LCDSUPPORT LEDSUPPORT CLOCKFIX IPV6SUPPORT WITH_ARM_NEON WITH_SIGNING WITH_EMU WITH_SOFTCAM"
protocols="MODULE_CAMD33 MODULE_CAMD35 MODULE_CAMD35_TCP MODULE_NEWCAMD MODULE_CCCAM MODULE_CCCSHARE MODULE_GBOX MODULE_RADEGAST MODULE_SCAM MODULE_SERIAL MODULE_CONSTCW MODULE_PANDORA MODULE_GHTTP MODULE_STREAMRELAY" protocols="MODULE_CAMD33 MODULE_CAMD35 MODULE_CAMD35_TCP MODULE_NEWCAMD MODULE_CCCAM MODULE_CCCSHARE MODULE_GBOX MODULE_RADEGAST MODULE_SCAM MODULE_SERIAL MODULE_CONSTCW MODULE_PANDORA MODULE_GHTTP MODULE_STREAMRELAY"
readers="READER_NAGRA READER_NAGRA_MERLIN READER_IRDETO READER_CONAX READER_CRYPTOWORKS READER_SECA READER_VIACCESS READER_VIDEOGUARD READER_DRE READER_TONGFANG READER_BULCRYPT READER_GRIFFIN READER_DGCRYPT" readers="READER_NAGRA READER_NAGRA_MERLIN READER_IRDETO READER_CONAX READER_CRYPTOWORKS READER_SECA READER_VIACCESS READER_VIDEOGUARD READER_DRE READER_TONGFANG READER_BULCRYPT READER_GRIFFIN READER_DGCRYPT"
card_readers="CARDREADER_PHOENIX CARDREADER_INTERNAL CARDREADER_SC8IN1 CARDREADER_MP35 CARDREADER_SMARGO CARDREADER_DB2COM CARDREADER_STAPI CARDREADER_STAPI5 CARDREADER_STINGER CARDREADER_DRECAS" card_readers="CARDREADER_PHOENIX CARDREADER_INTERNAL CARDREADER_SC8IN1 CARDREADER_MP35 CARDREADER_SMARGO CARDREADER_DB2COM CARDREADER_STAPI CARDREADER_STAPI5 CARDREADER_STINGER CARDREADER_DRECAS"
@ -9,40 +9,42 @@ defconfig="
CONFIG_WEBIF=y CONFIG_WEBIF=y
CONFIG_WEBIF_LIVELOG=y CONFIG_WEBIF_LIVELOG=y
CONFIG_WEBIF_JQUERY=y CONFIG_WEBIF_JQUERY=y
# CONFIG_WEBIF_WIKI=n CONFIG_WEBIF_WIKI=y
CONFIG_WITH_COMPRESS_WEBIF=y CONFIG_WITH_COMPRESS_WEBIF=y
# CONFIG_WITH_SSL=n CONFIG_WITH_SSL=y
CONFIG_HAVE_DVBAPI=y CONFIG_HAVE_DVBAPI=y
# CONFIG_WITH_EXTENDED_CW=n CONFIG_WITH_EXTENDED_CW=y
# CONFIG_WITH_NEUTRINO=n # CONFIG_WITH_NEUTRINO=n
CONFIG_READ_SDT_CHARSETS=y CONFIG_READ_SDT_CHARSETS=y
# CONFIG_CS_ANTICASC=n CONFIG_CS_ANTICASC=y
CONFIG_WITH_DEBUG=y CONFIG_WITH_DEBUG=y
CONFIG_MODULE_MONITOR=y CONFIG_MODULE_MONITOR=y
CONFIG_WITH_LB=y CONFIG_WITH_LB=y
# CONFIG_CS_CACHEEX=n CONFIG_CS_CACHEEX=y
# CONFIG_CS_CACHEEX_AIO=n CONFIG_CS_CACHEEX_AIO=y
# CONFIG_CW_CYCLE_CHECK=n CONFIG_CW_CYCLE_CHECK=y
# CONFIG_LCDSUPPORT=n CONFIG_LCDSUPPORT=y
# CONFIG_LEDSUPPORT=n CONFIG_LEDSUPPORT=y
# CONFIG_CLOCKFIX=n CONFIG_CLOCKFIX=y
# CONFIG_IPV6SUPPORT=n CONFIG_IPV6SUPPORT=y
# CONFIG_WITH_ARM_NEON=n # CONFIG_WITH_ARM_NEON=n
# CONFIG_WITH_SIGNING=n CONFIG_WITH_SIGNING=n
# CONFIG_MODULE_CAMD33=n CONFIG_WITH_EMU=y
CONFIG_WITH_SOFTCAM=y
CONFIG_MODULE_CAMD33=n
CONFIG_MODULE_CAMD35=y CONFIG_MODULE_CAMD35=y
CONFIG_MODULE_CAMD35_TCP=y CONFIG_MODULE_CAMD35_TCP=y
CONFIG_MODULE_NEWCAMD=y CONFIG_MODULE_NEWCAMD=y
CONFIG_MODULE_CCCAM=y CONFIG_MODULE_CCCAM=y
CONFIG_MODULE_CCCSHARE=y CONFIG_MODULE_CCCSHARE=y
CONFIG_MODULE_GBOX=y CONFIG_MODULE_GBOX=y
# CONFIG_MODULE_RADEGAST=n CONFIG_MODULE_RADEGAST=y
# CONFIG_MODULE_SERIAL=n CONFIG_MODULE_SERIAL=y
# CONFIG_MODULE_CONSTCW=n CONFIG_MODULE_CONSTCW=y
# CONFIG_MODULE_PANDORA=n CONFIG_MODULE_PANDORA=y
# CONFIG_MODULE_SCAM=n CONFIG_MODULE_SCAM=y
# CONFIG_MODULE_GHTTP=n CONFIG_MODULE_GHTTP=y
# CONFIG_MODULE_STREAMRELAY=n CONFIG_MODULE_STREAMRELAY=y
CONFIG_WITH_CARDREADER=y CONFIG_WITH_CARDREADER=y
CONFIG_READER_NAGRA_COMMON=y CONFIG_READER_NAGRA_COMMON=y
CONFIG_READER_NAGRA=y CONFIG_READER_NAGRA=y
@ -331,8 +333,8 @@ get_opts() {
update_deps() { update_deps() {
# Calculate dependencies # Calculate dependencies
enabled_any $(get_opts readers) $(get_opts card_readers) && enable_opt WITH_CARDREADER >/dev/null enabled_any $(get_opts readers) $(get_opts card_readers) WITH_EMU && enable_opt WITH_CARDREADER >/dev/null
disabled_all $(get_opts readers) $(get_opts card_readers) && disable_opt WITH_CARDREADER >/dev/null disabled_all $(get_opts readers) $(get_opts card_readers) WITH_EMU && disable_opt WITH_CARDREADER >/dev/null
disabled WEBIF && disable_opt WEBIF_LIVELOG >/dev/null disabled WEBIF && disable_opt WEBIF_LIVELOG >/dev/null
disabled WEBIF && disable_opt WEBIF_JQUERY >/dev/null disabled WEBIF && disable_opt WEBIF_JQUERY >/dev/null
disabled WEBIF && disable_opt WEBIF_WIKI >/dev/null disabled WEBIF && disable_opt WEBIF_WIKI >/dev/null
@ -341,6 +343,9 @@ update_deps() {
enabled_any CARDREADER_DB2COM CARDREADER_MP35 CARDREADER_SC8IN1 CARDREADER_STINGER && enable_opt CARDREADER_PHOENIX >/dev/null enabled_any CARDREADER_DB2COM CARDREADER_MP35 CARDREADER_SC8IN1 CARDREADER_STINGER && enable_opt CARDREADER_PHOENIX >/dev/null
enabled CS_CACHEEX_AIO && enable_opt CS_CACHEEX >/dev/null enabled CS_CACHEEX_AIO && enable_opt CS_CACHEEX >/dev/null
enabled WITH_SIGNING && enable_opt WITH_SSL >/dev/null enabled WITH_SIGNING && enable_opt WITH_SSL >/dev/null
enabled WITH_EMU && enable_opt READER_VIACCESS >/dev/null
enabled WITH_EMU && enable_opt MODULE_NEWCAMD >/dev/null
disabled WITH_EMU && disable_opt WITH_SOFTCAM >/dev/null
} }
list_config() { list_config() {
@ -392,9 +397,9 @@ list_config() {
not_have_flag USE_LIBCRYPTO && echo "CONFIG_LIB_AES=y" || echo "# CONFIG_LIB_AES=n" not_have_flag USE_LIBCRYPTO && echo "CONFIG_LIB_AES=y" || echo "# CONFIG_LIB_AES=n"
enabled MODULE_CCCAM && echo "CONFIG_LIB_RC6=y" || echo "# CONFIG_LIB_RC6=n" enabled MODULE_CCCAM && echo "CONFIG_LIB_RC6=y" || echo "# CONFIG_LIB_RC6=n"
not_have_flag USE_LIBCRYPTO && enabled MODULE_CCCAM && echo "CONFIG_LIB_SHA1=y" || echo "# CONFIG_LIB_SHA1=n" not_have_flag USE_LIBCRYPTO && enabled MODULE_CCCAM && echo "CONFIG_LIB_SHA1=y" || echo "# CONFIG_LIB_SHA1=n"
enabled_any READER_DRE MODULE_SCAM READER_VIACCESS READER_NAGRA READER_NAGRA_MERLIN READER_VIDEOGUARD READER_CONAX READER_TONGFANG && echo "CONFIG_LIB_DES=y" || echo "# CONFIG_LIB_DES=n" enabled_any READER_DRE MODULE_SCAM READER_VIACCESS READER_NAGRA READER_NAGRA_MERLIN READER_VIDEOGUARD READER_CONAX READER_TONGFANG WITH_EMU && echo "CONFIG_LIB_DES=y" || echo "# CONFIG_LIB_DES=n"
enabled_any MODULE_CCCAM READER_NAGRA READER_NAGRA_MERLIN READER_SECA && echo "CONFIG_LIB_IDEA=y" || echo "# CONFIG_LIB_IDEA=n" enabled_any MODULE_CCCAM READER_NAGRA READER_NAGRA_MERLIN READER_SECA WITH_EMU && echo "CONFIG_LIB_IDEA=y" || echo "# CONFIG_LIB_IDEA=n"
not_have_flag USE_LIBCRYPTO && enabled_any READER_CONAX READER_CRYPTOWORKS READER_NAGRA READER_NAGRA_MERLIN && echo "CONFIG_LIB_BIGNUM=y" || echo "# CONFIG_LIB_BIGNUM=n" not_have_flag USE_LIBCRYPTO && enabled_any READER_CONAX READER_CRYPTOWORKS READER_NAGRA READER_NAGRA_MERLIN WITH_EMU && echo "CONFIG_LIB_BIGNUM=y" || echo "# CONFIG_LIB_BIGNUM=n"
enabled READER_NAGRA_MERLIN && echo "CONFIG_LIB_MDC2=y" || echo "# CONFIG_LIB_MDC2=n" enabled READER_NAGRA_MERLIN && echo "CONFIG_LIB_MDC2=y" || echo "# CONFIG_LIB_MDC2=n"
enabled READER_NAGRA_MERLIN && echo "CONFIG_LIB_FAST_AES=y" || echo "# CONFIG_LIB_FAST_AES=n" enabled READER_NAGRA_MERLIN && echo "CONFIG_LIB_FAST_AES=y" || echo "# CONFIG_LIB_FAST_AES=n"
enabled_any READER_NAGRA_MERLIN WITH_SIGNING && echo "CONFIG_LIB_SHA256=y" || echo "# CONFIG_LIB_SHA256=n" enabled_any READER_NAGRA_MERLIN WITH_SIGNING && echo "CONFIG_LIB_SHA256=y" || echo "# CONFIG_LIB_SHA256=n"
@ -524,6 +529,8 @@ menu_addons() {
IPV6SUPPORT "IPv6 support (experimental)" $(check_test "IPV6SUPPORT") \ IPV6SUPPORT "IPv6 support (experimental)" $(check_test "IPV6SUPPORT") \
WITH_ARM_NEON "ARM NEON (SIMD/MPE) support" $(check_test "WITH_ARM_NEON") \ WITH_ARM_NEON "ARM NEON (SIMD/MPE) support" $(check_test "WITH_ARM_NEON") \
WITH_SIGNING "Binary signing with X.509 certificate" $(check_test "WITH_SIGNING") \ WITH_SIGNING "Binary signing with X.509 certificate" $(check_test "WITH_SIGNING") \
WITH_EMU "Emulator support" $(check_test "WITH_EMU") \
WITH_SOFTCAM "Built-in SoftCam.Key" $(check_test "WITH_SOFTCAM") \
2> ${tempfile} 2> ${tempfile}
opt=${?} opt=${?}
@ -906,7 +913,8 @@ do
;; ;;
'-v'|'--oscam-version') '-v'|'--oscam-version')
version=`grep '^#define CS_VERSION' globals.h | cut -d\" -f2` version=`grep '^#define CS_VERSION' globals.h | cut -d\" -f2`
echo $version emuversion=`grep EMU_VERSION module-emulator-osemu.h | awk '{ print $3 }'`
echo $version-$emuversion
break break
;; ;;
'--submodule') '--submodule')
@ -957,7 +965,7 @@ do
break break
;; ;;
'-c'|'--oscam-commit') '-c'|'--oscam-commit')
sha=`git log 2>/dev/null | sed -n 1p | cut -d ' ' -f2 | cut -c1-8` sha=`git log --no-merges 2>/dev/null | sed -n 1p | cut -d ' ' -f2 | cut -c1-8`
echo $sha echo $sha
break break
;; ;;

0
cscrypt/CMakeLists.txt Normal file → Executable file
View File

0
cscrypt/Makefile Normal file → Executable file
View File

0
cscrypt/aes.c Normal file → Executable file
View File

0
cscrypt/aes.h Normal file → Executable file
View File

0
cscrypt/bn.h Normal file → Executable file
View File

0
cscrypt/bn_add.c Normal file → Executable file
View File

0
cscrypt/bn_asm.c Normal file → Executable file
View File

0
cscrypt/bn_ctx.c Normal file → Executable file
View File

0
cscrypt/bn_div.c Normal file → Executable file
View File

0
cscrypt/bn_exp.c Normal file → Executable file
View File

0
cscrypt/bn_lcl.h Normal file → Executable file
View File

0
cscrypt/bn_lib.c Normal file → Executable file
View File

0
cscrypt/bn_mul.c Normal file → Executable file
View File

0
cscrypt/bn_print.c Normal file → Executable file
View File

0
cscrypt/bn_shift.c Normal file → Executable file
View File

Some files were not shown because too many files have changed in this diff Show More