diff --git a/GUI/misc.cpp b/GUI/misc.cpp index 058b2f0..02c48ff 100644 --- a/GUI/misc.cpp +++ b/GUI/misc.cpp @@ -4,16 +4,6 @@ #include #include -std::wstring S(const QString& S) -{ - return S.toStdWString(); -} - -QString S(const std::wstring& S) -{ - return QString::fromStdWString(S); -} - namespace { std::optional ParseRCode(QString RCode) @@ -221,7 +211,7 @@ namespace if (!(hp.type & MODULE_OFFSET)) if (AutoHandle<> process = OpenProcess(PROCESS_VM_READ | PROCESS_QUERY_INFORMATION, FALSE, processId)) if (MEMORY_BASIC_INFORMATION info = {}; VirtualQueryEx(process, (LPCVOID)hp.address, &info, sizeof(info))) - if (auto moduleName = Util::GetModuleFileName(processId, (HMODULE)info.AllocationBase)) + if (auto moduleName = Util::GetModuleFilename(processId, (HMODULE)info.AllocationBase)) { hp.type |= MODULE_OFFSET; hp.address -= (uint64_t)info.AllocationBase; diff --git a/GUI/misc.h b/GUI/misc.h index c0cf57f..7eadb92 100644 --- a/GUI/misc.h +++ b/GUI/misc.h @@ -6,13 +6,14 @@ class QAutoFile { public: - QAutoFile(QString name, QIODevice::OpenMode mode) : f(name) { f.open(mode); } + QAutoFile(const QString& name, QIODevice::OpenMode mode) : f(name) { f.open(mode); } QFile* operator->() { return &f; } + private: QFile f; }; -std::wstring S(const QString& S); -QString S(const std::wstring& S); +inline std::wstring S(const QString& S) { return { S.toStdWString() }; } +inline QString S(const std::wstring& S) { return QString::fromStdWString(S); } std::optional ParseCode(QString HCode); QString GenerateCode(HookParam hp, DWORD processId);