ds@700: /** ds@700: * vim: set ts=4 : ds@700: * =============================================================== ds@700: * SourceMod, Copyright (C) 2004-2007 AlliedModders LLC. ds@700: * All rights reserved. ds@700: * =============================================================== ds@700: * ds@700: * This file is part of the SourceMod/SourcePawn SDK. This file may only be ds@700: * used or modified under the Terms and Conditions of its License Agreement, ds@700: * which is found in public/licenses/LICENSE.txt. As of this notice, derivative ds@700: * works must be licensed under the GNU General Public License (version 2 or ds@700: * greater). A copy of the GPL is included under public/licenses/GPL.txt. ds@700: * ds@700: * To view the latest information, see: http://www.sourcemod.net/license.php ds@700: * ds@700: * Version: $Id$ ds@700: */ ds@700: ds@700: #ifndef _INCLUDE_SOURCEMOD_INTERFACE_BINARYUTILS_H_ ds@700: #define _INCLUDE_SOURCEMOD_INTERFACE_BINARYUTILS_H_ ds@700: ds@700: #include ds@700: ds@700: #define SMINTERFACE_MEMORYUTILS_NAME "IMemoryUtils" ds@700: #define SMINTERFACE_MEMORYUTILS_VERSION 1 ds@700: ds@700: namespace SourceMod ds@700: { ds@700: class IMemoryUtils : public SMInterface ds@700: { ds@700: public: ds@700: const char *GetInterfaceName() ds@700: { ds@700: return SMINTERFACE_MEMORYUTILS_NAME; ds@700: } ds@700: unsigned int GetInterfaceVersion() ds@700: { ds@700: return SMINTERFACE_MEMORYUTILS_VERSION; ds@700: } ds@700: public: ds@700: /** ds@700: * @brief Searches for a pattern of bytes within the memory of a dynamic library. ds@700: * ds@700: * @param libPtr Pointer to any chunk of memory that resides in the dynamic library. ds@700: * @param pattern Pattern of bytes to search for. 0x2A can be used as a wildcard. ds@700: * @param len Size of the pattern in bytes. ds@700: * @return Pointer to pattern found in memory, NULL if not found. ds@700: */ ds@701: virtual void *FindPattern(const void *libPtr, const char *pattern, size_t len) =0; ds@700: }; ds@700: } ds@700: ds@700: #endif // _INCLUDE_SOURCEMOD_INTERFACE_MEMORYUTILS_H_