public/IMemoryUtils.h
author Scott Ehlert <ds@alliedmods.net>
Sun Jul 15 08:00:26 2007 +0000 (2007-07-15)
changeset 1116 40cc5e9f0f1b
parent 701 85c77b23ae47
child 1226 478550a4d5ec
permissions -rw-r--r--
Removed strange debugging code
     1 /**
     2  * vim: set ts=4 :
     3  * ===============================================================
     4  * SourceMod, Copyright (C) 2004-2007 AlliedModders LLC. 
     5  * All rights reserved.
     6  * ===============================================================
     7  *
     8  *  This file is part of the SourceMod/SourcePawn SDK.  This file may only be 
     9  * used or modified under the Terms and Conditions of its License Agreement, 
    10  * which is found in public/licenses/LICENSE.txt.  As of this notice, derivative 
    11  * works must be licensed under the GNU General Public License (version 2 or 
    12  * greater).  A copy of the GPL is included under public/licenses/GPL.txt.
    13  * 
    14  * To view the latest information, see: http://www.sourcemod.net/license.php
    15  *
    16  * Version: $Id$
    17  */
    18 
    19 #ifndef _INCLUDE_SOURCEMOD_INTERFACE_BINARYUTILS_H_
    20 #define _INCLUDE_SOURCEMOD_INTERFACE_BINARYUTILS_H_
    21 
    22 #include <IShareSys.h>
    23 
    24 #define SMINTERFACE_MEMORYUTILS_NAME		"IMemoryUtils"
    25 #define SMINTERFACE_MEMORYUTILS_VERSION		1
    26 
    27 namespace SourceMod
    28 {
    29 	class IMemoryUtils : public SMInterface
    30 	{
    31 	public:
    32 		const char *GetInterfaceName()
    33 		{
    34 			return SMINTERFACE_MEMORYUTILS_NAME;
    35 		}
    36 		unsigned int GetInterfaceVersion()
    37 		{
    38 			return SMINTERFACE_MEMORYUTILS_VERSION;
    39 		}
    40 	public:
    41 		/**
    42 		 * @brief Searches for a pattern of bytes within the memory of a dynamic library.
    43 		 *
    44 		 * @param libPtr	Pointer to any chunk of memory that resides in the dynamic library.
    45 		 * @param pattern	Pattern of bytes to search for. 0x2A can be used as a wildcard.
    46 		 * @param len		Size of the pattern in bytes.
    47 		 * @return			Pointer to pattern found in memory, NULL if not found.
    48 		 */
    49 		virtual void *FindPattern(const void *libPtr, const char *pattern, size_t len) =0;
    50 	};
    51 }
    52 
    53 #endif // _INCLUDE_SOURCEMOD_INTERFACE_MEMORYUTILS_H_