Counter Strike : Global Offensive Source Code
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.

60 lines
1.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //===========================================================================//
  6. #define VPKFILENUMBER_EMBEDDED_IN_DIR_FILE 0x7fff // if a chunk refers to this file number, it is data embedded in the same file as the directory block.
  7. #define VPK_HEADER_MARKER 0x55aa1234 // significes that this is a new vpk header format
  8. #define VPK_CURRENT_VERSION 2
  9. #define VPK_PREVIOUS_VERSION 1
  10. struct VPKDirHeader_t
  11. {
  12. int32 m_nHeaderMarker;
  13. int32 m_nVersion;
  14. int32 m_nDirectorySize;
  15. int32 m_nEmbeddedChunkSize;
  16. int32 m_nChunkHashesSize;
  17. int32 m_nSelfHashesSize;
  18. int32 m_nSignatureSize;
  19. VPKDirHeader_t( void )
  20. {
  21. m_nHeaderMarker = VPK_HEADER_MARKER;
  22. m_nVersion = VPK_CURRENT_VERSION;
  23. m_nDirectorySize = 0;
  24. m_nEmbeddedChunkSize = 0;
  25. m_nChunkHashesSize = 0;
  26. m_nSelfHashesSize = 0;
  27. m_nSignatureSize = 0;
  28. }
  29. uint32 ComputeSizeofSignedDataAfterHeader() const
  30. {
  31. return m_nDirectorySize + m_nEmbeddedChunkSize + m_nChunkHashesSize + m_nSelfHashesSize;
  32. }
  33. };
  34. struct VPKDirHeaderOld_t
  35. {
  36. int32 m_nHeaderMarker;
  37. int32 m_nVersion;
  38. int32 m_nDirectorySize;
  39. VPKDirHeaderOld_t( void )
  40. {
  41. m_nHeaderMarker = VPK_HEADER_MARKER;
  42. m_nVersion = VPK_PREVIOUS_VERSION;
  43. m_nDirectorySize = 0;
  44. }
  45. };
  46. #include "vpklib/packedstore.h"