SASC-NG
DVBSoftCAM

testEMM.c

Go to the documentation of this file.
00001 
00002 #include <stdlib.h>
00003 #include <stdio.h>
00004 
00005 #include "data.h"
00006 #include "system.h"
00007 #include "compat.h"
00008 
00009 #include <libsi/section.h>
00010 SI::TOT __dummy;
00011 
00012 int main(int argc, char *argv[])
00013 {
00014   if(argc<4) {
00015     printf("usage: %s <lib-dir> <plugin-dir> <caid> <rawemm-file>\n",argv[0]);
00016     return 1;
00017     }
00018   DllsLoad(argv[1]);
00019   InitAll(argv[2]);
00020   LogAll();
00021   unsigned char emm[4096];
00022   int len=ReadRaw(argv[4],emm,sizeof(emm));
00023     
00024   int caid=strtol(argv[3],0,0);
00025   printf("using caid %04x\n",caid);
00026   cSystem *sys=0;
00027   int lastPri=0;
00028   while((sys=cSystems::FindBySysId(caid,false,lastPri))) {
00029     sys->DoLog(true); sys->CardNum(0);
00030     lastPri=sys->Pri();
00031     if(sys->HasLogger()) {
00032       for(int i=0; i<len;) {
00033         int s=SCT_LEN(&emm[i]);
00034         sys->ProcessEMM(0x123,caid,&emm[i]);
00035         i+=s;
00036         }
00037       }
00038     delete sys;
00039     }
00040 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines