Changeset 1798 for trunk/reader-cryptoworks.c
- Timestamp:
- 03/06/10 16:07:31 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/reader-cryptoworks.c
r1797 r1798 466 466 ep->type = UNKNOWN; 467 467 break; 468 468 469 case 0x84: 469 470 if(ep->emm[3]==0xA9 && ep->emm[4]==0xFF && ep->emm[12]==0x80 && ep->emm[13]==0x04) … … 472 473 ep->type = UNKNOWN; 473 474 break; 475 476 case 0x88: 474 477 case 0x89: 475 478 if(ep->emm[3]==0xA9 && ep->emm[4]==0xFF && ep->emm[8]==0x83 && ep->emm[9]==0x01) … … 478 481 ep->type = UNKNOWN; 479 482 break; 480 case 0x8F://incoming via camd3.5x 481 //ep->type=emm[4];483 484 case 0x8F://FIXME incoming emm via camd3.5x, SA/GA/UA ? 482 485 default: 483 486 ep->type = UNKNOWN; … … 506 509 507 510 //cs_log("[cryptoworks-reader] EMM Dump:..: %s",cs_hexdump(1, emm, emm[2])); 508 switch(ep->emm[0]) 509 { 510 // emm via camd3.5x 511 case 0x8F: 512 if(emm[3]==0xA4) 511 switch(ep->type) 512 { 513 case UNKNOWN: 514 // FIXME emm via camd3.5x was returned from check_emm_type as UNKNOWN 515 // so we should check here for this emmtype until we know the real mode 516 if(emm[3]==0xA4 && emm[0]==0x8F) 513 517 { 514 518 //cs_log("[cryptoworks-reader] EMM Dump: CMD: %s", cs_hexdump(1, emm+3, 5)); … … 520 524 521 525 //GA 522 case 0x88: 523 case 0x89: 524 if(emm[3]==0xA9 && emm[4]==0xFF && emm[8]==0x83 && emm[9]==0x01) 525 { 526 insEMM_GA[4]=ep->emm[2]-2; 527 //cs_log("[cryptoworks-reader] EMM Dump: CMD: %s", cs_hexdump(1, insEMM_GA, 5)); 528 //cs_log("[cryptoworks-reader] EMM Dump: DATA: %s",cs_hexdump(1, emm+5, insEMM_GA[4])); 529 //cs_log("[cryptoworks-reader] EMM Dump: IF: %02X == %02X",emm[7],(insEMM_GA[4]-3)); 530 531 if(emm[7]==insEMM_GA[4]-3) 532 { 533 write_cmd(insEMM_GA, emm+5); 534 rc=((cta_res[0]==0x90)&&(cta_res[1]==0x00)); 535 } 536 } 526 case GLOBAL: 527 insEMM_GA[4]=ep->emm[2]-2; 528 //cs_log("[cryptoworks-reader] EMM Dump: CMD: %s", cs_hexdump(1, insEMM_GA, 5)); 529 //cs_log("[cryptoworks-reader] EMM Dump: DATA: %s",cs_hexdump(1, emm+5, insEMM_GA[4])); 530 //cs_log("[cryptoworks-reader] EMM Dump: IF: %02X == %02X",emm[7],(insEMM_GA[4]-3)); 531 if(emm[7]==insEMM_GA[4]-3) 532 { 533 write_cmd(insEMM_GA, emm+5); 534 rc=((cta_res[0]==0x90)&&(cta_res[1]==0x00)); 535 } 537 536 break; 538 537 539 538 //SA 540 case 0x84: 541 if(emm[3]==0xA9 && emm[4]==0xFF && emm[12]==0x80 && emm[13]==0x04) 542 { 543 insEMM_SA[4]=ep->emm[2]-6; 544 //cs_log("[cryptoworks-reader] EMM Dump: CMD: %s", cs_hexdump(1, insEMM_SA, 5)); 545 //cs_log("[cryptoworks-reader] EMM Dump: DATA: %s",cs_hexdump(1, emm+9, insEMM_SA[4])); 546 //cs_log("[cryptoworks-reader] EMM Dump: IF: %02X == %02X",emm[11],(insEMM_SA[4]-3)); 547 548 if(emm[11]==insEMM_SA[4]-3) 549 { 550 write_cmd(insEMM_SA, emm+9); 551 rc=((cta_res[0]==0x90)&&(cta_res[1]==0x00)); 552 } 553 } 539 case SHARED: 540 insEMM_SA[4]=ep->emm[2]-6; 541 //cs_log("[cryptoworks-reader] EMM Dump: CMD: %s", cs_hexdump(1, insEMM_SA, 5)); 542 //cs_log("[cryptoworks-reader] EMM Dump: DATA: %s",cs_hexdump(1, emm+9, insEMM_SA[4])); 543 //cs_log("[cryptoworks-reader] EMM Dump: IF: %02X == %02X",emm[11],(insEMM_SA[4]-3)); 544 if(emm[11]==insEMM_SA[4]-3) 545 { 546 write_cmd(insEMM_SA, emm+9); 547 rc=((cta_res[0]==0x90)&&(cta_res[1]==0x00)); 548 } 554 549 break; 555 550 556 551 //UA 557 case 0x82: 558 if(emm[3]==0xA9 && emm[4]==0xFF && emm[13]==0x80 && emm[14]==0x05) 552 case UNIQUE: 553 insEMM_UA[4]=ep->emm[2]-7; 554 //cs_log("[cryptoworks-reader] EMM Dump: CMD: %s", cs_hexdump(1, insEMM_UA, 5)); 555 //cs_log("[cryptoworks-reader] EMM Dump: DATA: %s",cs_hexdump(1, emm+10, insEMM_UA[4])); 556 //cs_log("[cryptoworks-reader] EMM Dump: IF: %02X == %02X",emm[12],(insEMM_UA[4]-3)); 557 if(emm[12]==insEMM_UA[4]-3) 559 558 { 560 insEMM_UA[4]=ep->emm[2]-7; 561 //cs_log("[cryptoworks-reader] EMM Dump: CMD: %s", cs_hexdump(1, insEMM_UA, 5)); 562 //cs_log("[cryptoworks-reader] EMM Dump: DATA: %s",cs_hexdump(1, emm+10, insEMM_UA[4])); 563 //cs_log("[cryptoworks-reader] EMM Dump: IF: %02X == %02X",emm[12],(insEMM_UA[4]-3)); 564 565 if(emm[12]==insEMM_UA[4]-3) 566 { 567 //cryptoworks_send_pin(); //?? may be 568 write_cmd(insEMM_UA, emm+10); 569 rc=((cta_res[0]==0x90)&&(cta_res[1]==0x00)); 570 } 571 } 559 //cryptoworks_send_pin(); //?? may be 560 write_cmd(insEMM_UA, emm+10); 561 rc=((cta_res[0]==0x90)&&(cta_res[1]==0x00)); 562 } 572 563 break; 573 564 }
Note:
See TracChangeset
for help on using the changeset viewer.