Wow, how did I forget this - exported IMemoryUtils interface
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40708
This commit is contained in:
parent
199d839122
commit
7ce1ef6ea1
@ -13,7 +13,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "MemoryUtils.h"
|
#include "MemoryUtils.h"
|
||||||
#include "sm_platform.h"
|
#include "ShareSys.h"
|
||||||
#ifdef PLATFORM_LINUX
|
#ifdef PLATFORM_LINUX
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <elf.h>
|
#include <elf.h>
|
||||||
@ -39,6 +39,11 @@ MemoryUtils::MemoryUtils()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void MemoryUtils::OnSourceModAllInitialized()
|
||||||
|
{
|
||||||
|
g_ShareSys.AddInterface(NULL, this);
|
||||||
|
}
|
||||||
|
|
||||||
void *MemoryUtils::FindPattern(const void *libPtr, const char *pattern, size_t len)
|
void *MemoryUtils::FindPattern(const void *libPtr, const char *pattern, size_t len)
|
||||||
{
|
{
|
||||||
DynLibInfo lib;
|
DynLibInfo lib;
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
#define _INCLUDE_SOURCEMOD_MEMORYUTILS_H_
|
#define _INCLUDE_SOURCEMOD_MEMORYUTILS_H_
|
||||||
|
|
||||||
#include <IMemoryUtils.h>
|
#include <IMemoryUtils.h>
|
||||||
|
#include "sm_globals.h"
|
||||||
|
|
||||||
using namespace SourceMod;
|
using namespace SourceMod;
|
||||||
|
|
||||||
@ -25,9 +26,13 @@ struct DynLibInfo
|
|||||||
size_t memorySize;
|
size_t memorySize;
|
||||||
};
|
};
|
||||||
|
|
||||||
class MemoryUtils : public IMemoryUtils
|
class MemoryUtils :
|
||||||
|
public IMemoryUtils,
|
||||||
|
public SMGlobalClass
|
||||||
{
|
{
|
||||||
public:
|
public: // SMGlobalClass
|
||||||
|
void OnSourceModAllInitialized();
|
||||||
|
public: // IMemoryUtils
|
||||||
void *FindPattern(const void *libPtr, const char *pattern, size_t len);
|
void *FindPattern(const void *libPtr, const char *pattern, size_t len);
|
||||||
private:
|
private:
|
||||||
bool GetLibraryInfo(const void *libPtr, DynLibInfo &lib);
|
bool GetLibraryInfo(const void *libPtr, DynLibInfo &lib);
|
||||||
|
Loading…
Reference in New Issue
Block a user