public/IMemoryUtils.h

Go to the documentation of this file.
00001 /**
00002  * vim: set ts=4 :
00003  * =============================================================================
00004  * SourceMod
00005  * Copyright (C) 2004-2008 AlliedModders LLC.  All rights reserved.
00006  * =============================================================================
00007  *
00008  * This program is free software; you can redistribute it and/or modify it under
00009  * the terms of the GNU General Public License, version 3.0, as published by the
00010  * Free Software Foundation.
00011  * 
00012  * This program is distributed in the hope that it will be useful, but WITHOUT
00013  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00014  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
00015  * details.
00016  *
00017  * You should have received a copy of the GNU General Public License along with
00018  * this program.  If not, see <http://www.gnu.org/licenses/>.
00019  *
00020  * As a special exception, AlliedModders LLC gives you permission to link the
00021  * code of this program (as well as its derivative works) to "Half-Life 2," the
00022  * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
00023  * by the Valve Corporation.  You must obey the GNU General Public License in
00024  * all respects for all other code used.  Additionally, AlliedModders LLC grants
00025  * this exception to all derivative works.  AlliedModders LLC defines further
00026  * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
00027  * or <http://www.sourcemod.net/license.php>.
00028  *
00029  * Version: $Id: IMemoryUtils.h 1964 2008-03-27 04:54:56Z damagedsoul $
00030  */
00031 
00032 #ifndef _INCLUDE_SOURCEMOD_INTERFACE_BINARYUTILS_H_
00033 #define _INCLUDE_SOURCEMOD_INTERFACE_BINARYUTILS_H_
00034 
00035 #include <IShareSys.h>
00036 
00037 #define SMINTERFACE_MEMORYUTILS_NAME              "IMemoryUtils"
00038 #define SMINTERFACE_MEMORYUTILS_VERSION           1
00039 
00040 /**
00041  * @file IMemoryUtils.h
00042  * @brief Interface for finding patterns in memory.
00043  */
00044 
00045 namespace SourceMod
00046 {
00047           class IMemoryUtils : public SMInterface
00048           {
00049           public:
00050                     const char *GetInterfaceName()
00051                     {
00052                               return SMINTERFACE_MEMORYUTILS_NAME;
00053                     }
00054                     unsigned int GetInterfaceVersion()
00055                     {
00056                               return SMINTERFACE_MEMORYUTILS_VERSION;
00057                     }
00058           public:
00059                     /**
00060                      * @brief Searches for a pattern of bytes within the memory of a dynamic library.
00061                      *
00062                      * @param libPtr    Pointer to any chunk of memory that resides in the dynamic library.
00063                      * @param pattern   Pattern of bytes to search for. 0x2A can be used as a wildcard.
00064                      * @param len                 Size of the pattern in bytes.
00065                      * @return                              Pointer to pattern found in memory, NULL if not found.
00066                      */
00067                     virtual void *FindPattern(const void *libPtr, const char *pattern, size_t len) =0;
00068           };
00069 }
00070 
00071 #endif // _INCLUDE_SOURCEMOD_INTERFACE_MEMORYUTILS_H_

Generated on Fri Nov 21 02:10:02 2008 for SourceMod SDK by  doxygen 1.5.1