Automates the .eix/.epk repacking step that was previously done via the EterNexus.exe GUI, using the real CEterPack class so output is guaranteed read-compatible with the game client. PackList inspects an existing pack's entries, PackMake rebuilds a pack from a source folder, PackVerify byte-compares a pack's contents against source to confirm round-trip correctness.
54 lines
1.1 KiB
C++
54 lines
1.1 KiB
C++
// Read-only pack inspector: opens an existing .eix/.epk pair and prints every
|
|
// entry's stored filename, so we can learn the exact relative-path naming
|
|
// convention a given pack uses before writing anything back.
|
|
//
|
|
// Usage: PackList.exe <pathToPackFolder> <dbname>
|
|
// e.g. PackList.exe "Y:\Metin2Dev\Exec_Client\pack" root
|
|
|
|
#include <windows.h>
|
|
#include <cstdio>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "../EterPack/EterPack.h"
|
|
|
|
int main(int argc, char** argv)
|
|
{
|
|
if (argc < 3)
|
|
{
|
|
fprintf(stderr, "Usage: %s <packFolder> <dbname>\n", argv[0]);
|
|
return 1;
|
|
}
|
|
|
|
const char* pathName = argv[1];
|
|
const char* dbname = argv[2];
|
|
|
|
if (!SetCurrentDirectoryA(pathName))
|
|
{
|
|
fprintf(stderr, "FAILED to chdir to '%s'\n", pathName);
|
|
return 4;
|
|
}
|
|
|
|
CEterFileDict dict;
|
|
CEterPack pack;
|
|
|
|
if (!pack.Create(dict, dbname, "", true))
|
|
{
|
|
fprintf(stderr, "FAILED to open pack '%s' in '%s'\n", dbname, pathName);
|
|
return 2;
|
|
}
|
|
|
|
std::vector<std::string> names;
|
|
if (!pack.GetNames(&names))
|
|
{
|
|
fprintf(stderr, "FAILED GetNames\n");
|
|
return 3;
|
|
}
|
|
|
|
printf("Entries: %zu\n", names.size());
|
|
for (auto& n : names)
|
|
printf("%s\n", n.c_str());
|
|
|
|
return 0;
|
|
}
|