Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

19 lines
337 B

#define SZ_MAGICKEY "Denali rocks!"
void* xor(void* pData, const int cbData, const void* pKey, const int cbKey)
{
void* pRet = pData;
int iKeyPos = 0;
BYTE* pbData = (BYTE*) pData;
BYTE* pbKey = (BYTE*) pKey;
for(int i = 0; i < cbData; i++)
{
*pbData++ ^= *(pbKey + iKeyPos++);
iKeyPos %= cbKey;
}
return pRet;
}