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