Open Card Reader Module for Cryptoworks, Nagra, ...

Status
Not open for further replies.

juli13

Staff member
Administrator
Messages
10,194
25/03/2011

Open Card Reader Module for Cryptoworks 1.1

The module will support Cryptoworks cards. It isn't complete because the RSA part for box key handling is missing.
The local Cryptoworks card init is based on open source oscam.]

How is it working:

Each card module have its unique INI file.
Example: sc_cw.mdl -> sc_cw.ini
In this INI file there have to be a section named like the file name:
Example: sc_cw.ini -> [sc_cw]
If this match you can set COM port, baudrate,....

Example for 2 local Cryptoworks cards
First local card is connected to COM1
Second local card is connected to COM3

Just make a copy of the module and rename like you want:
First: sc_cw_1.mdl -> sc_cw_1.ini -> [sc_cw_1] -> Port=COM1
Second: sc_cw_2.mdl -> sc_cw_2.ini -> [sc_cw_2] -> Port=COM3


It is also possible to use this module with original vPlug by vahid (tested with 2.6.4).
BUT vPlug only checks the first module if the CAID match. So you have to remove/rename the "cryptoworks.mdl"

vPlug_Server 1.0.2.11 will check now all modules if CAID match. So if the channel can not be decrypted by EMU it will check if any other module for this CAID exists.
You can set priority which module will checked first by the filename of the module.

Source
The source is written with Delphi 2010. Just feel free to modify or write your own local card module for other systems like Irdeto, Viaccess, ...
Just DO CHANGE the Author!!
 

tani1

Staff member
Super Moderator
Messages
17,767
09-04-2011

New Update v1.2

Cryptoworks 1.2, added RSA IPK handling, not tested,
Started Irdeto module, ECM & EMM handling isn't finsihed - can't test it.
Nagra module, tested with German HD+ 1843 card. ECM and EMM ok!

Info: Server [16:14:26.198] Loading sc_nagra.mdl ...
Info: Module [16:14:26.226] sc_nagra: Start Nagravision card reader
Info: Module [16:14:26.226] sc_nagra: Try to open port COM2
Info: Module [16:14:26.244] sc_nagra: Resetting card...
Info: Module [16:14:27.608] sc_nagra: Using 368 mhz for cardclock
Info: Module [16:14:27.608] sc_nagra: Using actual 9600 baud, change it to 115200
Info: Module [16:14:27.616] sc_nagra: ATR: 3FFF9500FF918171A04700444E415350313830204D657230303028
Info: Module [16:14:27.616] sc_nagra: [Nagravision] Detected native Nagravision card
Info: Module [16:14:27.989] sc_nagra: [Nagravision] Type: NAGRA, CAID: 1843, IRD ID: FFFFFFFF
Info: Module [16:14:27.989] sc_nagra: [Nagravision] ProviderID 00003411
Info: Module [16:14:28.501] sc_nagra: [Nagravision] ID 8011, Tier: 0066, Date: 2011.04.07 - 2012.04.07
Info: Module [16:14:28.546] sc_nagra: [Nagravision] ID 8011, Tier: 0067, Date: 2010.01.19 - 2010.01.20
Info: Module [16:14:29.105] sc_nagra: [Nagravision] ROM: D N A S P 1 8 0
Info: Module [16:14:29.105] sc_nagra: [Nagravision] REV: M e r 0 0 0
Info: Module [16:14:29.105] sc_nagra: [Nagravision] SER: Hex: 48XXXXXX, ASCII: 122xxxxxxx
Info: Module [16:14:29.105] sc_nagra: [Nagravision] CAID: 1843
Info: Module [16:14:29.105] sc_nagra: [Nagravision] Prv.ID: 00003411 (sysid)
Info: Module [16:14:29.105] sc_nagra: [Nagravision] Prv.ID: 00000000
Info: Module [16:14:29.105] sc_nagra: [Nagravision] Prv.ID: 00008011
Info: Server [16:14:29.114] Added Card info of sc_nagra to card list
Info: Server [16:14:29.114] Loaded module: sc_nagra.mdl, Version: 1.0, Author: Project:Keynation

Thx schwa226
 

TheHighLander

Super VIP
Messages
4,144
Latest source to the smartcard reader modules (v1.5)

*Added new exported function "Close_Card".
*Use this new exported function to close the COM port to the card reader.


Exports Author;
Return module author. String null terminated.
------------------------------------------------

Exports Version;
Return module version. String null terminated.
------------------------------------------------

Exports CheckCurrentCAID;
Return true if requested CAID is supported by the module.

Parameter:
CAID : dword
------------------------------------------------

Exports SetShowDebug;
Set debug output on/off.

Parameter:
Showlog : Integer
------------------------------------------------

Exports ECMFunction;
Do ECM function of the module. Return true if ECM got successful decrypted.

Paramter:
Data: pointer to the ECM data
dw: pointer to the decrypted DCW
------------------------------------------------

Exports EMMFunction;
Do EMM function of the module. Return true if EMM got successful transfered.

Paramter:
Data: pointer to the EMM data
------------------------------------------------

Exports SetMessagesCallBackFn;
Use this function to init the card reader module.
------------------------------------------------

Exports SetRequestKeyCallBackFn;
Not used for card reader module.

Parameter:
fn : pointer to the callback function
------------------------------------------------

Exports SetPrepareEMMKeyCallBackFn;
Not used for card reader module.

Parameter:
fn : pointer to the callback function
------------------------------------------------

Exports SetSendCardDataCallBackFn;
Use this function to send the card data to the host.

Parameter:
fn : pointer to the callback function
------------------------------------------------

Exports Reset_Card;
Use this function to reset the card and refresh the entitlements.
------------------------------------------------

Exports Close_Card;
Use this function to close the comuncation to the card and COM port.
------------------------------------------------
Just try to get the pointers of the extra card reader functions like:

// check if module have a exported card data function
OurModules.SetCardDataCallBackFn :=
GetProcAddress(DLLHandle, 'SetSendCardDataCallBackFn');

OurModules.Reset_Card :=
GetProcAddress(DLLHandle, 'Reset_Card');

OurModules.Close_Card :=
GetProcAddress(DLLHandle, 'Close_Card');
procedure InitLocalCards();
var
i : Integer;
begin
for i := 0 to High(OurModules) do
begin
if Assigned(OurModules.SetCardDataCallBackFn) then
begin
// set card data callback function
Logger.Info(SERVER, 'Trying now to start local card reader ' + OurModules.mdlName);

try
OurModules.SetCardDataCallBackFn(@CardDataCallBack);
except
Logger.Error(SERVER, 'Error by setting card callback by module ' + OurModules.mdlName + ', skip module');
Continue;
end;
// set log msg function for card init
try
OurModules.SetMessagesCallBackFn(@GUIShowLog);
except
Logger.Error(SERVER, 'Error by setting message callback by module ' + OurModules.mdlName + ', skip module');
Continue;
end;
end;
end;
end;
 
Status
Not open for further replies.
Top