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 "sm_platform.h"
 | 
			
		||||
#include "ShareSys.h"
 | 
			
		||||
#ifdef PLATFORM_LINUX
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include <elf.h>
 | 
			
		||||
@ -39,6 +39,11 @@ MemoryUtils::MemoryUtils()
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
void MemoryUtils::OnSourceModAllInitialized()
 | 
			
		||||
{
 | 
			
		||||
	g_ShareSys.AddInterface(NULL, this);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void *MemoryUtils::FindPattern(const void *libPtr, const char *pattern, size_t len)
 | 
			
		||||
{
 | 
			
		||||
	DynLibInfo lib;
 | 
			
		||||
 | 
			
		||||
@ -16,6 +16,7 @@
 | 
			
		||||
#define _INCLUDE_SOURCEMOD_MEMORYUTILS_H_
 | 
			
		||||
 | 
			
		||||
#include <IMemoryUtils.h>
 | 
			
		||||
#include "sm_globals.h"
 | 
			
		||||
 | 
			
		||||
using namespace SourceMod;
 | 
			
		||||
 | 
			
		||||
@ -25,9 +26,13 @@ struct DynLibInfo
 | 
			
		||||
	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);
 | 
			
		||||
private:
 | 
			
		||||
	bool GetLibraryInfo(const void *libPtr, DynLibInfo &lib);
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user