diff --git a/core/MemoryUtils.cpp b/core/MemoryUtils.cpp index a34c0e4e..828077ae 100644 --- a/core/MemoryUtils.cpp +++ b/core/MemoryUtils.cpp @@ -21,17 +21,15 @@ MemoryUtils g_MemUtils; +#if 0 MemoryUtils::MemoryUtils() { #ifdef PLATFORM_WINDOWS - /* This might be used in the future? */ - #if 0 SYSTEM_INFO info; GetSystemInfo(&info); m_PageSize = info.dwPageSize; - #endif #elif defined PLATFORM_POSIX @@ -39,8 +37,9 @@ MemoryUtils::MemoryUtils() #endif } +#endif -void *MemoryUtils::FindPattern(void *libPtr, const char *pattern, size_t len) +void *MemoryUtils::FindPattern(const void *libPtr, const char *pattern, size_t len) { DynLibInfo lib; bool found; @@ -77,7 +76,7 @@ void *MemoryUtils::FindPattern(void *libPtr, const char *pattern, size_t len) return NULL; } -bool MemoryUtils::GetLibraryInfo(void *libPtr, DynLibInfo &lib) +bool MemoryUtils::GetLibraryInfo(const void *libPtr, DynLibInfo &lib) { unsigned long baseAddr; diff --git a/core/MemoryUtils.h b/core/MemoryUtils.h index ecb9e278..cda16574 100644 --- a/core/MemoryUtils.h +++ b/core/MemoryUtils.h @@ -28,13 +28,9 @@ struct DynLibInfo class MemoryUtils : public IMemoryUtils { public: - MemoryUtils(); -public: - void *FindPattern(void *libPtr, const char *pattern, size_t len); + void *FindPattern(const void *libPtr, const char *pattern, size_t len); private: - bool GetLibraryInfo(void *libPtr, DynLibInfo &lib); -private: - size_t m_PageSize; + bool GetLibraryInfo(const void *libPtr, DynLibInfo &lib); }; extern MemoryUtils g_MemUtils; diff --git a/public/IMemoryUtils.h b/public/IMemoryUtils.h index 29e1d9fb..828ffe68 100644 --- a/public/IMemoryUtils.h +++ b/public/IMemoryUtils.h @@ -46,7 +46,7 @@ namespace SourceMod * @param len Size of the pattern in bytes. * @return Pointer to pattern found in memory, NULL if not found. */ - virtual void *FindPattern(void *libPtr, const char *pattern, size_t len) =0; + virtual void *FindPattern(const void *libPtr, const char *pattern, size_t len) =0; }; }