szexefile #pragma once #define WIN32_LEAN_AND_MEAN #include #include #include #include class Memory szexefile How to get it for free? szexefile { private: std::uintptr_t processId = 0; void* processHandle = nullptr; public: Memory(const std::string_view processName) noexcept { ::PROCESSENTRY32 entry = { }; entry.dwSize = sizeof(::PROCESSENTRY32); szexefile PasteShr szexefile const auto snapShot = ::CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); while (::Process32Next(snapShot, &entry)) { if (!processName.compare(entry.szExeFile)) { processId = entry.th32ProcessID; processHandle = ::OpenProcess(PROCESS_ALL_ACCESS, FALSE, processId); break; szexefile How to dowload it? szexefile } } if (snapShot) ::CloseHandle(snapShot); } ~Memory() { if (processHandle) szexefile How to use it? szexefile ::CloseHandle(processHandle); } const std::uintptr_t GetModuleAddress(const std::string_view moduleName) const noexcept { ::MODULEENTRY32 entry = { }; entry.dwSize = sizeof(::MODULEENTRY32); const auto snapShot = ::CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, processId); szexefile PasteShr szexefile std::uintptr_t result = 0; while (::Module32Next(snapShot, &entry)) { if (!moduleName.compare(entry.szModule)) { result = reinterpret_cast(entry.modBaseAddr); break; } } szexefile PasteShr szexefile if (snapShot) ::CloseHandle(snapShot); return result; } template constexpr const T Read(const std::uintptr_t& address) const noexcept { szexefile How to get it? szexefile T value = { }; ::ReadProcessMemory(processHandle, reinterpret_cast(address), &value, sizeof(T), NULL); return value; } template constexpr void Write(const std::uintptr_t& address, const T& value) const noexcept { ::WriteProcessMemory(processHandle, reinterpret_cast(address), &value, sizeof(T), NULL); } szexefile PasteShr szexefile }; szexefile