Changeset 1354 for trunk/reader-seca.c
- Timestamp:
- 01/22/10 21:59:21 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/reader-seca.c
r1125 r1354 3 3 #include <stdlib.h> 4 4 5 //02102009 Dingo35 (=original author of this module):6 //-added detection of EMM-GA; this kind of EMM has not been documented yet, no update takes place (yet)7 //-solved bug in validity date8 //-eliminated unnecessary buffers9 //-added printing of PBM info10 11 5 extern uchar cta_cmd[], cta_res[]; 12 6 extern ushort cta_lr; 13 static unsigned short pmap=0; // provider-maptable14 unsigned long long serial ;15 char *card;16 7 17 8 #define write_cmd(cmd, data) \ … … 25 16 } 26 17 27 int set_provider_info(int i)18 static int set_provider_info(int i) 28 19 { 29 20 static uchar ins12[] = { 0xc1, 0x12, 0x00, 0x00, 0x19 }; // get provider info … … 70 61 int seca_card_init(uchar *atr) 71 62 { 63 char *card; 64 static unsigned short pmap=0; // provider-maptable 65 unsigned long long serial ; 72 66 uchar buf[256]; 73 67 static uchar ins0e[] = { 0xc1, 0x0e, 0x00, 0x00, 0x08 }; // get serial number (UA) … … 141 135 int seca_do_ecm(ECM_REQUEST *er) 142 136 { 143 staticunsigned char ins3c[] = { 0xc1,0x3c,0x00,0x00,0x00 }; // coding cw144 staticunsigned char ins3a[] = { 0xc1,0x3a,0x00,0x00,0x10 }; // decoding cw137 unsigned char ins3c[] = { 0xc1,0x3c,0x00,0x00,0x00 }; // coding cw 138 unsigned char ins3a[] = { 0xc1,0x3a,0x00,0x00,0x10 }; // decoding cw 145 139 int i; 146 147 140 i=get_prov_index((char *) er->ecm+3); 148 141 if ((i == -1) || (reader[ridx].availkeys[i][0] == 0)) //if provider not found or expired … … 151 144 ins3c[3]=er->ecm[7]; //key nr 152 145 ins3c[4]=(((er->ecm[1]&0x0f) << 8) | er->ecm[2])-0x05; 153 154 //memcpy(ins3cdata,er->ecm+8,256-8);155 146 write_cmd(ins3c, er->ecm+8); //ecm request 156 157 static unsigned char ins30[] = { 0xC1, 0x30, 0x00, 0x02, 0x09 }; 158 static unsigned char ins30data[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF }; 147 unsigned char ins30[] = { 0xC1, 0x30, 0x00, 0x02, 0x09 }; 148 unsigned char ins30data[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF }; 159 149 /* We need to use a token */ 160 150 if (cta_res[0] == 0x90 && cta_res[1] == 0x1a) { … … 162 152 write_cmd(ins3c, er->ecm+8); //ecm request 163 153 } 164 165 154 if ((cta_res[0] != 0x90) || (cta_res[1] != 0x00)) return (0); 166 155 read_cmd(ins3a, NULL); //get cw's … … 172 161 173 162 int seca_do_emm(EMM_PACKET *ep) 174 { //return 1; 175 static unsigned char ins40[] = { 0xc1,0x40,0x00,0x00,0x00 }; 176 //uchar ins40data[256]; 163 { 164 unsigned char ins40[] = { 0xc1,0x40,0x00,0x00,0x00 }; 177 165 int i,ins40data_offset; 178 166 int emm_length = ((ep->emm[1] & 0x0f) << 8) + ep->emm[2]; … … 198 186 ins40[4]= emm_length - 0x07; 199 187 ins40data_offset = 10; 200 //memcpy(ins40data,ep->emm+10,256-10);201 188 } 202 189 break; … … 219 206 ins40[4]= emm_length - 0x0A; 220 207 ins40data_offset = 13; 221 //memcpy(ins40data,ep->emm+13,256-13);222 208 } 223 209 break; … … 260 246 //This module is therefore optical only 261 247 262 static unsigned char ins34[] = { 263 0xc1, 0x34, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00 264 }; //data following is provider Package Bitmap Records 265 static unsigned char ins32[] = { 266 0xc1, 0x32, 0x00, 0x00, 0x20 267 }; // get PBM 248 static unsigned char ins34[] = { 0xc1, 0x34, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00 }; //data following is provider Package Bitmap Records 249 static unsigned char ins32[] = { 0xc1, 0x32, 0x00, 0x00, 0x20 }; // get PBM 268 250 int prov; 269 251
Note:
See TracChangeset
for help on using the changeset viewer.