Advertisement
Guest User

Untitled

a guest
Aug 30th, 2014
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.58 KB | None | 0 0
  1. bool found = false;
  2. //Get the offset
  3. for( unsigned char e = 0; e < iTableSize; e++)
  4. {
  5.     if (found) {
  6.         break;
  7.     }
  8.     if(table[e] == vecItems[i][t])
  9.     {
  10.         //2nd Byte | if t + 1 < iLength FIX
  11.         if(t + 1 < iTableSize)
  12.         {
  13.             for( unsigned char r = 0; r < iTableSize; r++)
  14.             {
  15.                 if(table[r] == vecItems[i][t + 1])
  16.                 {
  17.                     //lets search the byte
  18.                     for(unsigned char random = 0x00; random < 0xFF; random++)
  19.                     {
  20.                         if((random == (e << 4) & 0xF0U) && random == (r & 0x0FU))
  21.                         {
  22.                             //found
  23.                             this->itemDictionary[iFile].vecBuffer.push_back(random);
  24.                             found = true;
  25.                             break;
  26.                         }
  27.                     }
  28.                 }
  29.  
  30.                 if(found)
  31.                 {
  32.                     break;
  33.                 }
  34.             }
  35.  
  36.             if(!found)
  37.             {
  38.                 //lets search the byte
  39.                 for(unsigned char random = 0x00; random < 0xFF; random++)
  40.                 {
  41.                     if((random == (e << 4) & 0xF0U) && random == (0x00 & 0x0FU))
  42.                     {
  43.                         //found
  44.                         this->itemDictionary[iFile].vecBuffer.push_back(random);
  45.                         found = true;
  46.                         break;
  47.                     }
  48.                 }
  49.             }
  50.  
  51.             if(!found)
  52.             {
  53.                 //ShowMessage("Error");
  54.                 this->itemDictionary[iFile].vecBuffer.push_back((e << 4) & 0xF0U);
  55.             }
  56.         }else
  57.         {
  58.             //lets search the byte
  59.             for(unsigned char random = 0x00; random < 0xFF; random++)
  60.             {
  61.                 if((random == (e << 4) & 0xF0U) && random == (0x00 & 0x0FU))
  62.                 {
  63.                     //found
  64.                     this->itemDictionary[iFile].vecBuffer.push_back(random);
  65.                     found = false;
  66.                     break;
  67.                 }
  68.             }
  69.  
  70.             if(!found)
  71.             {
  72.                 //ShowMessage("Error 2");
  73.                 this->itemDictionary[iFile].vecBuffer.push_back((e & 0x0FU));
  74.             }
  75.         }
  76.  
  77.         t++;
  78.         break;
  79.     }
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement