3 * ===============================================================
4 * SourceMod, Copyright (C) 2004-2007 AlliedModders LLC.
6 * ===============================================================
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.
14 * To view the latest information, see: http://www.sourcemod.net/license.php
19 #ifndef _INCLUDE_SOURCEMOD_INTERFACE_BINARYUTILS_H_
20 #define _INCLUDE_SOURCEMOD_INTERFACE_BINARYUTILS_H_
22 #include <IShareSys.h>
24 #define SMINTERFACE_MEMORYUTILS_NAME "IMemoryUtils"
25 #define SMINTERFACE_MEMORYUTILS_VERSION 1
29 class IMemoryUtils : public SMInterface
32 const char *GetInterfaceName()
34 return SMINTERFACE_MEMORYUTILS_NAME;
36 unsigned int GetInterfaceVersion()
38 return SMINTERFACE_MEMORYUTILS_VERSION;
42 * @brief Searches for a pattern of bytes within the memory of a dynamic library.
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.
49 virtual void *FindPattern(const void *libPtr, const char *pattern, size_t len) =0;
53 #endif // _INCLUDE_SOURCEMOD_INTERFACE_MEMORYUTILS_H_