#include #include #include #include "zlib.h" /* wget http://zlib.net/zlib125.zip */ /* cd zlib-1.2.5/ */ /* make -f win32/Makefile.gcc */ /* cp -iv zlib1.dll /mingw/bin */ /* cp -iv zconf.h zlib.h /mingw/include */ /* cp -iv libz.a /mingw/lib */ /* cp -iv libzdll.a /mingw/lib/libz.dll.a */ typedef struct ds_header { char m_ProductId[4]; char m_TankId[4]; int m_HeaderVersion; int m_DirSetOffset; int m_FileSetOffset; int m_IndexSize; int m_DataOffset; char m_ProductVersion[12]; char m_MinimumVersion[12]; int m_Priority; int m_Flags; char m_CreatorId[4]; GUID m_GUID; int m_IndexCRC32; int m_DataCRC32; SYSTEMTIME m_UtcBuildTime; WCHAR m_CopyrightText[100]; WCHAR m_BuildText[100]; WCHAR m_TitleText[100]; WCHAR m_AuthorText[40]; char *m_DescriptionText; } ds_header; typedef struct DirSet { int m_Count; DWORD *m_Offsets; } DirSet; typedef struct NString { short len; char name[1]; } NString; typedef struct DirEntry { int m_ParentOffset; int m_ChildCount; FILETIME m_FileTime; NString m_Name; } DirEntry; typedef struct CompressedHeader { DWORD m_CompressedSize; DWORD m_ChunkSize; } CompressedHeader; typedef struct ChunkHeader { DWORD m_UncompressedSize; DWORD m_CompressedSize; DWORD m_ExtraBytes; DWORD m_Offset; } ChunkHeader; typedef struct FileSet { int m_Count; DWORD m_Offsets[1]; } FileSet; typedef struct FileEntry { int m_ParentOffset; int m_Size; int m_Offset; int m_CRC32; FILETIME m_FileTime; WORD m_Format; WORD m_Flags; NString m_Name; } FileEntry; #define align4(x) (((((x) - 1) >> 2) << 2) + 4)