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

  1. #define SZ_MAGICKEY "Denali rocks!"
  2. void* xor(void* pData, const int cbData, const void* pKey, const int cbKey)
  3. {
  4. void* pRet = pData;
  5. int iKeyPos = 0;
  6. BYTE* pbData = (BYTE*) pData;
  7. BYTE* pbKey = (BYTE*) pKey;
  8. for(int i = 0; i < cbData; i++)
  9. {
  10. *pbData++ ^= *(pbKey + iKeyPos++);
  11. iKeyPos %= cbKey;
  12. }
  13. return pRet;
  14. }