Thursday, October 15, 2009

How to config CWSHARE ?

CWSHARE.CFG HOWTO
Originaly by REVOLTE on the Marahibs forum edited by Samot4 and altered with sugestions from Pow.
Cwshare.cfg
This is an example of cwshare.cfg with the most important communication lines:

M: { box1.dyndns.org { 11111111 }}
#
D: { box2.dyndns.org { 5566 5580 { 22222222 { A3 A3 }}}}
D: { box3.dyndns.org { 5566 5566 { 33333333 { A3 A3 }}}}
#
D: { 192.168.1.102 { 5566 5590{ 44444444 { A3 A3 }}}}



The M-line. M: { you’re DNSNAME { you’re password }}
• The DNS name is the name that you did sign up for.
• The password contains 8 numbers/letters 1-9 A-F

The D-line. D :{ DNSNAME { PORT1 PORT2 { password { share level 2 x }}}}

• The DNSNAME is the name the one you are going to share with is using.
• PORT1 is the port you are using yourself 5566.
That port has to opened in your router.
• PORT2 is the port the person you are going to share with is using. This port has to be opened in his router .
• Password, this has to be the same as in his M-line.
• The share levels: is how far you allow the card to be shared. For example A3 A3. The first A3 says how far the local card in this box can be shared. The second A3 says how far the cards in you’re network(=virtual cards that you might get from others) can be shared. (if possible)This shouldnt be put to high,cards shared over 3 will start to cause freezes and caus a lot of unnecessery trafic.The A hasnt got anything to do with the level it simply allows NDS cards to be shared.

You should never use the same code for different boxes !!!!!!.
You can use the same port for several shares.

In the example the last D line is for sharing in house.

Sharing over the net.

With this the example cwshare.cfg from the client would look like this:

M: { box2.dyndns.org { 22222222 }} #
D: { box1.dyndns.org { 5580 5566 { 11111111 { A5 A5 }}}}

The port 5580 is the port open on box2. The second port 5566 is the port open on box1.
11111111 is the code the server( box1) is using in his M line so it has to be in the D line of the client.

Sharing in house:
With this the example share.cfg from the client would look like this:

M: { 192.168.1.102 { 44444444 }}
#
D: { 192.168.1.101 { 5590 5566 { 11111111 { A0 A0 }}}}

In this example the ip internal of the server/ box1) is 192.168.1.101, here I use the ip, because the information is not going over the net.Share is set to A0 A0 because we are not sharing only getting from box1.

Well now everything should work......

If you get a D line from a friend. Please do not show it to others it is for you’re use only.
If you post a backup img. Remove all the information about you’re share’s.
People will just put those lines in there own files and that creates problems!!!!

Dist and level….
This kind of information you can look in the .tmp file of you’re dreambox or in the Gbox center .Or you can use PHPGbox statistics and UDPlog on a pc.
The tmp/ files
share.onl contains info about who is online and who is not. The one’s with a 1 in front is online and the one’s with a 0 is not.

Share.info. In this file you can see how many cards you receive and for which provider. You can also see the levels of the diffrent cards. Level 0 means, the card cant be reshared . The distance is how many boxes there are between the card and you’re box.
Example: dist 1 means someone you are directly connected with has this card.

ignore.list

Is put in var/key file. This file is used to ignore the unused providers . This is important because you can’t have more than 1024 cards. NOTE : When you first start... leave this alone for a while... You can alway experiment with this later!

I-line

When you reach the limit of 1024 cards gbox will set it self back to less cards. Or in a worst case, don't work at all! Normally I is set to 5 , this means you can’t receive cards that are further away than 5 boxes away. You can adjust this you’re self by setting this in you’re cwshare.cfg: Short : The I = is the distance allowed.

I: { 3 }

This means you will not receive cards that are more than 3 boxes/hops away.


X

