FileSystemStructs.cs 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. #region License information
  2. // ----------------------------------------------------------------------------
  3. //
  4. // libeq2 - A library for analyzing the Everquest II File Format
  5. // Blaz (blaz@blazlabs.com)
  6. //
  7. // This program is free software; you can redistribute it and/or
  8. // modify it under the terms of the GNU General Public License
  9. // as published by the Free Software Foundation; either version 2
  10. // of the License, or (at your option) any later version.
  11. //
  12. // This program is distributed in the hope that it will be useful,
  13. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. // GNU General Public License for more details.
  16. //
  17. // You should have received a copy of the GNU General Public License
  18. // along with this program; if not, write to the Free Software
  19. // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  20. //
  21. // ( The full text of the license can be found in the License.txt file )
  22. //
  23. // ----------------------------------------------------------------------------
  24. #endregion
  25. #region Using directives
  26. using System;
  27. #endregion
  28. namespace Everquest2.IO
  29. {
  30. public partial class FileSystem
  31. {
  32. protected struct VplHeader
  33. {
  34. public int DirectoryOffset;
  35. public uint Unknown0x04;
  36. public uint Unknown0x08;
  37. public int VpkNamesOffset;
  38. public uint Unknown0x10;
  39. public uint DirectoryEntryCount;
  40. public uint VpkDirectoryEntryCount;
  41. public int VpkNamesInflatedSize;
  42. public int VpkNamesDeflatedSize;
  43. public uint Unknown0x10Size;
  44. public uint Unknown0x28;
  45. public bool MustCheckVpkFiles;
  46. public int? VpkDirectoryOffset;
  47. #region Constructor
  48. public VplHeader(System.IO.BinaryReader reader)
  49. {
  50. DirectoryOffset = reader.ReadInt32();
  51. Unknown0x04 = reader.ReadUInt32();
  52. Unknown0x08 = reader.ReadUInt32();
  53. VpkNamesOffset = reader.ReadInt32();
  54. Unknown0x10 = reader.ReadUInt32();
  55. DirectoryEntryCount = reader.ReadUInt32();
  56. VpkDirectoryEntryCount = reader.ReadUInt32();
  57. VpkNamesInflatedSize = reader.ReadInt32();
  58. VpkNamesDeflatedSize = reader.ReadInt32();
  59. Unknown0x10Size = reader.ReadUInt32();
  60. Unknown0x28 = reader.ReadUInt32();
  61. if (DirectoryOffset == 0x2C)
  62. {
  63. MustCheckVpkFiles = false;
  64. VpkDirectoryOffset = null;
  65. }
  66. else
  67. {
  68. MustCheckVpkFiles = reader.ReadInt32() == 1 ? true : false;
  69. VpkDirectoryOffset = reader.ReadInt32();
  70. }
  71. }
  72. #endregion
  73. }
  74. protected struct VpkDirectoryEntry
  75. {
  76. public uint TimeOfLastModification;
  77. public int Size;
  78. #region Constructor
  79. public VpkDirectoryEntry(System.IO.BinaryReader reader)
  80. {
  81. TimeOfLastModification = reader.ReadUInt32();
  82. Size = reader.ReadInt32();
  83. }
  84. #endregion
  85. }
  86. protected struct VplFileEntry
  87. {
  88. public uint Key;
  89. public uint VpkIndex;
  90. public int Offset;
  91. public int Size;
  92. #region Constructor
  93. public VplFileEntry(System.IO.BinaryReader reader)
  94. {
  95. Key = reader.ReadUInt32();
  96. VpkIndex = reader.ReadUInt32();
  97. Offset = reader.ReadInt32();
  98. Size = reader.ReadInt32();
  99. }
  100. #endregion
  101. }
  102. protected struct VplDirectoryEntry
  103. {
  104. public uint unk0;
  105. public uint unk1;
  106. public uint unk2;
  107. public uint unk3;
  108. public uint unk4;
  109. #region Constructor
  110. public VplDirectoryEntry(System.IO.BinaryReader reader)
  111. {
  112. unk0 = reader.ReadUInt32();
  113. unk1 = reader.ReadUInt32();
  114. unk2 = reader.ReadUInt32();
  115. unk3 = reader.ReadUInt32();
  116. unk4 = reader.ReadUInt32();
  117. }
  118. #endregion
  119. }
  120. protected struct VpkFileEntry
  121. {
  122. public int Offset;
  123. public int Size;
  124. public int NameLength;
  125. #region Constructor
  126. public VpkFileEntry(System.IO.BinaryReader reader)
  127. {
  128. Offset = reader.ReadInt32();
  129. Size = reader.ReadInt32();
  130. NameLength = reader.ReadInt32();
  131. }
  132. #endregion
  133. }
  134. }
  135. }
  136. /* EOF */