Here is a completed version of a basic .package packer that I have created in C++.
PHP:
--------------------------------------------------------
--------------------------------------------------------
dTantra .Package File Packer - RageZone Release -
--------------------------------------------------------
--------------------------------------------------------
#pragma pack(push, 1)
struct PackHeader
{
char MagicBytes[10];
unsigned int FileCount;
unsigned int DataStart;
byte Filler00;
};
struct PackFile
{
short DataLength;
long long FileOffset;
DWORD FileRawSize;
DWORD FilePackSize;
DWORD PackID;
DWORD PackTime;
byte Filler00;
string FilePath;
byte NullTerminate;
};
#pragma pack(pop)
--------------------------------------------------------
--------------------------------------------------------
Inside the rar you will find the following files:
ReadMe.txt - This file.
dTantra_Package.exe - The program.
zlib1.dll - DLL required for compression.
sample_package - Directory that contains some test files to compress. (This is the same as updater_lua.package included with the client.)
--------------------------------------------------------
--------------------------------------------------------
To use the program you simply launch the dTantra_Package.exe and follow the directions.
To create a package for the sample_package, follow the following steps.
1. Launch dTantra_Package.exe.
2. At the first prompt type "sample_package" without the quotes and hit enter.
3. At the second prompt type "sample.package" without the quotes and hit enter.
4. At the third prompt type a package id number. (The number for updater_lua.package is 50792413.)
5. Wait for it to complete.
You can now compare the generated package file to updater_lua.package. You will notice that some of the data does not match up, this is the PackTime and PackID if you specified a different number at the third prompt.
--------------------------------------------------------
--------------------------------------------------------
PackID may or may not be important and used by the game client for identification. It is best to use the same PackID as those that come from the original packages. You can find that out by using the structure found at the top of this ReadMe.
--------------------------------------------------------
--------------------------------------------------------
None of these files are encrypted and are thus very easily debug-able. If you upload this release elsewhere please leave all files included and unchanged since I have spent my free time creating them.
--------------------------------------------------------
--------------------------------------------------------
In the first prompt when it asks for file path, you can use relative paths such as "sample_package", or absolute paths such as "c:\test\sample_package".