Lets you control how many cards you will receive for each provider. Normally it is 05, I think u should leave it this way. Or when you have troubles bring it back to f.e. 3. (Don't go any lower then that!)In early versions this value is in dec in later its in hex

X: { 05 }



Y
Here you can block bad cards.Cards theat doesnt have the full package.You actually put the boxid of the box sharing the bad card.This will however block all cards from that box
When you first start off, leave this also alone for a while. You can always experiment with this later!

Y: { 12 34 }

Now the cards from box 12 34 will not be used anymore. Be sure to put a space between the first two and the last two!!!!
Pleas keep in mind, that these Cards you insert over there, are blocked for all guys "behind" you. Useually, this should be used only for Cards with Level = 0. Generally bad cards should be insterted to the ignore.list (with the same care of course!)


G

In this line you can tell the emu to favor known good cards for providers.

G: { 0100006A 1234 }

0100006A = The provider ID, and 1234 the boxid

NOTICE: that if the box ID allready is in the Y line, The G line will not be used!!
By inserting G-Lines you can increase the total number of cards to be used for one provider... i.e. even if you put number of cards to X : 1, you can access much more cards if there are (some of course) BUT... as far as I know, there is no chance to increase the distance for single cards only..


# 01 repeat EMM's
# 00 consider every EMM only once
# 01 restart pid on overflow
# 1* reset ENX on every channel change
# *1 check/reset ENX freezes on FTA
# *2 check/reset ENX freezes on PayTV
# *3 check/reset ENX freezes on FTA and PayTV
# 00 write nothing in atack.txt
# 01 write into atack.txt: password is wrong
# 02 write into atack.txt: ID unknown
# 04 write into atack.txt: IP is wrong
# 08 write into atack.txt: port is worng
# 10 write into atack.txt: share.stat
# 20 create online.log for online/offline logging
# 3F write everything. (combine bits for other combinations)
# 4000 send ecm again after 4 Seconds if no reply.
# 6000 resync decode after 6 Seconds if net decode failed
N: { 00 01 03 1F 4000 6000 }

Lines Definition in CWshare and Gbox.cfg

W line in Cwshare:
The W line decides how your local card shall be used and shared on the network, and goes in cwshare.cfg like this:

W: { 0A 0B 0C } P001 P002 P003 ...

A= Slot number (1 to 8 )
B= How your card shall be used locally (on your own box)
-0= Dont use card
-1= Use card for all Pid's
-2= Use card only for following Pid's
-3= Don't use card for following Pid's

C= How the card shall be shared on the network
-0= Dont share card
-1= Share all Pid's on card
-2= Share only following Pid's on card
-3= Don't share following Pid's on card

P is the Pid's

Example 1: I want my card in slot 1 to be used for all Pid's locally, and to be shared on the network with all Pid's ( 1FFF means all Pid's):

W: { 01 01 01 } 1FFF

Example 2: I want my card in slot 1 to be used locally for all Pid's on card, and DONT want it to be shared on the network at all:

W: { 01 01 00} 1FFF

Example 3: I want my card in slot 1 to be used locally with the following Pids only, and to be shared on the network too with the following Pid's only:

W: { 01 02 02 } Pid1 Pid2 Pid3 ...

Well, the example 3 is the most interesting, and if we all used it in the right way, it would give a good and stable share environment. Why?

I will try to explain:

Lets say i have a package with 5 channels. I only have a subsription to 3 of these channels, so 2 channels dont open with my card.
Open channels: Pid1, Pid2, Pid3
Scrambled channels: Pid4, Pid5.

There is no need to use my card or share my card with Pid's 4 and 5 since they dont open with my card!

So i would do a W line like this in my cwshare.cfg:

W: { 01 02 02 } Pid1 Pid2 Pid3

The easiest way to see Pid numbers for the channels, is by zapping and then pressing "Quick info" In Gbox Suite and look for the value CaPID for each channel.

Example: CaPID: 0x0021

The Pid number in this case is 0021.

So it would be entered like this:

W: { 01 02 02 } 0021

PS: Max 32 Pid's/Sid's allowed (32 of each) allowed

PS: This explanation goes for the S line aswell. S line goes S: { .. .. .. } and instead of Pid's, Sid's are used!

*Thanks to MasteR for corrections!*

Update (thanks to @emilio29):

Easiest way to see Pid's: In GboxSuite look in "Quickinfo".
Easiest way to see Sid's: Press "Menu", then "Information", then "Streaminfo". Look in the field "Service id" (this value is already in hex).

You get the best result using Sid's (S line), since some of the Pid's are shared!


V line in Gbox_cfg
V: { F0 00 } # no slots
V: { F0 10 } # slot 1
V: { F0 20 } # slot 2
V: { F0 30 } # 2 slots
V: { F0 35 } # 2 slots + port com
V: { F0 31 } # Sc8in1
V: { 00 05 } #Dbox2 multicam
V: { 00 07 } # Dbox2 multicam slot 1+cardreader com

G line in Cwshare:
The G line is used to force the reception of a specific card even if you received all cards that you set up by the X parameter.
So, it is used to force the card that gbox can't get usually itself.
The syntaxe of the G line is :

G: { 01000081 ZZAA }

G: { prov_id box_id }

N line in CWshare
# 01 repeat EMMs
# 00 consider every EMM only once

# 01 restart pid on overflow
# 10 reset ENX on every channel change
# 01 check/reset ENX freezes on FTA
# 02 check/reset ENX freezes on PayTV
# 03 check/reset ENX freezes on FTA and PayTV

# 00 write nothing in atack.txt
# 01 write into atack.txt: password is wrong
# 02 write into atack.txt: ID unknown
# 04 write into atack.txt: IP is wrong
# 08 write into atack.txt: port is wrong
# 10 write into atack.txt: share.stat
# 20 create online.log for online/offline logging
# 3F write everything. (combine bits for other combinations)

# 4000 send ecm again after 4 Seconds if no reply.
# 6000 resync decode after 6 Seconds if net decode failed
N: { 00 01 03 00 2000 5000 }

i hope this will help you
the colors in the d line are the same as above
you can change the values if you want to
like the attack log if you have a dream 500 the log file can flood youre box
so set the atack numbers only on what you would like to see like 04 means that youre peers ip is wrong
then as you can see you can also change the value for sending ecm and resync decode


D nad M line in CWshare:
the dline is the line that makes it possible for the client box to logon to the other box
ofcourse is the first one in the living and the second one in the bedroom

for example
the cw from the LIVINGROOM go's like this

# cwshare.cfg --- dbox1 --- Internet und Lokales Netzt
#
# ip number password
M: { 192.168.2.10 { 2B1C1D7C }}
#
# Internet Friends port range password cod
D: { 192.168.2.20 { 2244 4422 { 98765432 { A3 A3 }}}}
#
#
# allow maximum 06 share level for recieved card data
I: { 03 }
#
# Send ECMs at maximum 5 cards (please use this as default)
X: { 09 }
#
# FOR NLINE=
# 01 repeat EMMs
# 00 consider every EMM only once
# 01 restart pid on overflow
# 1* reset ENX on every channel change
# *1 check/reset ENX freezes on FTA
# *2 check/reset ENX freezes on PayTV
# *3 check/reset ENX freezes on FTA and PayTV
# 00 write nothing in atack.txt
# 01 write into atack.txt: password is wrong
# 02 write into atack.txt: ID unknown
# 04 write into atack.txt: IP is wrong
# 08 write into atack.txt: port is worng
# 10 write into atack.txt: share.stat
# 20 create online.log for online/offline logging
# 3F write everything. (combine bits for other combinations)
# 4000 send ecm again after 4 Seconds if no reply.
# 6000 resync decode after 6 Seconds if net decode failed
N: { 00 01 03 3F 3000 5000 }

ok so this is ths cw share file
what does this dline meens
the ip number : 192.168.2.20 is youre friend thats what is says
so youre friend is alowed to logon to the livingroom box
the ports in the living are 2244--4422
2244 is used by the box in the livingroom
4422 is used by the box in the bedroom
so the bedroom logs on thru port 2244 on the living
and vice versa

the pasword needs no explanation i think

the code:
A meens you let nds go thru without A you dont share nds signals
1,2,3,4,5,6,7,8,9 meens that you share it a specific amount of boxes
so if you put A1 A! then it go's no further then 1 box and so on


so let me put this simple

#livingroom :
M: { 192.168.2.10 { 45456565 }}
#
#
D: { 192.168.2.20 { 2244 4422 { 98765432 { A3 A3 }}}}
#
I: { 03 }
X: { 09 }
N: { 00 01 03 3F 3000 5000 }
--------------------------------------------------------------

#and the bedroom:

M: { 192.168.2.20 { 98765432}}
#
#
D: { 192.168.2.10 { 4422 2244 { 45456565 { A3 A3 }}}}
#
I: { 03 }
X: { 09 }
N: { 00 01 03 3F 3000 5000 }

I line In CWshare:
Just some explanation for people who do not yet get this matter

the I line determines the maximum distance of cards which you obtain
That is the number of boxes that you have to go thru to get at the card to come
example: Jan have card A and is the pear of piet now you are also a pear of piet
therefore to go to Jan and use its card you must go by piet
piet is then the first distance and jan then the second distance

This way i think its clearly enough for everyone

As from dist 3 the quality of the card becomes more badly
since there is not higher shared than level 5 it is entirely
unnecessary to put it higher as level 5

X line in CWshare:

The X line is the line which determine the number of cards you get answers from
the ammount of cards you address to give you a color on your screen
this card provide you then with the correct data

therefore e.g. X {07} that means that there to 7 cards asked for an answer for the correct data

How to install gbox on a LINUX server

1.create 4 directories
/var/bin
/var/keys
/var/script
/var/tmp


2.put some files
in /var/bin :
gbox86, rename it in gbox, chmod 755

in /var/keys:

cwshare.cfg, chmod755
gbox_cfg, chmod755

in /var/script
gbox_cam.sh,
rename in gbox, chmod 755
remove the lines about AES


3. start/stop gbox


start: /var/script/gbox start
stop: /var/script/gbox stop



4. to have gbox working on boot
in linux debian :
in /etc/init.d :
put /var/script/gbox

execute this command line:

update-rc.d gbox default 19


Now gbox is up and runnig

Step by Step Gbox server setup on Dreambox

Before I start to write the How to I decided to describe first the necessarily steps to build a gbox server. So don't except How to with all Details. The questions about gbox server will show which details will be needed.




1. Get the files
2. Put the files in the right folders
3. Make the needed configuration
4. add and exchange dlines
5. control your gbox
6. possible errors and reasons


1. First download all files from the following link
Gbox2.1b

2.Extract the files and you will see also the path where the files should be put
//var/bin => gbox
//var/keys => cwshare.cfg,gbox.cfg,softcam.cfg
//var/script => gbox_cam.sh
//var/tuxbox/plugins => egboxcenter.cfg,egboxcenter.so,gboxsuite.cfg, egboxsuite.so, gbv.cfg,gbv.ident,gbv.so

Use a Ftp program to put the files in the folders. I prefer flashfxp. After you had put the files in the folders. Make CHMOD changes for the following files. You can make the CHMOD changes by using the right mouse button (FLASHFXP) on the file and selecting Attribute (CHMOD).
//var/bin/gbox => CHMOD 755
//var/keys => cwshare.cfg => 644
//var/keys => gbox_cfg => 644
//var/scripts => gbox_cam.sh => 755

3. Coniguration

You must made only individual changes to cwshare.cfg and gbox_cfg

CWSHARE:

This file is responsbile for communication between the peers.
Following lines should be inside this files
M: => Adress of your gbox
I: => Configuration about till which distance cards you allows to get
X: => Configuration abotu how many of the same card you allows to get
D: => Communication line between the peers
N: =>
W: =>


How should the lines be set:

M-LIne

M: { your.dyndns.org { Password }}

=> Password: You can only use 0-9 and A-F for setting password. My suggestion is don't use a very very easy password like 12345678 or AABBCCDD or ABCD1234, so a lot of people makes that and this can be a reason for an error, if you start the gbox. More details at the end.



I-Line

I: { 03 }

This is the selected value most gbox user set for their I-Line. Because with this configuration you only accept cards till Dist3. Cards with Dist4 and Dist5 are not good for sharing and gettings keys. If you have later more peers you can set the value to 02.



X-Line

X: { 10 }

This is a value should experiment a little bit which value is the best for your gbox server. As you know with this value you set a limit to the number of same cards. 0A, 10, 08 this are the most used values.



N-Line

N: { 00 01 03 3F 4000 6000 }

I will write more details to this line. Use the N-Line given above ( its my N-Line)



W-Line

W: { 01 01 01 } 1FFF

I will write more details to this line. Use the N-Line given above ( its my N-Line)


D-Line

This is the most importan Line

D: { other.dyndns.org { Port1 Port2 { Password { A5 A5 }}}}

other.dyndns.org => the dyndns of your share peer
port1 => your port number using for gbox
port2 => port number of you peer
Password => password of your peer
A5 A5 => Share Level for Local and Virtual Cards

You will get this dline every time for your peer. So the only thing you had to do is, to put your port number instead of port1 and add it in your cwshare.cfg. The Dline you give to your peer is the the same but with your dyndns, password and your port number is port2.

D: { own.dyndns.org { Port1 ownport { own password { A5 A5 }


GBOX_CFG

In your gbox_cfg file you have following lines

Z: { 01 12 } dream ip 8024

G: { 03 }

C: { 01 }

M: { 01 }

A: { 00 }

U: { 01 }

H: { 01 }

T: { 00 }

O: { 03 } dream ip

L: { 00 } dream ip 8029

W: { 00 00 } 9600

V: { F0 35 } => configurations for reading slot and com-ports


V: { F0 00 } nothing
V: { F0 10 } slot 1
V: { F0 20 } slot 2
V: { F0 30 } both slots
V: { F0 35 } both slots + com ports
V: { F0 05 } only com ports
V: { F0 31 } Sc8in1
V: { 00 05 } Dbox2 multicam


I will made later a detailed description for this file. The informations above are taken from my gbox_cfg



4. Add and exchange Dlines


After ending configuration you can now exchange dlines

M: { own.dyndns.org { password }}
# Internet Friends port range password cod
I: { 2 }

X: { 0A }

N: { 00 01 03 3F 4000 6000 }

W: { 01 01 01 } 1FFF

D: { other.dyndns.org { yourport otherport { otherpassword { A5 A5 }}}}

Be carefull if you add dlines it must the same like above. No more spaces or less spaces



5. Control Gbox and peers

Gbox Center and Gbox Suite are plugins to have Informations about your peers, Cards, Distance and Level Share and how many cards do you have for each provider

You can access to this plugins

Blue Panel => Plugins => Gbox Center or Gbox Suite



6. Error and Reasons


If your gbox is not working ( you will see it if you go to: Blue Panel => Plugins => Gbox Center => Gbox Share Center => Peer Status => Message that share is not found, check if gbox is running )
Then check following
1. Internet Connection
2. Correct format of dlines ( Spaces, password (0-9,A-F) )
3. Passwords of the dline ( so if two peers use the same password they will get the same Box ID and two same Box ID in one Gbox Server is not working)

4. Some Cards needs special configuration to share them ( Sky Uk, Nova etc)

Some important explanations and tips

when a card dont decode all channels and you dont say this gbox with a W: or S: Line in cwshare.cfg you freeze the complete cs with your card/s !!!

Level 0 Cards -->

I think its the wrong way to Add Level 0 Cards to cwshare because this is
only move the Problems to another place ! The right way is when you look from wich peer is this Level0 Card and you contact them and say they do A2 A2 at your D line ! When the Level0 Card also exist after WARN the peer again and say to him when not better you delete his line ! This is the best way to execute this Problems !!!
Exceptions.:

- Sometimes it can be OK when a Specially rare Card comes from your Peer and when they say not more than A1 because more/reshare is Bad for the Card

-If a user at distance 2 from me, has {A2 A2} then the user at distance 1 will receive his cards with level 1. When he passes them to me they will be level 0. This is not a bad thing. They may be perfectly good. It just means I cannot re-share them
------------------------------------------------------

A2 A2 - NOT MORE !!! -->

This is the best entry at all Peers and for all users enought ! More is BAD and makes instability, freezes and BAD Network Performance !!!
Important is NEVER A5 A5 !!!
-----------------------------------------------------

Local Cards -->

Every Peer likes have a Local Card most of time all other is VERY BAD ! Check this everytime !!! You will do nothing only use the Peers Checker from the Gbox Share Control ( THX to Black64 !!! )
And also its a Tip - Share only Full Cards because you cant sure if the owner from a Not Full Card makes W or S - Line ( This says gbox what channels the Card encrypt and what not ) everytime !
EXCEPTION.: Some Cards with many Channels like NDS or TPS its the best way when the Peer share not all channels because otherwise its too much for the card in cs and than it freez This can be also set by S or W line in cwshare.cfg
Also good option is to Overclock the Card for support more users.
No Share with Virtuall Cards like Anaconda or K3 or ... !!!
EXCEPTION.: When you are sure the Peer is have the right files for his Virtuall Card than its OK to share
----------------------------------------------------

Ignore list -->

Note that when you block Providers that you dont have but they are active the Peers from you dont receive it from you also !
-------------------------------------------------------

Ident.list -->

One from the Important things that you need for Good working because here you can see what are good Providers/Cards and what Bad
Here in the Forum you can use my Ident.list when you like and help the community too that we always Up2date with the list entrys/changes
-----------------------------------------------------------

I: in cwshare.cfg -->

The best here is I:02 !!! When you use gbox 2.1b and receive Distance3 Cards but you have I:02 than you can use the patched I:02 Version from the UPC here !!!
But normally its recommend to work with the newest Version ( V. 2.25 )
-----------------------------------------------------------

X: in cwshare.cfg -->

Between X:05 and max X:0A !!! When you beginn with X:0A and have more than 900 Cards set it to X:09 ! When you have after this also more than 900 Cards set it to X:08 ! Et cetera
Attention the entrys work with Hexadezimal so X:10 is not meaning max 10 Cards from one Provider, in Numbers X:10 is --> 16 Cards !!!
-------------------------------------------------------------

Some small Tips from me ...

NEVER Handle WITH PROGRAMMS @ BOX direct USE only PC Programms !!!
gsuite,center ... all will crash sometimes and give from time to time false Infos !!!
-------------------------------------------------------------

Its a good think when you make a excel list with all your Peers and write behind them what Cards they local have and his email Adress
When you have bad peers that you have deleted make it in a seperate list and give them a extra Info with your Commentar why you have delete him. So you can be better sure that you dont share again with bad peoples.
Its recommendable when you security this files with for example Steganos Save or some other Crypt Programms that no one other can read this Details !


.................................................. .................................................. ...
These are BASICS !!! When anybody is meaning there was some not correct or have also good Tips let me known here and i can update this Info --> This is only for Beginners of gbox that he can see what is Important and how works the think ! I am also NOT a Professional i make this for Hobby and will only do the best for the Community !!! I will NEVER say I am the Boss ore some else !!! Thanks for understand