|
@@ -34,6 +34,7 @@ int main() {
|
|
|
// There is no need to touch something else
|
|
|
|
|
|
std::string output_dir = std::string("Data (") + filename + std::string(")\\");
|
|
|
+ freopen((output_dir + std::string("errors.log")).c_str(), "w", stderr);
|
|
|
|
|
|
std::string txt_dir = "txt\\";
|
|
|
std::string jpg_dir = "jpg\\";
|
|
@@ -71,14 +72,14 @@ int main() {
|
|
|
if (exportSoundsToDb) sounds = new Database(output_dir + std::string("Sounds.db"));
|
|
|
if (exportTextsToDb) texts = new Database(output_dir + std::string("Texts.db"));
|
|
|
if (exportFontsToDb) fonts = new Database(output_dir + std::string("Fonts.db"));
|
|
|
- if (exportTexturesToDb) textures= new Database(output_dir + std::string("Textures.db"));
|
|
|
- if (exportUnknownToDb) textures= new Database(output_dir + std::string("Unknown.db"));
|
|
|
+ if (exportTexturesToDb) textures = new Database(output_dir + std::string("Textures.db"));
|
|
|
+ if (exportUnknownToDb) unknown = new Database(output_dir + std::string("Unknown.db"));
|
|
|
|
|
|
- std::cerr << "Starting search...\n";
|
|
|
+ std::cout << "Starting search...\n";
|
|
|
DatFile a(path + filename);
|
|
|
- std::cerr << "Total files found: " << a.dictionary().size() << std::endl;
|
|
|
+ std::cout << "Total files found: " << a.dictionary().size() << std::endl;
|
|
|
|
|
|
- std::cerr << "Writing unordered dictionary:\n";
|
|
|
+ std::cout << "Writing unordered dictionary:\n";
|
|
|
FILE *f;
|
|
|
fopen_s(&f, (output_dir + "dict.txt").c_str(), "w");
|
|
|
fprintf(f, "file_id | offset | extension\n");
|
|
@@ -95,7 +96,7 @@ int main() {
|
|
|
}
|
|
|
fclose(f);
|
|
|
|
|
|
- std::cerr << "Beginning unpacking...\n";
|
|
|
+ std::cout << "Beginning unpacking...\n";
|
|
|
|
|
|
long long all = a.dictionary().size();
|
|
|
long long counter = 0;
|
|
@@ -148,12 +149,19 @@ int main() {
|
|
|
|
|
|
counter++;
|
|
|
if ((counter - 1) * 100ll / all != counter * 100ll / all) {
|
|
|
- fprintf(stderr, "Done: %lld%%\n", counter * 100ll / all);
|
|
|
+ fprintf(stdout, "Done: %lld%%\n", counter * 100ll / all);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- std::cerr << "Total found:" << std::endl;
|
|
|
- std::cerr << "Txt: " << txt_all << std::endl
|
|
|
+ delete images;
|
|
|
+ delete sounds;
|
|
|
+ delete texts;
|
|
|
+ delete fonts;
|
|
|
+ delete textures;
|
|
|
+ delete unknown;
|
|
|
+
|
|
|
+ std::cout << "Total found:" << std::endl;
|
|
|
+ std::cout << "Txt: " << txt_all << std::endl
|
|
|
<< "JPG: " << jpg_all << std::endl
|
|
|
<< "DDS: " << dds_all << std::endl
|
|
|
<< "WAV: " << wav_all << std::endl
|
|
@@ -161,8 +169,8 @@ int main() {
|
|
|
<< "Fonts " << font_all << std::endl
|
|
|
<< "Unknown: " << unk_all << std::endl;
|
|
|
|
|
|
- std::cerr << "Total exported (counted both to files and databases):" << std::endl;
|
|
|
- std::cerr << "Txt: " << txt_suc << std::endl
|
|
|
+ std::cout << "Total exported (counted both to files and databases):" << std::endl;
|
|
|
+ std::cout << "Txt: " << txt_suc << std::endl
|
|
|
<< "JPG: " << jpg_suc << std::endl
|
|
|
<< "DDS: " << dds_suc << std::endl
|
|
|
<< "WAV: " << wav_suc << std::endl
|
|
@@ -170,9 +178,7 @@ int main() {
|
|
|
<< "Fonts " << font_suc << std::endl
|
|
|
<< "Unknown: " << unk_suc << std::endl;
|
|
|
|
|
|
- fprintf(stderr, "Spent %f seconds on running unpacker! Thank you for your patience!\n", float(clock() - begin_time) / CLOCKS_PER_SEC);
|
|
|
- std::cerr << "Success. Press enter to close\n";
|
|
|
-
|
|
|
+ fprintf(stdout, "Spent %f seconds on running unpacker! Thank you for your patience!\n", float(clock() - begin_time) / CLOCKS_PER_SEC);
|
|
|
system("pause");
|
|
|
return 0;
|
|
|
}
|