SourceMod SDK  1.7
SourceMod::IMemoryUtils Class Referenceabstract
Inheritance diagram for SourceMod::IMemoryUtils:
SourceMod::SMInterface

Public Member Functions

const char * GetInterfaceName ()
 Must return a string defining the interface's unique name.
 
unsigned int GetInterfaceVersion ()
 Must return an integer defining the interface's version.
 
virtual void * FindPattern (const void *libPtr, const char *pattern, size_t len)=0
 Searches for a pattern of bytes within the memory of a dynamic library. More...
 
virtual void * ResolveSymbol (void *handle, const char *symbol)=0
 Retrieves a symbol pointer from a dynamic library. More...
 
- Public Member Functions inherited from SourceMod::SMInterface
virtual bool IsVersionCompatible (unsigned int version)
 Must return whether the requested version number is backwards compatible. Note: This can be overridden for breaking changes or custom versioning. More...
 

Member Function Documentation

virtual void* SourceMod::IMemoryUtils::FindPattern ( const void *  libPtr,
const char *  pattern,
size_t  len 
)
pure virtual

Searches for a pattern of bytes within the memory of a dynamic library.

Parameters
libPtrPointer to any chunk of memory that resides in the dynamic library.
patternPattern of bytes to search for. 0x2A can be used as a wildcard.
lenSize of the pattern in bytes.
Returns
Pointer to pattern found in memory, NULL if not found.
virtual void* SourceMod::IMemoryUtils::ResolveSymbol ( void *  handle,
const char *  symbol 
)
pure virtual

Retrieves a symbol pointer from a dynamic library.

Note: On Linux and Mac OS X, this function is able to resolve symbols that are hidden via GCC's -fvisibility=hidden option.

Note: On Mac OS X, the symbol name should be passed without the prepended underscore, as this is how dlsym() would expect it.

Parameters
handleOperating system specific handle that points to dynamic library. This comes from dlopen() on Linux/OS X or LoadLibrary() on Windows.
symbolSymbol name.
Returns
Symbol pointer, or NULL if not found.

The documentation for this class was generated from the following file: