patch_test.cpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //
  2. // Created by Иван_Архипов on 23.11.2017.
  3. //
  4. #define _CRT_SECURE_NO_WARNINGS
  5. #include <iostream>
  6. #include <ctime>
  7. #include <algorithm>
  8. #ifdef WIN32
  9. #include <direct.h>
  10. #define mkdir(dir, mode) _mkdir(dir)
  11. #endif
  12. #include "../LotroDatPatcher.h"
  13. using namespace LOTRO_DAT;
  14. // Change these 2 variables to your path and name of .dat file
  15. const std::string path = "";//"E:\\SteamLibrary\\steamapps\\common\\";//Lord Of The Rings Online\\";
  16. const std::string filename = "client_local_English.dat";
  17. const std::string patch_filename = "image.jpg";
  18. const int file_id = 0;
  19. int main() {
  20. const clock_t begin_time = clock();
  21. freopen("errors.log", "w", stderr);
  22. try {
  23. std::cout << "Starting magic...\n";
  24. DatFile a((path + filename).c_str(), 0);
  25. std::cout << "Magic number: " << a.files_number() << std::endl;
  26. } catch (...) {
  27. printf("Some critical errors occured. Need to stop execution. See information in errors.log file");
  28. fprintf(stderr, "Some critical errors occured. Need to stop execution now...");
  29. }
  30. fprintf(stdout, "Spent %f seconds on performing magic! Thank you for your patience!\n",
  31. float(clock() - begin_time) / CLOCKS_PER_SEC);
  32. system("pause");
  33. return 0;
  34. }