oscam
Contents
About
OSCam: Open Source Conditional Access Module
OSCam is based on the Streamboard mp-cardserver 0.9d by dukat and has been extended and worked on by many more since then.
Toolchain
Get target architecture
I guess the "l" is for "little endian (by default)".
It's a Broadcom BCM 7444S.
Install toolchain
1 aptitude install gcc-arm-linux-gnueabi
OScam source
1 sudo apt install subversion subversion-tools git
Dependencies
- PCSC
- Middleware to access a smart card using SCard API (PC/SC).
- SH4 STAPI support
- SH4 STAPI5 support
- Coolapi support
- AZBOX support
Compile libusb
1 aptitude install libudev-dev
When compiling from git, remember that you may have to run ./autogen.sh, ./bootstrap.sh or run the autotools creation utilities, in order to have configure and Makefile created for you. The difference between autogen.sh and bootstrap.sh is that the former will invoke configure with a set of default options, whereas the latter will not.
Compile libpcsc
1 git clone https://salsa.debian.org/rousseau/PCSC.git
2 cd PCSC
3 ./bootstrap
4 ./configure --help
5 ./configure \
6 --host="arm-linux-gnueabi" \
7 --prefix="/usr/local" \
8 --disable-libudev \
9 --disable-libsystemd \
10 --disable-libusb
11
12 ### DOES NOT COMPILE WITH LIBUSB SUPPORT
13 ./configure \
14 --host="arm-linux-gnueabi" \
15 --prefix="/usr/local" \
16 --disable-libudev \
17 --disable-libsystemd \
18 --enable-libusb \
19 LIBUSB_CFLAGS="-I../libusb/libusb/" \
20 LIBUSB_LIBS="../libusb/libusb/.libs/libusb-1.0.so"
21 make -j32
Compile libssl/libcrypto
Compile OScam
1 cd ~/workspace/software/vuplus/oscam-svn
2 ./config.sh --enable IPV6SUPPORT --disable WITH_PCSC WITH_SSL
3 make static \
4 -j32 \
5 EXTRA_CFLAGS="-I../openssl/include" \
6 CONF_DIR=/etc \
7 LIBUSB_LIB="../libusb/libusb/.libs/libusb-1.0.a" \
8 USE_LIBUSB=1 \
9 CROSS="arm-linux-gnueabi-"
10 ### DEBUG DOES NOT LINK SUCESSFULLY AGAINST OPENSSL LATEST
11 ### OR LIBPCSC
12 ./config.sh --enable IPV6SUPPORT WITH_SSL --disable WITH_PCSC
13 make static \
14 -j32 \
15 EXTRA_CFLAGS="-I../openssl/include" \
16 CONF_DIR=/etc \
17 LIBUSB_LIB="../libusb/libusb/.libs/libusb-1.0.a" \
18 USE_LIBUSB=1 \
19 SSL_LIB="../openssl/libssl.a" \
20 USE_SSL=1 \
21 LIBCRYPTO_LIB="../openssl/libcrypto.a" \
22 USE_LIBCRYPTO=1 \
23 USE_PCSC=0 \
24 CROSS="arm-linux-gnueabi-"
Create a ipk package
Works with some embedded systems like vuplus, openwrt or ddwrt.
Dissecting a package
Show contents of package
Extract package
File types
1 package-name.ipk: Debian binary package (format 2.0), with data.tar.gz/ , data compression gz/
2 recon/control.tar.gz: gzip compressed data, last modified: Mon May 1 17:36:45 2017, from Unix, original size modulo 2^32 10240
3 recon/data.tar.gz: gzip compressed data, last modified: Mon May 1 17:36:45 2017, from Unix, original size modulo 2^32 1064960
4 recon/debian-binary: ASCII text
tar tzf control.tar.gz
tar tzf data.tar.gz
Unpack tar-files
debian-binary
1 2.0
Archive contents
prepare structure
package/control/conffiles
package/control/control
1 Package: oscam-custom
2 Version: 1.20-svn11581
3 Description: Custom OScam
4 Architecture: vuultimo4k
5 Section: extra
6 Priority: optional
7 Maintainer: Tobias Stein <grand.ouvert@googlemail.com>
8 Homepage: http://www.streamboard.tv/
9 Depends: libc6(>=2.24-r0), libcrypto1.0.0(>=1.0.2j-r0.6), libssl1.0.0(>=1.0.2j-r0.6), openssl(>=1.0.2j-r0.6), pcsc-lite-lib(>=1.8.8-r4)
10 Source: http://www.streamboard.tv/svn/oscam/trunk
package/data/etc/oscam/oscam.conf
1 [global]
2 usrfile = /var/log/oscamuser.log
3 logfile = /var/log/oscam.log
4 maxlogsize = 20
5 nice = -1
6 #emmlogdir =
7
8 [cccam]
9 port = 12000
10 reshare = 0
11 version = 2.3.0
12
13 [dvbapi]
14 enabled = 1
15 au = 1
16 boxtype = dreambox
17 user = dvbapiau
18
19 [webif]
20 ###Default
21 #httpport = 8888
22 httpport = 83
23 httpallowed = 127.0.0.1,192.168.182.0/24
24 httpuser = oscam
25 httppwd = oscam
26 httphelplang = de
27 httprefresh = 10
28 httppollrefresh = 10
29 httphideidleclients = 0
30 httpreadonly = 0
31 httpsavefullcfg = 0
32
33 #[cs357x]
34 #port = 44357
35 ###und/oder
36
37 #[newcamd]
38 #Port = 34000@09C4:000000;34001@1830:003411
39 #key = 0102030405060708091011121314
40
package/data/etc/oscam/oscam.dvbapi
1 # dvbapi configuration
2 #
3 # types:
4 # P - Priority
5 # format:
6 # P: <caid>:[<provider>]:[<srvid>]:[<ecmpid>]
7 # I - Ignore
8 # format:
9 # I: <caid>:[<provider>]:[<srvid>]:[<ecmpid>]
10 # M - Map
11 # format:
12 # M: <caid>:[<provider>]:[<srvid>]:[<ecmpid>] <target caid>:[<target provider>]
13 # D - Delay
14 # format:
15 # D: <caid>:[<provider>]:[<srvid>]:[<ecmpid>] <delay (ms)>
16 #
17 #
18 #
19 #P: 0500:023800 # SRG 2.6
20 #P: 0D05 # ORF CW / EMU
21 #P: 0D95 # ORF ICE
22 #P: 1830:003411 # HD01
23 #P: 1843:003411 # HD02
24 #P: 1702 # S02
25 #P: 1833 # S02HD ohne Betatunnel
26 #P: 094C # V13
27 #P: 098C # V14
28
package/data/etc/oscam/oscam.server
1 # oscam.server generated automatically by Streamboard OSCAM 1.20-EMU-NFR SVN r8986
2 # Read more: http://www.streamboard.tv/svn/oscam/trunk/Distribution/doc/txt/oscam.server.txt
3
4 [reader]
5 label = reader0_sky_s02
6 enable = 0
7 protocol = internal
8 device = /dev/sci0
9 caid = 1702,1833
10 boxkey = 1122334455667788
11 detect = cd
12 mhz = 600
13 cardmhz = 600
14 group = 1
15 emmcache = 1,3,2
16
17 [reader]
18 label = reader0_sky_v13
19 enable = 0
20 protocol = internal
21 device = /dev/sci0
22 caid = 09C4
23 boxid = 596C3056
24 detect = cd
25 group = 1
26 emmcache = 1,3,2
27
28 [reader]
29 label = reader0_sky_v14
30 enable = 0
31 protocol = internal
32 device = /dev/sci0
33 caid = 098C
34 boxid = 12345678
35 detect = cd
36 group = 1
37 emmcache = 1,3,2
38
39 [reader]
40 label = reader0_hd+_hd01
41 enable = 0
42 protocol = internal
43 device = /dev/sci0
44 caid = 1830
45 boxkey = A7642F57BC96D37C
46 rsakey = BF358B5461863130686FC933FB541FFCED682F3680F09DBC1A23829FB3B2F766B9DD1BF3B3ECC9AD6661B753DCC3A9624156F9EB64E8168EF09E4D9C5CCA4DD5
47 detect = cd
48 mhz = 368
49 cardmhz = 368
50 group = 1
51 emmcache = 1,3,2
52
53 [reader]
54 label = reader0_hd+_hd02
55 enable = 0
56 protocol = internal
57 device = /dev/sci0
58 caid = 1843
59 boxkey = A7642F57BC96D37C
60 rsakey = BF358B5461863130686FC933FB541FFCED682F3680F09DBC1A23829FB3B2F766B9DD1BF3B3ECC9AD6661B753DCC3A9624156F9EB64E8168EF09E4D9C5CCA4DD5
61 detect = cd
62 mhz = 368
63 cardmhz = 368
64 group = 1
65 emmcache = 1,3,2
66
67 [reader]
68 label = reader0_srg_via
69 enable = 0
70 protocol = internal
71 device = /dev/sci0
72 caid = 0500
73 detect = cd
74 group = 1
75 emmcache = 1,3,2
76
77 [reader]
78 label = reader0_orf_0d95
79 enable = 0
80 protocol = internal
81 device = /dev/sci0
82 caid = 0D95
83 detect = cd
84 group = 1
85 emmcache = 1,3,2
86
87 [reader]
88 label = reader0_orf_0d05
89 enable = 0
90 protocol = internal
91 device = /dev/sci0
92 caid = 0D05
93 detect = cd
94 group = 1
95 emmcache = 1,3,2
96
97 [reader]
98 label = reader0_smarthd
99 enable = 0
100 protocol = internal
101 device = /dev/sci0
102 caid = 0B01
103 detect = cd
104 mhz = 500
105 cardmhz = 357
106 ident = 0B01:000000
107 group = 1
108 emmcache = 1,3,-1
109
110 [reader]
111 label = reader1_sky_s02
112 enable = 0
113 protocol = internal
114 device = /dev/sci1
115 caid = 1702,1833
116 boxkey = 1122334455667788
117 detect = cd
118 mhz = 600
119 cardmhz = 600
120 group = 2
121 emmcache = 1,3,2
122
123 [reader]
124 label = reader1_sky_v13
125 enable = 0
126 protocol = internal
127 device = /dev/sci1
128 caid = 09C4
129 boxid = 596C3056
130 detect = cd
131 group = 2
132 emmcache = 1,3,2
133
134 [reader]
135 label = reader1_sky_v14
136 enable = 0
137 protocol = internal
138 device = /dev/sci1
139 caid = 098C
140 boxid = 12345678
141 detect = cd
142 group = 2
143 emmcache = 1,3,2
144
145 [reader]
146 label = reader1_hd+_hd01
147 enable = 0
148 protocol = internal
149 device = /dev/sci1
150 caid = 1830
151 boxkey = A7642F57BC96D37C
152 rsakey = BF358B5461863130686FC933FB541FFCED682F3680F09DBC1A23829FB3B2F766B9DD1BF3B3ECC9AD6661B753DCC3A9624156F9EB64E8168EF09E4D9C5CCA4DD5
153 detect = cd
154 mhz = 368
155 cardmhz = 368
156 group = 2
157 emmcache = 1,3,2
158
159 [reader]
160 label = reader1_hd+_hd02
161 enable = 0
162 protocol = internal
163 device = /dev/sci1
164 caid = 1843
165 boxkey = A7642F57BC96D37C
166 rsakey = BF358B5461863130686FC933FB541FFCED682F3680F09DBC1A23829FB3B2F766B9DD1BF3B3ECC9AD6661B753DCC3A9624156F9EB64E8168EF09E4D9C5CCA4DD5
167 detect = cd
168 mhz = 368
169 cardmhz = 368
170 group = 2
171 emmcache = 1,3,2
172
173 [reader]
174 label = reader1_srg_via
175 enable = 0
176 protocol = internal
177 device = /dev/sci1
178 caid = 0500
179 detect = cd
180 group = 2
181 emmcache = 1,3,2
182
183 [reader]
184 label = reader1_orf_0d95
185 enable = 0
186 protocol = internal
187 device = /dev/sci1
188 caid = 0D95
189 detect = cd
190 group = 2
191 emmcache = 1,3,2
192
193 [reader]
194 label = reader1_orf_0d05
195 enable = 0
196 protocol = internal
197 device = /dev/sci1
198 caid = 0D05
199 detect = cd
200 group = 2
201 emmcache = 1,3,2
202
203 [reader]
204 label = reader1_smarthd
205 enable = 0
206 protocol = internal
207 device = /dev/sci1
208 caid = 0B01
209 detect = cd
210 mhz = 500
211 cardmhz = 357
212 ident = 0B01:000000
213 group = 2
214 emmcache = 1,3,-1
215
216
217 [reader]
218 label = line_cccam
219 enable = 0
220 protocol = cccam
221 device = 192.168.0.11,12000
222 user = user
223 password = pass
224 inactivitytimeout = 30
225 fallback = 1
226 group = 3
227 cccversion = 2.3.0
228 ccckeepalive = 1
229
230 [reader]
231 label = line_newcamd
232 enable = 0
233 protocol = newcamd
234 device = 192.168.0.11,35000
235 key = 0102030405060708091011121314
236 user = user
237 password = password
238 fallback = 1
239 group = 4
240
241 #[reader]
242 #label = D09
243 #protocol = internal
244 #device = /dev/sci0
245 #rsakey = 8A..ohne umbruch & ohne leerzeichen..11
246 #boxkey = 66..ohne umbruch & ohne leerzeichen..7B
247 #autospeed = 1
248 #### bis SVN 9099 diese Einstellungen benutzen
249 ##mhz = 368
250 ##cardmhz = 368
251 #group = 1
252 #emmcache = 1,1,2
253
package/data/etc/oscam/oscam.user
package/data/etc/init.d/oscam-custom.sh
1 #!/bin/bash
2
3 EMUNAME="oscam_svn11581 1.20 11581"
4 BINARY="/usr/bin/oscam-1.20-svn11581"
5 BASENAME="$(basename "$BINARY")"
6
7 if [ "$1" == "start" ]; then
8 "$BINARY" -b -r 2 -c /etc/oscam
9 elif [ "$1" == "stop" ]; then
10 killall "$BASENAME"
11 elif [ "$1" == "kill" ]; then
12 killall -9 "$BASENAME"
13 elif [ "$1" == "status" ]; then
14 ps faux |grep oscam |grep -v grep
15 fi
package/data/etc/oscam_11581.emu
ipk.sh
A small script to create a ipk archive
ipk.sh
1 ipk.sh
2 #!/bin/bash
3
4 SELF="$(basename "$0")"
5
6 # Note that we use "$@" to let each command-line parameter expand to a
7 # separate word. The quotes around "$@" are essential!
8 # We need TEMP as the 'eval set --' would nuke the return value of getopt.
9 TEMP=$(getopt -o 'o:s:' --long 'out:,src:' -n "$SELF" -- "$@")
10
11 if [ $? -ne 0 ]; then
12 echo 'Error parsing options. Exiting…' >&2
13 exit 1
14 fi
15
16 # Note the quotes around "$TEMP": they are essential!
17 eval set -- "$TEMP"
18 unset TEMP
19
20 while true; do
21 case "$1" in
22 '-o'|'--out')
23 OUT="$2"
24 shift 2
25 continue
26 ;;
27 '-p'|'--pack')
28 MODE="PACK"
29 shift
30 continue
31 ;;
32 '-s'|'--src')
33 SRC="$2"
34 shift 2
35 continue
36 ;;
37 '-u'|'--unpack')
38 MODE="UNPACK"
39 shift
40 continue
41 ;;
42 '--')
43 shift
44 break
45 ;;
46 *)
47 echo "Error: Unknown option '$1'" >&2
48 exit 1
49 ;;
50 esac
51 done
52
53 if [ "$MODE" = "PACK" ]; then
54 echo "MODE: pack"
55 fi
56
57 ### SANITY
58 if [ -d "$SRC" ]; then
59 cd "$SRC/.." || exit 1
60 elif [ -z "$SRC" ]; then
61 echo "Please specify a source directory. Exiting…"
62 exit 1
63 else
64 echo "Source directory '$SRC' does not exist. Exiting…"
65 exit 1
66 fi
67
68 if [ -z "$OUT" ]; then
69 echo "Please specify a output file. Exiting…"
70 exit 1
71 fi
72
73 declare -a STRUCTURE
74 STRUCTURE=( "debian-binary" "data.tar.gz" "control.tar.gz" )
75
76 echo "2.0" > "$SRC/debian-binary"
77 tar czf "$SRC/control.tar.gz" -C "$SRC/control" ./
78 tar czf "$SRC/data.tar.gz" -C "$SRC/data" ./
79 ar rDvs "$OUT" "${STRUCTURE[@]/#/$SRC/}"
80 #rm "${STRUCTURE[@]/#/$SRC/}"
81 rm "data.tar.gz" "control.tar.gz"
Install ipk
1 scp oscam-custom_1.20-svn11581_vuultimo4k.ipk vuplus:
2
3 opkg info oscam-custom_1.20-svn11581_vuultimo4k.ipk
4 Package: oscam-custom
5 Version: 1.20-svn11581
6 Depends: libc6 (>= 2.24-r0), libcrypto1.0.0 (>= 1.0.2j-r0.6), libssl1.0.0 (>= 1.0.2j-r0.6), openssl (>= 1.0.2j-r0.6), pcsc-lite-lib (>= 1.8.8-r4)
7 Status: unknown ok not-installed
8 Section: extra
9 Architecture: vuultimo4k
10 Maintainer: Tobias Stein <grand.ouvert@googlemail.com>
11 Source: http://www.streamboard.tv/svn/oscam/trunk
12 Description: Custom OScam
13
14 opkg install oscam-custom_1.20-svn11581_vuultimo4k.ipk
15 Installing oscam-custom (1.20) on root.
16 Existing conffile /etc/oscam/oscam.conf is different from the conffile in the new package.
17 The new conffile will be placed at /etc/oscam/oscam.conf-opkg.
18 Existing conffile /etc/oscam/oscam.server is different from the conffile in the new package.
19 The new conffile will be placed at /etc/oscam/oscam.server-opkg.
20 Configuring oscam-custom.
21
22 /etc/init.d/oscam-custom.sh start
23 /etc/init.d/oscam-custom.sh status