Leaked source code of windows server 2003
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.

45 lines
1.1 KiB

  1. //-----------------------------------------------------------------------------
  2. //
  3. // File: obfbytes.h
  4. //
  5. // Microsoft Digital Rights Management
  6. // Copyright (C) Microsoft Corporation, 1998 - 1999, All Rights Reserved
  7. //
  8. // Description:
  9. // simple attempt to store secret data in a somewhat non-obvious way
  10. //
  11. // Author: marcuspe
  12. //
  13. //-----------------------------------------------------------------------------
  14. #ifndef __OBFBYTES_H__
  15. #define __OBFBYTES_H__
  16. #if _MSC_VER > 1000
  17. #pragma once
  18. #endif // _MSC_VER > 1000
  19. #include <wtypes.h>
  20. #define OBFBYTESLEN 4096
  21. class CObfBytes {
  22. private:
  23. BYTE *pData;
  24. bool hasContent;
  25. public:
  26. CObfBytes();
  27. ~CObfBytes();
  28. HRESULT fromClear( DWORD dwLen, BYTE *buf );
  29. HRESULT toClear( BYTE *buf );
  30. HRESULT toClear2( BYTE *buf ); // returns buf of original length which depends only
  31. // on the original bytes, but which differs from orig. bytes
  32. HRESULT getObf( BYTE *buf );
  33. HRESULT setObf( BYTE *buf );
  34. // DWORD random();
  35. };
  36. #endif // __OBFBYTES_H__