2007-04-20 20:32:33 +02:00
|
|
|
/**
|
|
|
|
* vim: set ts=4 :
|
|
|
|
* ===============================================================
|
|
|
|
* SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved.
|
|
|
|
* ===============================================================
|
|
|
|
*
|
|
|
|
* This file is not open source and may not be copied without explicit
|
|
|
|
* written permission of AlliedModders LLC. This file may not be redistributed
|
|
|
|
* in whole or significant part.
|
|
|
|
* For information, see LICENSE.txt or http://www.sourcemod.net/license.php
|
|
|
|
*
|
|
|
|
* Version: $Id$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _INCLUDE_SOURCEMOD_MEMORYUTILS_H_
|
|
|
|
#define _INCLUDE_SOURCEMOD_MEMORYUTILS_H_
|
|
|
|
|
|
|
|
#include <IMemoryUtils.h>
|
2007-04-21 19:03:28 +02:00
|
|
|
#include "sm_globals.h"
|
2007-04-20 20:32:33 +02:00
|
|
|
|
|
|
|
using namespace SourceMod;
|
|
|
|
|
|
|
|
struct DynLibInfo
|
|
|
|
{
|
|
|
|
void *baseAddress;
|
|
|
|
size_t memorySize;
|
|
|
|
};
|
|
|
|
|
2007-04-21 19:03:28 +02:00
|
|
|
class MemoryUtils :
|
|
|
|
public IMemoryUtils,
|
|
|
|
public SMGlobalClass
|
2007-04-20 20:32:33 +02:00
|
|
|
{
|
2007-04-21 19:03:28 +02:00
|
|
|
public: // SMGlobalClass
|
|
|
|
void OnSourceModAllInitialized();
|
|
|
|
public: // IMemoryUtils
|
2007-04-20 20:50:52 +02:00
|
|
|
void *FindPattern(const void *libPtr, const char *pattern, size_t len);
|
2007-04-20 20:32:33 +02:00
|
|
|
private:
|
2007-04-20 20:50:52 +02:00
|
|
|
bool GetLibraryInfo(const void *libPtr, DynLibInfo &lib);
|
2007-04-20 20:32:33 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
extern MemoryUtils g_MemUtils;
|
|
|
|
|
|
|
|
#endif // _INCLUDE_SOURCEMOD_MEMORYUTILS_H_
|