Changeset 4692 for trunk/reader-dre.c


Ignore:
Timestamp:
Feb 8, 2011, 10:16:39 AM (9 years ago)
Author:
_network
Message:

reader-dre: fix cw postprocessing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/reader-dre.c

    r4687 r4692  
    268268void DREover(unsigned char *ECMdata, unsigned char *DW)
    269269{
    270   if(ECMdata[2] >= (43+4) && ECMdata[40] == 0x3A && ECMdata[41] == 0x4B)
    271   {
    272     int i;
    273     byte data[8], key[8];
    274 
    275     for(i = 0; i < 8; i++) key[i] = DESkeys[(ECMdata[42] & 0x0F) * 8 + i];
    276 
    277     for(i = 0; i < 8; i++) data[i] = DW[i];
    278     des_decrypt(data, 8, key);                          // even DW post-process
    279     for(i = 0; i < 8; i++) DW[i] = data[i];
    280 
    281     for(i = 0; i < 8; i++) data[i] = DW[8+i];
    282     des_decrypt(data, 8, key);                          // odd DW post-process
    283     for(i = 0; i < 8; i++) DW[8+i] = data[i];
    284   };
     270    uchar key[8];
     271    if(ECMdata[2] >= (43+4) && ECMdata[40] == 0x3A && ECMdata[41] == 0x4B)
     272    {
     273        memcpy(key, &DESkeys[(ECMdata[42] & 0x0F) * 8], 8);
     274
     275        doPC1(key);
     276
     277        des(key, DES_ECS2_DECRYPT, DW); // even DW post-process
     278        des(key, DES_ECS2_DECRYPT, DW+8); // odd DW post-process
     279    };
    285280};
    286281
Note: See TracChangeset for help on using the changeset viewer.