Changeset 1744


Ignore:
Timestamp:
Feb 28, 2010, 11:47:51 AM (10 years ago)
Author:
merek
Message:
  • Add marker to reader if ECM_REQUEST was betatunneled (er->btun)
  • Cleanup cs_betatunnel()
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/globals.h

    r1740 r1744  
    742742  struct timeb  tps;    // incoming time stamp
    743743  uchar         locals_done;
     744  int       btun; // mark er as betatunneled
    744745
    745746#ifdef CS_WITH_GBOX
  • trunk/oscam.c

    r1738 r1744  
    16181618#endif
    16191619      snprintf(sby, sizeof(sby)-1, " by %s", reader[er->reader[0]].label);
     1620   
     1621    // add marker to reader it er was betatunneled
     1622    if(er->btun)
     1623      snprintf(sby, sizeof(sby)-1, " by %s(btun)", reader[er->reader[0]].label);
    16201624  }
    16211625  if (er->rc<4) er->rcEx=0;
     
    18121816void cs_betatunnel(ECM_REQUEST *er)
    18131817{
    1814   int n;
    1815   ulong mask_all=0xFFFF;
    1816   TUNTAB *ttab;
    1817   ttab=&client[cs_idx].ttab;
    1818   for (n=0; (n<CS_MAXTUNTAB); n++)
    1819   if ((er->caid==ttab->bt_caidfrom[n]) && ((er->srvid==ttab->bt_srvid[n]) || (ttab->bt_srvid[n])==mask_all))
    1820   {
    1821     uchar hack_n3[13]={0x70, 0x51, 0xc7, 0x00, 0x00, 0x00, 0x01, 0x10, 0x10, 0x00, 0x87, 0x12, 0x07};
    1822     uchar hack_n2[13]={0x70, 0x51, 0xc9, 0x00, 0x00, 0x00, 0x01, 0x10, 0x10, 0x00, 0x48, 0x12, 0x07};
    1823     er->caid=ttab->bt_caidto[n];
    1824     er->prid=0;
    1825     er->l=(er->ecm[2]+3);
    1826     memmove(er->ecm+14, er->ecm+4, er->l-1);
    1827     if (er->l > 0x88)
    1828     {
    1829        memcpy(er->ecm+1, hack_n3, 13);
    1830        if (er->ecm[0]==0x81) er->ecm[12]+= 1;
    1831     }
    1832     else memcpy(er->ecm+1, hack_n2, 13);
    1833     er->l+=10;
    1834     er->ecm[2]=er->l-3;
    1835     client[cs_idx].cwtun++;
    1836     cs_debug("ECM converted from: 0x%X to BetaCrypt: 0x%X for service id:0x%X",
    1837              ttab->bt_caidfrom[n], ttab->bt_caidto[n], ttab->bt_srvid[n]);
    1838   }
     1818    int n;
     1819    ulong mask_all = 0xFFFF;
     1820    TUNTAB *ttab;
     1821    ttab = &client[cs_idx].ttab;
     1822    for (n = 0; (n < CS_MAXTUNTAB); n++) {
     1823        if ((er->caid==ttab->bt_caidfrom[n]) && ((er->srvid==ttab->bt_srvid[n]) || (ttab->bt_srvid[n])==mask_all)) {
     1824            uchar hack_n3[13] = {0x70, 0x51, 0xc7, 0x00, 0x00, 0x00, 0x01, 0x10, 0x10, 0x00, 0x87, 0x12, 0x07};
     1825            uchar hack_n2[13] = {0x70, 0x51, 0xc9, 0x00, 0x00, 0x00, 0x01, 0x10, 0x10, 0x00, 0x48, 0x12, 0x07};
     1826            er->caid = ttab->bt_caidto[n];
     1827            er->prid = 0;
     1828            er->l = (er->ecm[2]+3);
     1829            memmove(er->ecm+14, er->ecm+4, er->l-1);
     1830            if (er->l > 0x88) {
     1831                memcpy(er->ecm+1, hack_n3, 13);
     1832                if (er->ecm[0] == 0x81)
     1833                    er->ecm[12] += 1;
     1834            }
     1835            else {
     1836                memcpy(er->ecm+1, hack_n2, 13);
     1837            }
     1838            er->l += 10;
     1839            er->ecm[2] = er->l-3;
     1840            er->btun = 1;
     1841            client[cs_idx].cwtun++;
     1842            cs_debug("ECM converted from: 0x%X to BetaCrypt: 0x%X for service id:0x%X",
     1843                ttab->bt_caidfrom[n], ttab->bt_caidto[n], ttab->bt_srvid[n]);
     1844        }
     1845    }
    18391846}
    18401847
Note: See TracChangeset for help on using the changeset viewer.