core/MemoryUtils.h
author Scott Ehlert <ds@alliedmods.net>
Sat Apr 21 17:03:28 2007 +0000 (2007-04-21)
changeset 702 ff520b71249c
parent 701 85c77b23ae47
child 1231 17badaf66ce4
permissions -rw-r--r--
Wow, how did I forget this - exported IMemoryUtils interface
     1 /**
     2  * vim: set ts=4 :
     3  * ===============================================================
     4  * SourceMod (C)2004-2007 AlliedModders LLC.  All rights reserved.
     5  * ===============================================================
     6  *
     7  * This file is not open source and may not be copied without explicit
     8  * written permission of AlliedModders LLC.  This file may not be redistributed 
     9  * in whole or significant part.
    10  * For information, see LICENSE.txt or http://www.sourcemod.net/license.php
    11  *
    12  * Version: $Id$
    13  */
    14 
    15 #ifndef _INCLUDE_SOURCEMOD_MEMORYUTILS_H_
    16 #define _INCLUDE_SOURCEMOD_MEMORYUTILS_H_
    17 
    18 #include <IMemoryUtils.h>
    19 #include "sm_globals.h"
    20 
    21 using namespace SourceMod;
    22 
    23 struct DynLibInfo
    24 {
    25 	void *baseAddress;
    26 	size_t memorySize;
    27 };
    28 
    29 class MemoryUtils : 
    30 	public IMemoryUtils,
    31 	public SMGlobalClass
    32 {
    33 public: // SMGlobalClass
    34 	void OnSourceModAllInitialized();
    35 public: // IMemoryUtils
    36 	void *FindPattern(const void *libPtr, const char *pattern, size_t len);
    37 private:
    38 	bool GetLibraryInfo(const void *libPtr, DynLibInfo &lib);
    39 };
    40 
    41 extern MemoryUtils g_MemUtils;
    42 
    43 #endif // _INCLUDE_SOURCEMOD_MEMORYUTILS_H_