diff --git a/example_config.xml b/example_config.xml index 8fd4c49..25ab82c 100644 --- a/example_config.xml +++ b/example_config.xml @@ -9,6 +9,9 @@ + + + diff --git a/wowreeb/Config.cpp b/wowreeb/Config.cpp index 2cf5a71..248cdfd 100644 --- a/wowreeb/Config.cpp +++ b/wowreeb/Config.cpp @@ -133,6 +133,7 @@ void Config::Reload() ins.OurDll = _ourDll; ins.OurMethod = "Load"; ZeroMemory(&ins.SHA256, sizeof(ins.SHA256)); + ins.Console = false; ins.Fov = 0.f; for (auto r = n->first_attribute(); !!r; r = r->next_attribute()) @@ -202,6 +203,30 @@ void Config::Reload() } } } + else if (cname == "Console") + { + std::string consoleValue; + + for (auto r = c->first_attribute(); !!r; r = r->next_attribute()) + { + const std::string rname(r->name()); + + if (rname == "Value") + { + consoleValue = std::string(r->value()); + + std::transform(consoleValue.begin(), consoleValue.end(), consoleValue.begin(), ::toupper); + } + else + { + std::stringstream str; + str << "Unexpected " << cname << " attribute \"" << rname << "\""; + throw std::runtime_error(str.str().c_str()); + } + } + + ins.Console = consoleValue == "1" || consoleValue == "TRUE"; + } else if (cname == "Fov") { for (auto r = c->first_attribute(); !!r; r = r->next_attribute()) @@ -294,6 +319,12 @@ void Config::Reload() std::transform(configValue.begin(), configValue.end(), configValue.begin(), ::toupper); } + else + { + std::stringstream str; + str << "Unexpected " << name << " attribute \"" << name << "\""; + throw std::runtime_error(str.str().c_str()); + } } if (configName == "ClearWDB") diff --git a/wowreeb/Config.hpp b/wowreeb/Config.hpp index cb81167..2396292 100644 --- a/wowreeb/Config.hpp +++ b/wowreeb/Config.hpp @@ -52,6 +52,8 @@ class Config std::string AuthServer; + bool Console; + float Fov; fs::path OurDll; diff --git a/wowreeb/Injector.cpp b/wowreeb/Injector.cpp index f73878e..f252f13 100644 --- a/wowreeb/Injector.cpp +++ b/wowreeb/Injector.cpp @@ -97,11 +97,14 @@ void EjectionPoll(hadesmem::Process process, HMODULE dll, PVOID remoteBuffer, si unsigned int Inject( const fs::path &exe, const fs::path &ourDll, const std::string &ourMethod, - const std::string &authServer, float fov, + const std::string &authServer, bool console, float fov, const fs::path &nativeDll, const std::string &nativeMethod, const fs::path &clrDll, const std::wstring &clrTypeName, const std::wstring &clrMethodName) { - const std::vector createArgs { L"-console" }; + std::vector createArgs; + + if (console) + createArgs.emplace_back(L"-console"); try { diff --git a/wowreeb/Injector.hpp b/wowreeb/Injector.hpp index c1ffb5a..3a6e5df 100644 --- a/wowreeb/Injector.hpp +++ b/wowreeb/Injector.hpp @@ -33,6 +33,6 @@ namespace fs = std::experimental::filesystem; unsigned int Inject( const fs::path &exe, const fs::path &ourDll, const std::string &ourMethod, - const std::string &authServer, float fov, + const std::string &authServer, bool console, float fov, const fs::path &nativeDll, const std::string &nativeMethod, const fs::path &clrDll, const std::wstring &clrTypeName, const std::wstring &clrMethodName); \ No newline at end of file diff --git a/wowreeb/main.cpp b/wowreeb/main.cpp index ac0755f..066fe91 100644 --- a/wowreeb/main.cpp +++ b/wowreeb/main.cpp @@ -127,7 +127,7 @@ void Launch(const Config::ConfigEntry &entry, bool clearWDB, bool verifyChecksum { ::Inject(entry.Path, entry.OurDll, entry.OurMethod, - entry.AuthServer, entry.Fov, + entry.AuthServer, entry.Console, entry.Fov, entry.NativeDll, entry.NativeMethod, entry.CLRDll, make_wstring(entry.CLRTypeName), make_wstring(entry.CLRMethodName)); return;