VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Dlgcode.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Common/Dlgcode.c')
-rw-r--r--src/Common/Dlgcode.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Common/Dlgcode.c b/src/Common/Dlgcode.c
index 00e1558f..7d2fffba 100644
--- a/src/Common/Dlgcode.c
+++ b/src/Common/Dlgcode.c
@@ -13643,3 +13643,22 @@ BOOL GetSetupconfigLocation (wchar_t* path, DWORD cchSize)
return bResult;
}
+
+BOOL BufferHasPattern (const unsigned char* buffer, size_t bufferLen, const void* pattern, size_t patternLen)
+{
+ BOOL bRet = FALSE;
+ if (patternLen <= bufferLen)
+ {
+ size_t i;
+ for (i = 0; i <= (bufferLen - patternLen); ++i)
+ {
+ if (memcmp (&buffer[i], pattern, patternLen) == 0)
+ {
+ bRet = TRUE;
+ break;
+ }
+ }
+ }
+
+ return bRet;
+}