windows-nt/Source/XPSP1/NT/inetsrv/iis/svcs/cmp/asp51/magic.h

20 lines
337 B
C
Raw Permalink Normal View History

2020-09-26 03:20:57 -05:00
#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;
}