Changeset 2745
- Timestamp:
- 07/15/10 01:41:32 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/module-dvbapi.c
r2743 r2745 613 613 if (len>500) return; 614 614 switch(buffer[0]) { 615 case 0x88: 616 // emm-u 617 // we should check emm[5 to 7] with the card serial to make sur it's for us. 618 // there is nothing to do with it .. you can send it directly to the do_emm fucntion. 619 break; 620 621 case 0x8a: 622 case 0x8b: 623 // emm-g 624 return; 625 break; 626 615 627 case 0x8c: 616 628 case 0x8d: 617 if (!memcmp(emm_global, buffer, len)) return; 629 // emm-s part 1 630 if (!memcmp(emm_global, buffer, len)) 631 return; 632 // we should check that the ident is matghing the one we have on the card. 633 /* 634 if( buffer[3] == 0x90 && buffer[4] == 3 && 635 buffer[5] == ((ident >> 16) & 0xff) && 636 buffer[6] == ((ident >> 8) & 0xff) && 637 (buffer[7] & 0xf0) == (ident & 0xff) ) 638 // then we're ok 639 */ 640 // copy first part of the emm-g 618 641 memcpy(emm_global, buffer, len); 619 642 emm_global_len=len; 620 643 //cs_ddump(buffer, len, "viaccess global emm:"); 621 644 return; 645 622 646 case 0x8e: 647 // emm-s part 2 623 648 if (!emm_global_len) return; 649 /* @_network : here is some code for emm-re-assembling I have from another project .. which work ... 650 // in my code the serial is stored in a 8 byte array as well as the SA. 651 652 // assemble EMM packet from 8c/8d and 8e 653 // we should check that the SA match ours (emm[3 to 5] should match 3 high byte of SA) 654 655 if( buffer[3] == serial[4] && 656 buffer[4] == serial[5] && 657 buffer[5] == serial[6] ) 658 /// then we'er ok and getting the 2nd part of the same emm-s 659 // emmLen = (((emm_global[4 + 1] & 0xf) << 8) | emm_global[4 + 2]) + 3 + 4; // 4 - offset to store SA 660 661 // write table header 662 emmbuf[0] = 0x8e; 663 emmbuf[1] = 0x70; 664 emmbuf[2] = 0; 665 // write SA 666 emmbuf[3] = serial[4]; 667 emmbuf[4] = serial[5]; 668 emmbuf[5] = serial[6]; 669 emmbuf[6] = 1; 670 // write ADF 671 memcpy(emmbuf+7, "\x9E\x20", 2); 672 emmLen += 2; 673 memcpy(emmbuf+9, buffer+7, 32); 674 emmLen += 32; 675 // write signature 676 memcpy(emmbuf+emmLen, "\xF0\x08", 2); 677 emmLen += 2; 678 memcpy(emmbuf+pos+2, buffer+41, 8); 679 emmLen += 8; 680 // update len 681 emmbuf[1] |= ((emmLen - 3) >> 8) & 0xf; 682 emmbuf[2] = (emmLen - 3) & 0xff; 683 684 /// done.. just send this buffer to do_em fucntion. 685 */ 624 686 625 687 memcpy(emmbuf, buffer, 7);
Note:
See TracChangeset
for help on using the changeset viewer.