// -- cSatTimeHook -------------------------------------------------------------
+#ifndef TESTER
+
class cSatTimeHook : public cLogHook {
private:
cTransponderTime *ttime;
}
}
+#endif //TESTER
+
// -- cSatTime -----------------------------------------------------------------
class cSatTime {
void Dump(void);
public:
cOpenTVModule(const unsigned char *data);
+ cOpenTVModule(int Id, const unsigned char *data, int len);
~cOpenTVModule();
int AddPart(const unsigned char *data, int len);
const info_header_t *InfoHdr(void) const { return &info; }
mem=MALLOC(unsigned char,modlen);
}
+cOpenTVModule::cOpenTVModule(int Id, const unsigned char *data, int len)
+{
+ id=Id; modlen=received=len;
+ mem=MALLOC(unsigned char,modlen);
+ memcpy(mem,data,len);
+ ParseSections();
+}
+
cOpenTVModule::~cOpenTVModule()
{
free(mem);
// -- cTpsAuHook ---------------------------------------------------------------
+#ifndef TESTER
+
#define BUFF_SIZE 20000
class cTpsAuHook : public cLogHook {
virtual void Process(int pid, unsigned char *data);
};
+#endif //TESTER
+
// -- cTpsKeys -----------------------------------------------------------------
cTpsKeys tpskeys;
// -- cTpsAuHook ---------------------------------------------------------------
+#ifndef TESTER
+
#define AUSID 0x12C0
cTpsAuHook::cTpsAuHook(void)
}
}
+#endif //TESTER
+
// -- cTPSDecrypt --------------------------------------------------------------
unsigned char *cTPSDecrypt::mem=0;
$(CXX) $(CXXFLAGS) $^ $(LIBS) -L../systems/nagra -lsc-nagra -o $@
@echo "don't forget: export LD_LIBRARY_PATH=../systems/nagra"
+testTPS.o: testTPS.c ../systems/viaccess/tps.c ../systems/viaccess/st20.c ../systems/viaccess/viaccess.c
+testTPS: testTPS.o $(SHAREDOBJS) $(NOBJS)
+ $(CXX) $(CXXFLAGS) $^ $(LIBS) -o $@
+
filterhelper: filterhelper.o
$(CXX) $(CXXFLAGS) $^ -o $@
clean:
--- /dev/null
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#define TESTER
+#include "crypto.h"
+#include "data.h"
+#include "system-common.h"
+#include "compat.h"
+
+#include "systems/viaccess/viaccess.h"
+#include "systems/viaccess/viaccess.c"
+
+// ----------------------------------------------------------------
+
+class cTransponderTime;
+
+class cSatTimeHook : public cLogHook {
+private:
+public:
+ cSatTimeHook(cTransponderTime *Ttime);
+ ~cSatTimeHook();
+ virtual void Process(int pid, unsigned char *data);
+ };
+
+cSatTimeHook::cSatTimeHook(cTransponderTime *Ttime)
+:cLogHook(HOOK_SATTIME,"sattime")
+{}
+
+cSatTimeHook::~cSatTimeHook()
+{}
+
+void cSatTimeHook::Process(int pid, unsigned char *data)
+{}
+
+// ----------------------------------------------------------------
+
+class cTpsAuHook : public cLogHook {
+public:
+ cTpsAuHook(void);
+ virtual ~cTpsAuHook();
+ virtual void Process(int pid, unsigned char *data);
+ void DummyProcess(unsigned char *data, int size);
+ };
+
+#include "systems/viaccess/tps.c"
+#include "systems/viaccess/st20.c"
+
+cTpsAuHook::cTpsAuHook(void)
+:cLogHook(HOOK_TPSAU,"tpsau")
+{}
+
+cTpsAuHook::~cTpsAuHook()
+{}
+
+void cTpsAuHook::Process(int pid, unsigned char *data)
+{
+}
+
+void cTpsAuHook::DummyProcess(unsigned char *data, int size)
+{
+ cOpenTVModule mod(2,data,size);
+ tpskeys.ProcessAu(&mod);
+}
+
+// ----------------------------------------------------------------
+
+int main(int argc, char *argv[])
+{
+ if(argc<3) {
+ printf("usage: %s <plugin-dir> <decomp-bin>\n",argv[0]);
+ return 1;
+ }
+
+ InitAll(argv[1]);
+ LogAll();
+ FILE *f=fopen(argv[2],"r");
+ if(f) {
+ fseek(f,0,SEEK_END);
+ int size=ftell(f);
+ fseek(f,0,SEEK_SET);
+ unsigned char *data=(unsigned char *)malloc(size);
+ fread(data,1,size,f);
+ fclose(f);
+ printf("read %d bytes from %s\n",size,argv[2]);
+
+ cTpsAuHook hook;
+ hook.DummyProcess(data,size);
+ }
+ return 0;
+}