Advertisement
Wolfrost

C++ Mask check for signatures

Mar 30th, 2016
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. bool MaskCheck(int StartOffset, const char* Mask, const BYTE* Pattern, const size_t& PatternSize)
  2. {
  3.     // Senza puntatori
  4.     for (unsigned int i=0; i<PatternSize; i++)
  5.     {
  6.         if (Mask[i] == 'x' && Pattern[i] != this->DumpedRegion[StartOffset + i])
  7.             return false;
  8.     }
  9.     return true;
  10.  
  11.     // Con i puntatori
  12.     for( ; *Mask; ++Mask, ++this->DumpedRegion, ++Pattern ) {
  13.         if( *Mask == 'x' && *this->DumpedRegion != *Pattern )
  14.             return false;
  15.     }
  16.     return (*Mask == NULL);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement