core/MemoryUtils.h
author Borja Ferrer <faluco@alliedmods.net>
Thu Jul 05 14:47:36 2007 +0000 (2007-07-05)
changeset 1041 f7b2073013df
parent 702 ff520b71249c
child 1231 17badaf66ce4
permissions -rw-r--r--
added a time stamp argument to FormatTime
ds@700
     1
/**
ds@700
     2
 * vim: set ts=4 :
ds@700
     3
 * ===============================================================
ds@700
     4
 * SourceMod (C)2004-2007 AlliedModders LLC.  All rights reserved.
ds@700
     5
 * ===============================================================
ds@700
     6
 *
ds@700
     7
 * This file is not open source and may not be copied without explicit
ds@700
     8
 * written permission of AlliedModders LLC.  This file may not be redistributed 
ds@700
     9
 * in whole or significant part.
ds@700
    10
 * For information, see LICENSE.txt or http://www.sourcemod.net/license.php
ds@700
    11
 *
ds@700
    12
 * Version: $Id$
ds@700
    13
 */
ds@700
    14
ds@700
    15
#ifndef _INCLUDE_SOURCEMOD_MEMORYUTILS_H_
ds@700
    16
#define _INCLUDE_SOURCEMOD_MEMORYUTILS_H_
ds@700
    17
ds@700
    18
#include <IMemoryUtils.h>
ds@702
    19
#include "sm_globals.h"
ds@700
    20
ds@700
    21
using namespace SourceMod;
ds@700
    22
ds@700
    23
struct DynLibInfo
ds@700
    24
{
ds@700
    25
	void *baseAddress;
ds@700
    26
	size_t memorySize;
ds@700
    27
};
ds@700
    28
ds@702
    29
class MemoryUtils : 
ds@702
    30
	public IMemoryUtils,
ds@702
    31
	public SMGlobalClass
ds@700
    32
{
ds@702
    33
public: // SMGlobalClass
ds@702
    34
	void OnSourceModAllInitialized();
ds@702
    35
public: // IMemoryUtils
ds@701
    36
	void *FindPattern(const void *libPtr, const char *pattern, size_t len);
ds@700
    37
private:
ds@701
    38
	bool GetLibraryInfo(const void *libPtr, DynLibInfo &lib);
ds@700
    39
};
ds@700
    40
ds@700
    41
extern MemoryUtils g_MemUtils;
ds@700
    42
ds@700
    43
#endif // _INCLUDE_SOURCEMOD_MEMORYUTILS_H_