summaryrefslogtreecommitdiff
path: root/src/StormCommon.h
diff options
context:
space:
mode:
authorunknown <E:\Ladik\Mail>2015-05-06 16:33:45 +0200
committerunknown <E:\Ladik\Mail>2015-05-06 16:33:45 +0200
commit3cfa7f2a1a81b226f5a5c3a43f4f9bd5704881f9 (patch)
tree8b99777e696e16f1cacc94b0b17b9b26a7b1d886 /src/StormCommon.h
parentabd17ec91e0ab54a9d29af02c36710c1ed4b0ee0 (diff)
+ Fixed possible stack overflow in HashStringJenkins
+ StormLib now creates a listfile even for empty archives to make sure it will be maintained at later point when files are added to it + Bug fixes in listfile loading
Diffstat (limited to 'src/StormCommon.h')
-rw-r--r--src/StormCommon.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/StormCommon.h b/src/StormCommon.h
index 3363a70..d4bf57c 100644
--- a/src/StormCommon.h
+++ b/src/StormCommon.h
@@ -178,6 +178,8 @@ ULONGLONG CalculateRawSectorOffset(TMPQFile * hf, DWORD dwSectorOffset);
int ConvertMpqHeaderToFormat4(TMPQArchive * ha, ULONGLONG MpqOffset, ULONGLONG FileSize, DWORD dwFlags);
+bool IsValidHashEntry(TMPQArchive * ha, TMPQHash * pHash);
+
TMPQHash * FindFreeHashEntry(TMPQArchive * ha, DWORD dwStartIndex, DWORD dwName1, DWORD dwName2, LCID lcLocale);
TMPQHash * GetFirstHashEntry(TMPQArchive * ha, const char * szFileName);
TMPQHash * GetNextHashEntry(TMPQArchive * ha, TMPQHash * pFirstHash, TMPQHash * pPrevHash);
@@ -245,6 +247,7 @@ int SCompDecompressMpk(void * pvOutBuffer, int * pcbOutBuffer, void * pvInBuffer
// Common functions - MPQ File
TMPQFile * CreateFileHandle(TMPQArchive * ha, TFileEntry * pFileEntry);
+TMPQFile * CreateWritableHandle(TMPQArchive * ha, DWORD dwFileSize);
void * LoadMpqTable(TMPQArchive * ha, ULONGLONG ByteOffset, DWORD dwCompressedSize, DWORD dwRealSize, DWORD dwKey, bool * pbTableIsCut);
int AllocateSectorBuffer(TMPQFile * hf);
int AllocatePatchInfo(TMPQFile * hf, bool bLoadFromFile);
@@ -303,6 +306,12 @@ int SFileAddFile_Init(
TMPQFile ** phf
);
+int SFileAddFile_Init(
+ TMPQArchive * ha,
+ TMPQFile * hfSrc,
+ TMPQFile ** phf
+ );
+
int SFileAddFile_Write(
TMPQFile * hf,
const void * pvData,
@@ -339,12 +348,14 @@ int SSignFileFinish(TMPQArchive * ha);
void DumpMpqHeader(TMPQHeader * pHeader);
void DumpHashTable(TMPQHash * pHashTable, DWORD dwHashTableSize);
void DumpHetAndBetTable(TMPQHetTable * pHetTable, TMPQBetTable * pBetTable);
+void DumpFileTable(TFileEntry * pFileTable, DWORD dwFileTableSize);
#else
-#define DumpMpqHeader(h) /* */
-#define DumpHashTable(h, s) /* */
-#define DumpHetAndBetTable(h, b) /* */
+#define DumpMpqHeader(h) /* */
+#define DumpHashTable(t, s) /* */
+#define DumpHetAndBetTable(t, s) /* */
+#define DumpFileTable(t, s) /* */
#endif