Skip to content
Browse files

MemXorKey added

  • Loading branch information...
1 parent 2143cca commit dc3c51468ef6fd47c8cd8e3c8edd421156584769 @vshymanskyy committed Sep 27, 2012
Showing with 14 additions and 0 deletions.
  1. +14 −0 inc/XHelpers.h
View
14 inc/XHelpers.h
@@ -114,6 +114,20 @@ void MemRand(void* dst, unsigned len)
}
inline
+void MemXorKey(void* dst, size_t n, const char* key)
+{
+ const char* s = key;
+ char* d = (char*)dst;
+
+ for (; n > 0; n--) {
+ if (*s == '\0') {
+ s = key;
+ }
+ *d++ ^= *s++;
+ }
+}
+
+inline
char** CommandLineToArgv(const char* command, int* _argc)
{
char** argv;

0 comments on commit dc3c514

Please sign in to comment.
Something went wrong with that request. Please try again.