예제 #1
0
 private static bool isSame(byte[] buffer, ByteMask search)
 {
     for (int i = 0; i < search.Length(); i++)
     {
         if (!search.Mask[i])
         {
             continue;
         }
         if (buffer[i] != search.Pattern[i])
         {
             return(false);
         }
     }
     return(true);
 }
예제 #2
0
 private static byte[] replaceBuffer(byte[] buffer, ByteMask replace)
 {
     byte[] replacedBuffer = new byte[buffer.Length];
     for (int i = 0; i < replace.Length(); i++)
     {
         if (replace.Mask[i])
         {
             replacedBuffer[i] = replace.Pattern[i];
         }
         else
         {
             replacedBuffer[i] = buffer[i];
         }
     }
     return(replacedBuffer);
 }