<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alliedmods.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mrmagu</id>
	<title>AlliedModders Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alliedmods.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mrmagu"/>
	<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/Special:Contributions/Mrmagu"/>
	<updated>2026-06-13T02:06:54Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.6</generator>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=Installing_Metamod:Source&amp;diff=2473</id>
		<title>Installing Metamod:Source</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=Installing_Metamod:Source&amp;diff=2473"/>
		<updated>2006-01-24T22:29:17Z</updated>

		<summary type="html">&lt;p&gt;Mrmagu: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article will guide you through a [[SourceMM]] installation.&lt;br /&gt;
&lt;br /&gt;
If you don't already have Metamod:Source bundled with a plugin, you can install it manually with the directions below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Download''' the appropriate package for your server: there is a Linux tarball and Windows zip file.  You can get this from the [http://www.sourcemm.net/ SourceMM Website].&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Open''' the package, you will either have &amp;quot;server_i486.so&amp;quot; or &amp;quot;server.dll&amp;quot;.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Find '''your &amp;quot;mod folder&amp;quot; on your server. This will be something like &amp;quot;cstrike&amp;quot; or &amp;quot;hl2mp&amp;quot;.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Make''' a folder in your mod folder called &amp;quot;addons&amp;quot;, if it doesn't already exist.  Make a folder inside addons called &amp;quot;metamod&amp;quot;, and a folder inside &amp;quot;metamod&amp;quot; called &amp;quot;bin&amp;quot;.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Create''' a new, blank, text file called &amp;quot;metaplugins.ini&amp;quot;.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Upload''' the files to your server:&lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;Upload the server.dll or server_i486.so file to your addons/metamod/bin Folder.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Upload the metaplugins.ini file to your addons/metamod folder.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;WARNING! - Do not replace the mod's server.dll/server_i486.so (usually in &amp;quot;&amp;lt;mod&amp;gt;\bin&amp;quot;). This will cause your mod to stop working.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Open''' the file in the mod folder called &amp;quot;gameinfo.txt&amp;quot;. You will see a few lines at the bottom like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SearchPaths&lt;br /&gt;
{&lt;br /&gt;
	Game				|gameinfo_path|. &lt;br /&gt;
	Game				cstrike&lt;br /&gt;
	Game				hl2&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Add''' a line before all of the &amp;quot;Game&amp;quot; entries that looks like this:&amp;lt;pre&amp;gt;GameBin				|gameinfo_path|addons/metamod/bin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''You're''' done! To test whether it worked, restart your game server and type &amp;quot;meta&amp;quot; in the [[server console]]. You should get a menu.&lt;br /&gt;
&amp;lt;li&amp;gt;'''For''' more information, documentation, and troubleshooting, see [[:Category:Documentation (SourceMM)]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Optional''' Cvars:&lt;br /&gt;
&amp;lt;tt&amp;gt;mm_pluginsfile&amp;lt;/tt&amp;gt; - Sets the path and name of the plugins file, defaulting to &amp;quot;addons/metamod/metaplugins.ini&amp;quot;. It is relative to the mod directory.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation (SourceMM)]]&lt;/div&gt;</summary>
		<author><name>Mrmagu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=User:Mrmagu&amp;diff=2452</id>
		<title>User:Mrmagu</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=User:Mrmagu&amp;diff=2452"/>
		<updated>2006-01-22T23:44:03Z</updated>

		<summary type="html">&lt;p&gt;Mrmagu: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;is a nub :]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr style=&amp;quot;border:0;border-top:1px solid #969696;&amp;quot; /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mrmagu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=User:Mrmagu&amp;diff=2342</id>
		<title>User:Mrmagu</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=User:Mrmagu&amp;diff=2342"/>
		<updated>2006-01-19T20:46:08Z</updated>

		<summary type="html">&lt;p&gt;Mrmagu: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;is a nub :] &amp;lt;span style=&amp;quot;text-decoration:line-through;&amp;quot;&amp;gt;and wants someone to add the damn syntax highlighter extention already :)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
C++ Highlighted test..&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;cpp&amp;gt;&lt;br /&gt;
#ifndef SIGSCAN_H&lt;br /&gt;
#define SIGSCAN_H&lt;br /&gt;
&lt;br /&gt;
// test&lt;br /&gt;
class CSigScan {&lt;br /&gt;
private:&lt;br /&gt;
	/* Private Variables */&lt;br /&gt;
	/* Base Address of the server module in memory */&lt;br /&gt;
	static unsigned char *base_addr;&lt;br /&gt;
	/* The length to the module's ending address */&lt;br /&gt;
	static size_t base_len;&lt;br /&gt;
&lt;br /&gt;
	/* The signature to scan for */&lt;br /&gt;
	unsigned char *sig_str;&lt;br /&gt;
	/* A mask to ignore certain bytes in the signature such as addresses&lt;br /&gt;
	   The mask should be as long as all the bytes in the signature string&lt;br /&gt;
	   Use '?' to ignore a byte and 'x' to check it&lt;br /&gt;
	   Example&amp;quot;xxx????xx&amp;quot; - The first 3 bytes are checked, then the next 4 are&lt;br /&gt;
	   ignored, then the last 2 are checked */&lt;br /&gt;
	char *sig_mask;&lt;br /&gt;
	/* The length of sig_str and sig_mask (not including a terminating null for sig_mask) */&lt;br /&gt;
	size_t sig_len;&lt;br /&gt;
&lt;br /&gt;
	/* Private Functions */&lt;br /&gt;
	void* FindSignature(void);&lt;br /&gt;
&lt;br /&gt;
public:&lt;br /&gt;
	/* Public Variables */&lt;br /&gt;
&lt;br /&gt;
	/* sigscan_dllfunc is a pointer of something that resides inside the gamedll so we can get&lt;br /&gt;
	   the base address of it. From a SourceMM plugin, just set this to ismm-&amp;gt;serverFactory(0)&lt;br /&gt;
	   in Load(). From a Valve Server Plugin, you must set this to an actual factory returned&lt;br /&gt;
	   from gameServerFactory and hope that a SourceMM plugin did not override it. */&lt;br /&gt;
	static void *(*sigscan_dllfunc)(const char *pName, int *pReturnCode);&lt;br /&gt;
&lt;br /&gt;
	/* If the scan was successful or not */&lt;br /&gt;
	char is_set;&lt;br /&gt;
	/* Starting address of the found function */&lt;br /&gt;
	void *sig_addr;&lt;br /&gt;
&lt;br /&gt;
	/* Public Functions */&lt;br /&gt;
	CSigScan(void)sig_str(NULL), sig_mask(NULL), sig_len(0), sig_addr(NULL) {}&lt;br /&gt;
	~CSigScan(void);&lt;br /&gt;
&lt;br /&gt;
	static bool GetDllMemInfo(void);&lt;br /&gt;
	void Init(unsigned char *sig, char *mask, size_t len);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void InitSigs(void);&lt;br /&gt;
&lt;br /&gt;
/* Sig Functions */&lt;br /&gt;
class CBaseAnimating;&lt;br /&gt;
void CBaseAnimating_Ignite(CBaseAnimating *cba, float flFlameLifetime);&lt;br /&gt;
&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/cpp&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mrmagu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=User:Mrmagu&amp;diff=2340</id>
		<title>User:Mrmagu</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=User:Mrmagu&amp;diff=2340"/>
		<updated>2006-01-19T20:10:22Z</updated>

		<summary type="html">&lt;p&gt;Mrmagu: highlight test&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;is a nub :] and wants someone to add the damn syntax highlighter extention already :)&lt;br /&gt;
&lt;br /&gt;
C++ Highlighted test..&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;cpp&amp;gt;&lt;br /&gt;
#ifndef SIGSCAN_H&lt;br /&gt;
#define SIGSCAN_H&lt;br /&gt;
&lt;br /&gt;
// test&lt;br /&gt;
class CSigScan {&lt;br /&gt;
private:&lt;br /&gt;
	/* Private Variables */&lt;br /&gt;
	/* Base Address of the server module in memory */&lt;br /&gt;
	static unsigned char *base_addr;&lt;br /&gt;
	/* The length to the module's ending address */&lt;br /&gt;
	static size_t base_len;&lt;br /&gt;
&lt;br /&gt;
	/* The signature to scan for */&lt;br /&gt;
	unsigned char *sig_str;&lt;br /&gt;
	/* A mask to ignore certain bytes in the signature such as addresses&lt;br /&gt;
	   The mask should be as long as all the bytes in the signature string&lt;br /&gt;
	   Use '?' to ignore a byte and 'x' to check it&lt;br /&gt;
	   Example&amp;quot;xxx????xx&amp;quot; - The first 3 bytes are checked, then the next 4 are&lt;br /&gt;
	   ignored, then the last 2 are checked */&lt;br /&gt;
	char *sig_mask;&lt;br /&gt;
	/* The length of sig_str and sig_mask (not including a terminating null for sig_mask) */&lt;br /&gt;
	size_t sig_len;&lt;br /&gt;
&lt;br /&gt;
	/* Private Functions */&lt;br /&gt;
	void* FindSignature(void);&lt;br /&gt;
&lt;br /&gt;
public:&lt;br /&gt;
	/* Public Variables */&lt;br /&gt;
&lt;br /&gt;
	/* sigscan_dllfunc is a pointer of something that resides inside the gamedll so we can get&lt;br /&gt;
	   the base address of it. From a SourceMM plugin, just set this to ismm-&amp;gt;serverFactory(0)&lt;br /&gt;
	   in Load(). From a Valve Server Plugin, you must set this to an actual factory returned&lt;br /&gt;
	   from gameServerFactory and hope that a SourceMM plugin did not override it. */&lt;br /&gt;
	static void *(*sigscan_dllfunc)(const char *pName, int *pReturnCode);&lt;br /&gt;
&lt;br /&gt;
	/* If the scan was successful or not */&lt;br /&gt;
	char is_set;&lt;br /&gt;
	/* Starting address of the found function */&lt;br /&gt;
	void *sig_addr;&lt;br /&gt;
&lt;br /&gt;
	/* Public Functions */&lt;br /&gt;
	CSigScan(void)sig_str(NULL), sig_mask(NULL), sig_len(0), sig_addr(NULL) {}&lt;br /&gt;
	~CSigScan(void);&lt;br /&gt;
&lt;br /&gt;
	static bool GetDllMemInfo(void);&lt;br /&gt;
	void Init(unsigned char *sig, char *mask, size_t len);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
void InitSigs(void);&lt;br /&gt;
&lt;br /&gt;
/* Sig Functions */&lt;br /&gt;
class CBaseAnimating;&lt;br /&gt;
void CBaseAnimating_Ignite(CBaseAnimating *cba, float flFlameLifetime);&lt;br /&gt;
&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/cpp&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mrmagu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=Metamod:Source&amp;diff=2315</id>
		<title>Metamod:Source</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=Metamod:Source&amp;diff=2315"/>
		<updated>2006-01-17T23:46:49Z</updated>

		<summary type="html">&lt;p&gt;Mrmagu: /* Documentation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;:{{owned_project}}&lt;br /&gt;
==Introduction==&lt;br /&gt;
Metamod:Source is an API manager and interception handler that sits in between the Half-Life 2 Engine (Source) and a subsequent Game Modification (MOD). It can dynamically load &amp;quot;SourceMM Plugins&amp;quot;, written in C++, to intercept, override, and hook Engine and GameDLL API interfaces. It also allows for inter-plugin communication.  As a backend it contains [[SourceHook]], a powerful library for safely manipulating virtual table hooks.&lt;br /&gt;
&lt;br /&gt;
[[Category:Half-Life 2]]&lt;br /&gt;
[[Category:SourceMM]]&lt;br /&gt;
&lt;br /&gt;
==Naming Conventions==&lt;br /&gt;
Metamod:Source refers to the overall product and concept behind SourceMM.  SourceMM is the actual implementation and codebase.  For practical purposes the names are interchangeable, however, &amp;quot;Metamod:Source&amp;quot; is preferred for public relations/marketing purposes and SourceMM is preferred for programming purposes.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
Metamod:Source is derived from the [[Metamod]] concept of intercepting calls between a game's engine and mod library.  While not based on the same code, the API is designed to be similar and familiar to [[Half-Life 1]] programmers.&lt;br /&gt;
&lt;br /&gt;
====SourceMod Core1====&lt;br /&gt;
Initially, the [[SourceMod]] project was started as the next-generation continuation of the [[AMX Mod X]] project.  It was designed to be a meta-interface layer for inter-communicating plugins.  However, as development continued, it was soon realized that the [[Valve Server Plugin]] interface would not be sufficient to provide proper engine access.&lt;br /&gt;
&lt;br /&gt;
[[User:PM|Pavol Marko]] (core1 developer) decided to add &amp;quot;SourceHook&amp;quot; to SourceMod core1.  It was embedded as a large library for hooking specific virtual table functions.  After multiple revisions (see [[SourceHook]] history), it became apparent that 1)SourceHook needed to be game and interface generic, and 2)SourceMod and SourceHook needed to be split into two separate projects.  The logic behind this was that SourceHook needed to be a layer above [[Valve Server Plugins]], in order to properly manage hooks with the least possibility of conflicts.  Furthermore, SourceMod should be a plugin to the SourceHook interface, rather than managing it.  This decision can be likened to [[Admin-Mod]]'s early decision to split into the first [[Metamod]] project.&lt;br /&gt;
&lt;br /&gt;
====SourceHook Finalized====&lt;br /&gt;
After four major revisions, [[SourceHook]] was mature enough to be used in a production environment.  While [[User:PM|PM]] concentrated on fleshing out [[SourceHook]], [[User:BAILOPAN|BAILOPAN]] and [[User::Damaged Soul|DS]] created the GameDLL wrapper portion.&lt;br /&gt;
&lt;br /&gt;
====Version 1.0====&lt;br /&gt;
On May 6, 2005, Metamod:Source 1.0 was released with SourceHook v4.1 as a backend.  GameDLL wrapping was achieved by providing the engine with fake copies of the IServerGame* interfaces.  Once the true GameDLL location was known it would be loaded by SourceMM.  The fake interface then directly wrapped calls to the real GameDLL.&lt;br /&gt;
&lt;br /&gt;
====Version 1.1====&lt;br /&gt;
On October 21, 2005, the first major revision of SourceMM was released, featuring SourceHook v4.4, internal event listeners, dropped reliance on STL, and rewritten GameDLL hooking code.  The [[Day of Defeat|Day of Defeat:Source]] release by [[Valve Software]] revealed that the binary interface between the engine and mod wasn't necessarily public or current, and SourceMM's detection was improved for compatibility and speed.  Furthermore, SourceMM stopped wrapping the GameDLL interfaces and began using SourceHook to hook them.  &lt;br /&gt;
&lt;br /&gt;
====Version 1.2====&lt;br /&gt;
On January 7th, 2006, SourceMM was updated for SourceHook v4.5, but received no major API changes.&lt;br /&gt;
&lt;br /&gt;
==Design Considerations==&lt;br /&gt;
====Metamod====&lt;br /&gt;
Originally, SourceMM was a plugin co-existing with SourceMod.  However, there are factories, pointers, and certain capabilities not possible from a [[Valve Server Plugin]].  Furthermore, the [[Half-Life 2]] engine does not properly unload VSPs, making debugging and resource unloading more difficult.  Eventually it was decided the added functionality and fine-tuned control outweighed the extra cost of having to configure an intercepting binary.&lt;br /&gt;
&lt;br /&gt;
====Plugins====&lt;br /&gt;
Plugins are specific to Metamod:Source.  This means that [[Valve Server Plugins]] and [[SourceMM Plugins]] are entirely separate in the API characteristics.  While it is certainly possible to expose the necessary interfaces to VSPs, it creates an added layer of complexity for dealing with things that SourceMM might not directly control.  For example, when a SourceMM plugin is removed at runtime, all of the necessary hooks are also removed.  A VSP has no clear callback for detecting this event, therefore it would be more difficult to ensure proper unloading.  VSP and SMM plugins also have different ways of attaching and detaching server [[Cvars|cvars]] and [[Console commands|concmds]].&lt;br /&gt;
&lt;br /&gt;
By keeping the plugin system isolated, SourceMM can also provide a unique set of console commands and API.  For example, plugins can listen for certain Metamod:Source-specific events and provide communication channels with other plugins.&lt;br /&gt;
&lt;br /&gt;
====Hooking====&lt;br /&gt;
SourceMM is powered by [[SourceHook]], a versatile library for hooking virtual functions.  The original [[Half-Life 1]] engine used structs of function pointers which could easily be modified as they passed from one library to another.  However, HL2 is comprised almost entirely of pure virtual interfaces.  SourceHook was designed for declaring single hooks against a given virtual function and a this pointer, which is not only faster than a blanket hooking system like Metamod's, but more flexible and precise.&lt;br /&gt;
&lt;br /&gt;
Hooking under SourceMM has a number of features that don't exist in a hooking system style like Metamod's, and it achieves something closer to [[Detours|detours]], rather than Metamod, which is hardcoded.  For example&lt;br /&gt;
*You can change parent parameters during a hooked call&lt;br /&gt;
*You can hook member functions, both by a pre-existing declaration or given vtable offset&lt;br /&gt;
*You can call the original function and still fire its associated hooks, or you can call it without firing hooks in order to prevent infinite recursion&lt;br /&gt;
&lt;br /&gt;
==Documentation==&lt;br /&gt;
For more information on installing, configuring, and coding for SourceMM, see [[:Category:Documentation (SourceMM)|Documentation]].&lt;br /&gt;
&lt;br /&gt;
==The Future==&lt;br /&gt;
While SourceMM is a stable/production product, more features are on the horizon.  There are distant plans for a [[Detours|detouring]] library and a library for efficiently automated [[Signature Scanning|signature scanning]].&lt;br /&gt;
&lt;br /&gt;
==License==&lt;br /&gt;
SourceMM is licensed under the [[zLib/libpng License]].  It is free to use for both open-source and proprietary projects.&lt;br /&gt;
&lt;br /&gt;
==External Links==&lt;br /&gt;
*[http://www.sourcemm.net/ Metamod:Source Website]&lt;br /&gt;
*[http://www.metamod.org/ Metamod Website]&lt;br /&gt;
*[http://www.sourcemod.net/ SourceMod Website]&lt;/div&gt;</summary>
		<author><name>Mrmagu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=Sample_Plugins_(Metamod:Source)&amp;diff=2305</id>
		<title>Sample Plugins (Metamod:Source)</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=Sample_Plugins_(Metamod:Source)&amp;diff=2305"/>
		<updated>2006-01-17T17:39:02Z</updated>

		<summary type="html">&lt;p&gt;Mrmagu: /* Where to Get */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This guide briefly explains about and how to compile the sample plugins for SourceMM.&lt;br /&gt;
&lt;br /&gt;
=Sample Plugins=&lt;br /&gt;
==stub_mm==&lt;br /&gt;
This plugin is a bare-minimum example of what you need to build a SourceMM plugin. It implements the ISmmPlugin class, exposes it as a DLL, and nothing more. As a single example, it also hooks ServerActivate in IServerGameDLL. &amp;quot;Stub&amp;quot; was designed such that a developer could open it and quickly modify it to begin a plugin.&lt;br /&gt;
&lt;br /&gt;
*meta_hooks.h - Definition of main hooks&lt;br /&gt;
*stub_mm.cpp - Main plugin file and implementation&lt;br /&gt;
*stub_mm.h - Main plugin header&lt;br /&gt;
&lt;br /&gt;
==sample_mm==&lt;br /&gt;
This plugin attempts to recreate all of the functionality a Server Plugin has. Server Plugins receive twelve callbacks, three of which are GameDLL overridable. In order to replicate this functionality, sample_mm hooks eleven of the callbacks as either post or pre handlers. Furthermore, it also demonstrates how to build a CallClass for calling original functions. Every hook produces a log message so you can see when events occur.&lt;br /&gt;
&lt;br /&gt;
Sample_mm fully replicates every callback a Server Plugin is capable of receiving, except for NetworkIDValidated. This callback has no known representation in the engine, is not very useful, and can be replicated easily with GameFrame() (in the future, we might demonstrate this). If you are having trouble porting a Server Plugin over, or are wondering how you can keep the same features, this plugin will show you where to start.&lt;br /&gt;
&lt;br /&gt;
*meta_hooks.h - Definition of main hooks&lt;br /&gt;
*SamplePlugin.cpp - Main plugin file and implementation&lt;br /&gt;
*SamplePLugin.h - Main plugin header&lt;br /&gt;
&lt;br /&gt;
=Where to Get=&lt;br /&gt;
You can find the source code to the sample plugins in either the source code package or [http://www.tcwonline.org/cgi-bin/viewcvs.cgi/sourcemm/ CVS]. They are located in the main source code folder in &amp;quot;stub_mm&amp;quot; and &amp;quot;sample_mm&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=Compiling=&lt;br /&gt;
==Windows==&lt;br /&gt;
These plugins have been compiled and tested with Microsoft Visual Studio 7.1 (.NET 2003). Before you compile, you must have these directories in your include options. To set these, go to Tools, Options, Projects, VC++ Directories.&lt;br /&gt;
&lt;br /&gt;
*From the Include Files menu, add these HL2SDK paths:&lt;br /&gt;
**public&lt;br /&gt;
**public/dlls&lt;br /&gt;
**public/engine&lt;br /&gt;
**public/tier0&lt;br /&gt;
**public/tier1&lt;br /&gt;
**public/vstdlib&lt;br /&gt;
**tier1&lt;br /&gt;
*From the Library Files menu, add these HL2SDK paths:&lt;br /&gt;
**lib/public&lt;br /&gt;
*From the Include Files menu, add these SourceMM paths:&lt;br /&gt;
**sourcemm&lt;br /&gt;
**sourcemm/sourcehook&lt;br /&gt;
**sourcemm/sourcemm&lt;br /&gt;
&lt;br /&gt;
You can then open the .vcproj project file. Go to Build, Set Active Configuration, and select Release. You can then select Build from the Build menu, which will produce a .dll file in the Release folder in the project folder.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
To build on Linux, you must have a copy of Source Dedicated Server installed. Open the project Makefile and edit the following lines at the top:&lt;br /&gt;
&lt;br /&gt;
*SRCDS - Location of main srcds installation&lt;br /&gt;
*SMM_ROOT - Location of folder containing sourcemm and sourcehook&lt;br /&gt;
*HL2SDK - Location of HL2SDK&lt;br /&gt;
&lt;br /&gt;
Once done, you can just type &amp;quot;make&amp;quot; to run the build scripts. The binary will appear in ./Release/. &lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation (SourceMM)]]&lt;/div&gt;</summary>
		<author><name>Mrmagu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=Installing_Metamod:Source&amp;diff=2304</id>
		<title>Installing Metamod:Source</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=Installing_Metamod:Source&amp;diff=2304"/>
		<updated>2006-01-17T17:32:13Z</updated>

		<summary type="html">&lt;p&gt;Mrmagu: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article will guide you through a [[SourceMM]] installation.&lt;br /&gt;
&lt;br /&gt;
If you don't already have Metamod:Source bundled with a plugin, you can install it manually with the directions below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Download''' the appropriate package for your server: there is a Linux tarball and Windows zip file.  You can get this from the [http://www.sourcemm.net/ SourceMM Website].&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Open''' the package, you will either have &amp;quot;server_i486.so&amp;quot; or &amp;quot;server.dll&amp;quot;.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Find '''your &amp;quot;mod folder&amp;quot; on your server. This will be something like &amp;quot;cstrike&amp;quot; or &amp;quot;hl2mp&amp;quot;.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Make''' a folder in your mod folder called &amp;quot;addons&amp;quot;, if it doesn't already exist.  Make a folder inside addons called &amp;quot;metamod&amp;quot;, and a folder inside &amp;quot;metamod&amp;quot; called &amp;quot;bin&amp;quot;.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Create''' a new, blank, text file called &amp;quot;metaplugins.ini&amp;quot;.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Upload''' the files to your server:&lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;Upload the server.dll or server_i486.so file to your addons/metamod/bin Folder.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Upload the metaplugins.ini file to your addons/metamod folder.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;WARNING! - Do not replace the mod's server.dll/server_i486.so (usually in &amp;quot;&amp;lt;mod&amp;gt;\bin&amp;quot;). This will cause your mod to stop working.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Open''' the file in the mod folder called &amp;quot;gameinfo.txt&amp;quot;. You will see a few lines at the bottom like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SearchPaths&lt;br /&gt;
{&lt;br /&gt;
	Game				|gameinfo_path|. &lt;br /&gt;
	Game				cstrike&lt;br /&gt;
	Game				hl2&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Add''' a line before all of the &amp;quot;Game&amp;quot; entries that looks like this:&amp;lt;pre&amp;gt;GameBin				|gameinfo_path|addons/metamod/bin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''You're''' done! To test whether it worked, restart your game server and type &amp;quot;meta&amp;quot; in the [[server console]]. You should get a menu.&lt;br /&gt;
&amp;lt;li&amp;gt;'''For''' more information, documentation, and troubleshooting, see [[:Category:Documentation (SourceMM)]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;'''Optional''' Cvars:&lt;br /&gt;
&amp;lt;tt&amp;gt;mm_pluginsfile&amp;lt;/tt&amp;gt; - Sets the path and name of the plugins file, defaulting to &amp;quot;addons/metamod/plugins.ini&amp;quot;. It is relative to the mod directory.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation (SourceMM)]]&lt;/div&gt;</summary>
		<author><name>Mrmagu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=Metamod:Source_Development&amp;diff=2298</id>
		<title>Metamod:Source Development</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=Metamod:Source_Development&amp;diff=2298"/>
		<updated>2006-01-17T12:25:35Z</updated>

		<summary type="html">&lt;p&gt;Mrmagu: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article is an introduction to [[SourceMM]] coding.  &lt;br /&gt;
&lt;br /&gt;
{{qnotice|The majority of this documentation should be merged or moved into an article about [[SourceHook]].}}&lt;br /&gt;
&lt;br /&gt;
{{qnotice|This article probably needs some better formatting.}}&lt;br /&gt;
&lt;br /&gt;
=Requirements=&lt;br /&gt;
You must have the Valve [[HL2SDK]], available from your [[Steam]] Menu. For Windows, you must have [[Microsoft Visual Studio]] 7.0 or 7.1 (we have not tried 6.0). For [[Linux]], Valve requires you use at least [[GCC]] 3.4.1. You should also have a copy of the [[Metamod:Source]] source code (sourcemm/sourcehook and sourcemm/sourcemm).&lt;br /&gt;
&lt;br /&gt;
For [[Microsoft Visual Studio]], you should make sure that you have the following HL2SDK paths in your include settings (Tools -&amp;gt; Options -&amp;gt; Projects, VC++ Directories, Include Files), as well as the &amp;quot;sourcehook&amp;quot; and &amp;quot;sourcemm&amp;quot; folders:&lt;br /&gt;
*dlls&lt;br /&gt;
*public&lt;br /&gt;
*public\vsdtlib&lt;br /&gt;
*public\tier1&lt;br /&gt;
*public\tier0&lt;br /&gt;
*public\engine&lt;br /&gt;
*public\dlls&lt;br /&gt;
*tier1&lt;br /&gt;
*lib\public (this should be in your Library Paths!)&lt;br /&gt;
&lt;br /&gt;
=Plugin API=&lt;br /&gt;
In order to write a plugin, you must implement the ISmmPlugin interface, similar to IServerPluginCallbacks. Each Metamod:Source release has a minimum required interface version and a current version. The minimum version is guaranteed to be upward compatible to the current, however, it may be lacking some features.&lt;br /&gt;
&lt;br /&gt;
Once you've implemented the interface, you must also have a global singleton of your plugin available. There are a few macros to assist you in properly exposing the interface as a DLL and setting up the API states.&lt;br /&gt;
&lt;br /&gt;
*{{bcode|PLUGIN_GLOBALVARS}}() - Place in header. Declares the global variables that some API calls require (such as g_SHPtr and g_PLAPI).&lt;br /&gt;
*{{bcode|PLUGIN_EXPOSE}}(class, singleton) - Place in .cpp file. Declares the external CreateInterface function which exposes the API.&lt;br /&gt;
*{{bcode|PLUGIN_SAVEVARS}}() - Use first thing in ISmmPlugin::Load(), saves the global variables sent from SourceMM.&lt;br /&gt;
&lt;br /&gt;
The actual plugin API you must implement as of this writing is version 004. To see a description of each of the functions, you can view the doxygen information here. Note that the Load, Unload, Pause, and Unpause functions allow you to refuse the action and copy an error message (you should check to make sure error is not NULL - it can be).&lt;br /&gt;
&lt;br /&gt;
=SourceHook (Hooking)=&lt;br /&gt;
SourceHook is the engine used to intercept function calls, much like Metamod. The difference with SourceHook is that it can intercept any virtual function in any class that, at compile time, you have the header for. SourceHook has the following steps of operation:&lt;br /&gt;
&lt;br /&gt;
* Declare the prototype of the function you are going to hook. This generates compile-time code that is able to pinpoint exactly how to go about hooking the function.&lt;br /&gt;
* Hook the function - as a member function of another class or a regular static function.&lt;br /&gt;
* Before the hooked function is called, all of the &amp;quot;pre&amp;quot; hook handlers attached to it are called. Each hook can set a special flag, the highest of which is chosen as a final operation. This flag specifies whether the original function should be called or not.&lt;br /&gt;
* Once all the hooks have been called, SourceHook decides whether to call the original function. Another set of hooks are called directly after, called &amp;quot;post&amp;quot; hook handlers. You can specify whether each hook is a post or pre hook - it simply changes whether it's called before or after the original call is made.&lt;br /&gt;
* After you are done using a hook, you can safely remove it.&lt;br /&gt;
&lt;br /&gt;
For example, let's say you wanted to intercept log messages in VEngineServer. Observe the prototype:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
virtual void		LogPrint( const char *msg ) = 0;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is a virtual, public function of a class we have an instance of (let's say in IVEngineServer *m_Engine) and that we have the header for. It can be intercepted.&lt;br /&gt;
&lt;br /&gt;
The first step is to figure out how to declare its prototype to SourceHook. This function is void, and has one parameter. The declaration macro follows these formats:&lt;br /&gt;
&lt;br /&gt;
*{{bcode|SH_DECL_HOOK}}n - n is the number of parameters&lt;br /&gt;
**The parameters are: Class name, member function name, attributes, overloaded?, the return type, and a list of the parameter types.&lt;br /&gt;
*{{bcode|SH_DECL_HOOKn_void}} - n is the number of parameters&lt;br /&gt;
**_void specifies that the function does not return a value. The format is the same as above except the &amp;quot;return type&amp;quot; parameter is missing.&lt;br /&gt;
*'''Note:''' Not covered here are the SH_DECL_HOOKn[_void]_vafmt hooks. These can hook string-formattable variable argument lists. You do not pass the string format or ellipses parameter. SourceHook will automatically format the string for your hook.&lt;br /&gt;
&lt;br /&gt;
Our macro will look like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SH_DECL_HOOK1_void(IVEngineServer, LogPrint, SH_NOATTRIB, 0, const char *);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This line must appear outside of a function. It means &amp;quot;Declare a hook prototype for LogPrint in IVEngineServer, which is a void function that has one parameter, which is a const char *&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Next we must actually hook the function. You can do this wherever you want to begin the interception. The two macros for hooking look like this:&lt;br /&gt;
&lt;br /&gt;
*{{bcode|SH_ADD_HOOK_STATICFUNC}}(class, memberfunction, instance_pointer, handler, post Hooks a virtual function to a static/global function.&lt;br /&gt;
**class - The name of the class&lt;br /&gt;
**memberfunction - The name of the member function&lt;br /&gt;
**instance - A pointer to an instance of the class&lt;br /&gt;
**handler - Your function that will be called on hooking&lt;br /&gt;
**post - true for post operation, false for pre operation&lt;br /&gt;
*{{bcode|SH_ADD_HOOK_MEMFUNC}}(class, memberfunction, instance, myinstance, myfunction, post) Hooks a virtual function to a member function of another class.&lt;br /&gt;
**class - The name of the class&lt;br /&gt;
**memberfunction - The name of the member function&lt;br /&gt;
**instance - An pointer to an instance of the class&lt;br /&gt;
**myinstance - A pointer to an instance of the class that has the handler member function&lt;br /&gt;
**myfunction - The name of the handler member function in your class&lt;br /&gt;
**post - true for post operation, false for pre-operation&lt;br /&gt;
&lt;br /&gt;
Let's continue with the example. To hook LogPrint to a function in your class, CMetaHooks (instance, g_MetaHooks), you would use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SH_ADD_HOOK_MEMFUNC(IVEngineServer, LogPrint, m_Engine, &amp;amp;g_MetaHooks, &amp;amp;CMetaHooks::LogPrint, false);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To remove the hook (either once it will no longer be unused, or at unload time):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SH_REMOVE_HOOK_MEMFUNC(IVEngineServer, LogPrint, m_Engine &amp;amp;g_MetaHooks, &amp;amp;CMetaHooks::LogPrint, false);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now, your function contents will look something like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void CMetaHooks::LogPrint(const char *msg)&lt;br /&gt;
{&lt;br /&gt;
	//Code here&lt;br /&gt;
	RETURN_META(MRES_IGNORED);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note this return statement. This style of returning is similar to Metamod's, where you can set four different flags to indicate how you would like SourceHook to proceed. In Metamod, this return statement was required. In SourceMM, it is only required if you wish to set a return state other than MRES_IGNORED.&lt;br /&gt;
&lt;br /&gt;
*{{bcode|MRES_IGNORED}} - No states were changed, act as though nothing happened. Original function is still called.&lt;br /&gt;
*{{bcode|MRES_HANDLED}} - Something changed, but the original function was still called. This can be used to tell another plugin that you did something.&lt;br /&gt;
*{{bcode|MRES_OVERRIDE}} - The original function will still be called, but your return value will override whatever it returns.&lt;br /&gt;
*{{bcode|MRES_SUPERCEDE}} - The original function is not called, and your return value will be what is returned to the caller.&lt;br /&gt;
&lt;br /&gt;
Note, that if you need to return a value, there is another macro. For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RETURN_META_VALUE(MRES_SUPERCEDE, value);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is required for non-void functions, athough the return value is ignored using MRES_IGNORED or MRES_HANDLED.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can hook to static member functions which has a slightly easier syntax. The DECL_HOOK line does not change. To add the hook:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SH_ADD_HOOK_STATICFUNC(IVEngineServer, LogPrint, m_Engine, LogPrint_handler, false);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Removing the hook:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SH_REMOVE_HOOK_STATICFUNC(IVEngineServer, LogPrint, m_Engine, LogPrint_handler, false);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Declaring the handler:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void LogPrint_handler(const char *msg)&lt;br /&gt;
{&lt;br /&gt;
	//Code here&lt;br /&gt;
	RETURN_META(MRES_IGNORED);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that vafmt functions hooked with SourceHook assume that the vafmt is for a printf style string, and that the vafmt occurs at the end. When setting the parameters, you do not include the '...' notation, and SourceHook will vafmt the input string for you (meaning you also don't specify ... in your hooked function).&lt;br /&gt;
&lt;br /&gt;
=Calling Original Functions=&lt;br /&gt;
Often it will be necessary for you to call a function that's hooked, however, you don't want the hooks to be included in the calling. For example, if you want to entirely supercede a function and call it yourself from within a hook. To do this, you must request a call class. This is similar to MDLL_x() from Metamod for Half-Life 1.&lt;br /&gt;
&lt;br /&gt;
Continuing with the above example, let's say we want to supercede the original call and log a different message. Assume we also have the pointer m_Engine which is a &amp;lt;tt&amp;gt;IVEngineServer *&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CallClass&amp;lt;IVEngineServer&amp;gt; *Engine_CC = SH_GET_CALLCLASS(m_Engine);&lt;br /&gt;
&lt;br /&gt;
SH_CALL(Engine_CC, &amp;amp;IVEngineServer::LogPrint)(&amp;quot;This is a log message!\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
//When you are done with the pointer..&lt;br /&gt;
SH_RELEASE_CALLCLASS(Engine_CC);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because of the complex nature of inheritance, instance pointers, and vtables, this syntax can be quite daunting. You may wish to make macros for specific functions or classes you use quite often, to reduce the amount of typing. For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//Assuming you have a global pointer g_Engine...&lt;br /&gt;
#define ENGCALL(func) SH_CALL(g_Engine, &amp;amp;IVEngineServer::func)&lt;br /&gt;
&lt;br /&gt;
//Then you can do:&lt;br /&gt;
ENGCALL(LogPrint)(&amp;quot;This is a test!&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The syntax of calling class construction is:&lt;br /&gt;
*&amp;lt;tt&amp;gt;CallClass&amp;lt;class&amp;gt; *ptr = SH_GET_CALLCLASS(instance);&amp;lt;/tt&amp;gt;&lt;br /&gt;
**Returns an object which allows you to call the original function. Class is the name of the class which is the target, instance is an instance of that class.&lt;br /&gt;
*&amp;lt;tt&amp;gt;SH_CALL(cc_ptr, &amp;amp;class::func)([params])&amp;lt;/tt&amp;gt;&lt;br /&gt;
**Pass the pointer returned from SH_GET_CALLCLASS as cc_ptr. The target function you call must be passed as a pointer-to-member-function, which takes the form &amp;amp;Class::Function as seen in previous examples. You must then complete the function call by adding a parenthetical parameter expression, even for void functions, which would be (). &lt;br /&gt;
&lt;br /&gt;
=Other Macros=&lt;br /&gt;
All of the macros take g_PLAPI as the first parameter. For more information on this, see the global variables section.&lt;br /&gt;
&lt;br /&gt;
*{{bcode|META_CONPRINT}}(const char *msg)&lt;br /&gt;
*{{bcode|META_CONPRINTF}}(const char *fmt, ...)&lt;br /&gt;
**These two functions are recommended over Msg() for printing to the server console. Msg() does not relay commands back through rcon, and as of this writing Valve does not expose the function which does. To be able to display text through the rcon console (much like HL1), you should use these functions. If SourceMM is unable to extract the function properly, it will automatically default to Msg.&lt;br /&gt;
*{{bcode|META_LOG}}(g_PLAPI, const char *msg, ...)&lt;br /&gt;
**Logs a message through IVEngineServer::LogPrint(). A newline is automatically added, and msg is formatted as a sprintf() style string.&lt;br /&gt;
*{{bcode|META_REGCVAR}}(var)&lt;br /&gt;
**Registers a ConCommandBase pointer through SourceMM. The correct way to use this is to create an IConCommandBaseAccessor, and inside RegisterConCommandBase, call the macro on the given ConComandBase. This will ensure that SourceMM correctly detects and unloads your cvars and concommands at the appopriate time. Otherwise, unloading your plugin will cause a crash.&lt;br /&gt;
*{{bcode|META_UNREGCVAR}}(var)&lt;br /&gt;
**Unregisters a ConCommandBase pointer. This is not needed if you have set up your IConCommandBaseAccessor correctly (and called ConCommandBaseMngr::OneTimeInit()).&lt;br /&gt;
&lt;br /&gt;
=Events System=&lt;br /&gt;
The Events System is based on IMetamodListener. By implementing the IMetamodListener class and using g_SMAPI-&amp;gt;AddListener, you can watch for certain, low-traffic events. These events are split into three categories:&lt;br /&gt;
&lt;br /&gt;
*Plugin Events let you listen for plugin pauses and unloads. This is important if you're relying on information from another plugin, as you can handle cases where a live plugin has become invalid.&lt;br /&gt;
*Game Events are simple events that SourceMM is already hooking and makes available. These are LevelShutdown and LevelInit right now.&lt;br /&gt;
*Query Events occur when a factory is used. The four main factories (Engine, GameDLL, FileSystem, and Physics) are all overridable. You should simply return a non-NULL result to override, and fill the return code with IFACE_OK if available. There is no way to handle the case of two plugins overriding right now. The final factory is the Metamod Factory, which is the factory that Metamod:Source adds to the runtime space for plugins. By default, it only contains the interfaces for the PluginManager and SourceHook. Plugins can use this to add new interfaces. Other plugins request these interfaces through g_SMAPI-&amp;gt;MetaFactory().&lt;br /&gt;
&lt;br /&gt;
=Global Variables=&lt;br /&gt;
These global variables are saved by PLUGIN_EXPOSE and PLUGIN_SAVEVARS. They are declared with PLUGIN_GLOBALVARS.&lt;br /&gt;
&lt;br /&gt;
*{{bcode|g_PLAPI}}&lt;br /&gt;
**ISmmPlugin * pointer to your global class singleton.&lt;br /&gt;
*{{bcode|g_PLID}}&lt;br /&gt;
**The internal PluginId of your plugin.&lt;br /&gt;
*{{bcode|g_SHPtr}}&lt;br /&gt;
**The SourceHook::ISourceHook * pointer to SourceHook's interface.&lt;br /&gt;
*{{bcode|g_SMAPI}}&lt;br /&gt;
**The ISmmAPI * pointer to SourceMM's interface.&lt;br /&gt;
&lt;br /&gt;
=Compiling=&lt;br /&gt;
To see more about compiling, see the Sample Plugin Compiling section.&lt;br /&gt;
&lt;br /&gt;
Modifying the default Makefiles for your own projects:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;tt&amp;gt;OPT_FLAGS&amp;lt;/tt&amp;gt; - Optimization flags&lt;br /&gt;
*&amp;lt;tt&amp;gt;DEBUG_FLAGS&amp;lt;/tt&amp;gt; - Debug flags&lt;br /&gt;
*&amp;lt;tt&amp;gt;CPP&amp;lt;/tt&amp;gt; - C++ Compiler&lt;br /&gt;
*&amp;lt;tt&amp;gt;OBJETS&amp;lt;/tt&amp;gt; - List of C++ files to compile&lt;br /&gt;
*&amp;lt;tt&amp;gt;LINK&amp;lt;/tt&amp;gt; - Linker Options&lt;br /&gt;
*&amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; - Base Compiler Flags&lt;br /&gt;
*&amp;lt;tt&amp;gt;BINARY&amp;lt;/tt&amp;gt; - Output Binary Name&lt;br /&gt;
&lt;br /&gt;
Makefile commands:&lt;br /&gt;
&lt;br /&gt;
*clean - Cleans all build files&lt;br /&gt;
*debug - Builds debug version&lt;br /&gt;
&lt;br /&gt;
=1.1 Changes - Late Loading, Events=&lt;br /&gt;
SourceMM 1.1 changed quite a few things internally, and externally made many breaking changes. These include:&lt;br /&gt;
&lt;br /&gt;
*ISmmPlugin::Load() has removed the factory list parameter (the factory system was replaced with the event system). Also, a boolean parameter was added, specifying whether the plugin was loaded late or not.&lt;br /&gt;
*ISmmPlugin::Load() is now called BEFORE DLLInit(), rather than after. This means it might not have all information it needs -- for example, IGameEvents won't be parsed yet. You will need to do things like this in ISmmPlugin:AllPluginsLoaded() instead, as it is guaranteed to occur when all DLLs are initialized.&lt;br /&gt;
*ISmmPlugin now has default functions -- you don't have to implement all of them.&lt;br /&gt;
*SourceHook was modified to use interfaces rather than straight struct pointers. This breaking changes will ensure that future SourceHook modifications do not break older plugins.&lt;br /&gt;
*SourceHook was modified to be re-entrant.&lt;br /&gt;
*SourceHook now has a tiny template library with it. This removes the necessity to link against libstdc++.so.*, which harms binary compatibility across linux distributions.&lt;br /&gt;
*SourceMM's GameDLL code was completely rewritten. It will now work with newer mods much easier, and issues like the DoD:S release will be much easier to deal with (if at all). It also removes a few important speed bottlenecks.&lt;br /&gt;
*An events system was added.&lt;br /&gt;
&lt;br /&gt;
=1.2 Changes - Changing Parameters, Manual Hooking=&lt;br /&gt;
SourceMM 1.2 now supports changing the parameters in a hook chain. For example, say the GameDLL has a function called IGameDLL::PrintString(const char *str). You can hook this, let it continue, but change the &amp;quot;str&amp;quot; parameter passed in to the rest of the hooks and the GameDLL. To do this, use the following macros:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;tt&amp;gt;RETURN_META_NEWPARAMS&amp;lt;/tt&amp;gt;&lt;br /&gt;
*&amp;lt;tt&amp;gt;RETURN_META_VALUE_NEWPARAMS&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class ISomething&lt;br /&gt;
{&lt;br /&gt;
   virtual void Function1(int num) =0;&lt;br /&gt;
   virtual bool Function2(bool what, int hi) =0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void MyHook1(int num)&lt;br /&gt;
{&lt;br /&gt;
   //if num is 0, &lt;br /&gt;
   // we will change the num parameter in the rest of the hooks, and the gamedll, to be 1.&lt;br /&gt;
   if (num == 0)&lt;br /&gt;
       RETURN_META_NEWPARAMS(MRES_IGNORED, &amp;amp;ISomething::Function1, (1))&lt;br /&gt;
   RETURN_META(MRES_SUPERCEDE);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool MyHook2(bool what, int hi)&lt;br /&gt;
{&lt;br /&gt;
   //change the &amp;quot;what&amp;quot; and &amp;quot;hi&amp;quot; parameters to be false and 3 respectively&lt;br /&gt;
   //also, return true, but specify that the value is ignored&lt;br /&gt;
   RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, true, &amp;amp;ISomething::Function2, (false, 3));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
SourceHook also supports manual hooking of functions. This means you must know the virtual table index, the virtual table offset (for polymorphism), and the &amp;quot;this&amp;quot; pointer offset. Luckily, the polymorphic offsets are usually zero. This type of hook is ideal when supporting different ABI, for example, across different gamedlls. The API is almost identical:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;tt&amp;gt;SH_DECL_MANUALHOOKn[_void|_vafamt]&amp;lt;/tt&amp;gt; -&lt;br /&gt;
**Declares the manual hook. A unique name must be given to each manual hook.&lt;br /&gt;
*&amp;lt;tt&amp;gt;SH_[ADD|REMOVE]_MANUALHOOK_[STATIC|MEM]FUNC&amp;lt;/tt&amp;gt; -&lt;br /&gt;
**Adds or removes a static or member function hook on a manually declared hook.&lt;br /&gt;
*&amp;lt;tt&amp;gt;SH_MANUALHOOK_RECONFIGURE&amp;lt;/tt&amp;gt; - &lt;br /&gt;
**Reconfigures the indexes and offsets of a manual hook.&lt;br /&gt;
&lt;br /&gt;
An example is below, using the ISomething class from above.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SH_DECL_MANUALHOOK2(_M_Function1, 1, 0, 0, bool, bool, int);&lt;br /&gt;
&lt;br /&gt;
void OnLoad(ISomething *pSomething)&lt;br /&gt;
{&lt;br /&gt;
	//we reference the static function by its unique handle we gave it&lt;br /&gt;
	//the parameters are otherwise the same - this pointer, hook handler, and post/non-post&lt;br /&gt;
	SH_ADD_MANUALHOOK_STATICFUNC(_M_Function1, pSomething, MyHook1, false);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void OnUnload(ISomething *pSomething)&lt;br /&gt;
{&lt;br /&gt;
	SH_REMOVE_MANUALHOOK_STATICFUNC(_M_Function1, pSomething, MyHook1, false);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more examples of the above features, you can look in SourceHook CVS's [http://www.tcwonline.org/cgi-bin/viewcvs.cgi/sourcemm/sourcehook/test/ test suite], which demonstrates a variety of hooking scenarios.&lt;br /&gt;
&lt;br /&gt;
[[Category:SourceHook]]&lt;br /&gt;
[[Category:Documentation (SourceMM)]]&lt;/div&gt;</summary>
		<author><name>Mrmagu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=User:Mrmagu&amp;diff=2295</id>
		<title>User:Mrmagu</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=User:Mrmagu&amp;diff=2295"/>
		<updated>2006-01-17T11:52:23Z</updated>

		<summary type="html">&lt;p&gt;Mrmagu: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;is a nub :] and wants someone to add the damn syntax highlighter extention already :)&lt;br /&gt;
&lt;br /&gt;
C++ Highlighted test..&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#a020f0&amp;quot;&amp;gt;#ifndef SIGSCAN_H&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#a020f0&amp;quot;&amp;gt;#define SIGSCAN_H&amp;lt;/font&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;class&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; CSigScan {&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#804040&amp;quot;&amp;gt;&amp;lt;b&amp;gt;private&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;:&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;/*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt; Private Variables &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;*/&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;/*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt; Base Address of the server module in memory &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;*/&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;static&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;unsigned&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;char&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; *base_addr;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;/*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt; The length to the module's ending address &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;*/&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;static&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;size_t&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; base_len;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;/*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt; The signature to scan for &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;*/&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;unsigned&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;char&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; *sig_str;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;/*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt; A mask to ignore certain bytes in the signature such as addresses&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;      The mask should be as long as all the bytes in the signature string&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;      Use '?' to ignore a byte and 'x' to check it&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;      Example&amp;amp;quot;xxx????xx&amp;amp;quot; - The first 3 bytes are checked, then the next 4 are&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;      ignored, then the last 2 are checked &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;*/&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;char&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; *sig_mask;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;/*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt; The length of sig_str and sig_mask (not including a terminating null for sig_mask) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;*/&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;size_t&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; sig_len;&amp;lt;br/&amp;gt;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;/*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt; Private Functions &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;*/&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;void&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;* FindSignature(&amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;void&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;);&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#804040&amp;quot;&amp;gt;&amp;lt;b&amp;gt;public&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;:&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;/*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt; Public Variables &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;*/&amp;lt;/font&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;/*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt; sigscan_dllfunc is a pointer of something that resides inside the gamedll so we can get&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;      the base address of it. From a SourceMM plugin, just set this to ismm-&amp;amp;gt;serverFactory(0)&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;      in Load(). From a Valve Server Plugin, you must set this to an actual factory returned&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;      from gameServerFactory and hope that a SourceMM plugin did not override it. &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;*/&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;static&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;void&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; *(*sigscan_dllfunc)(&amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;const&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;char&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; *pName, &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;int&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; *pReturnCode);&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;/*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt; If the scan was successful or not &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;*/&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;char&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; is_set;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;/*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt; Starting address of the found function &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;*/&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;void&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; *sig_addr;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;/*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt; Public Functions &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;*/&amp;lt;/font&amp;gt;&lt;br /&gt;
    CSigScan(&amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;void&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;)sig_str(&amp;lt;font color=&amp;quot;#ff00ff&amp;quot;&amp;gt;NULL&amp;lt;/font&amp;gt;), sig_mask(&amp;lt;font color=&amp;quot;#ff00ff&amp;quot;&amp;gt;NULL&amp;lt;/font&amp;gt;), sig_len(&amp;lt;font color=&amp;quot;#ff00ff&amp;quot;&amp;gt;0&amp;lt;/font&amp;gt;), sig_addr(&amp;lt;font color=&amp;quot;#ff00ff&amp;quot;&amp;gt;NULL&amp;lt;/font&amp;gt;) {}&lt;br /&gt;
    ~CSigScan(&amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;void&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;);&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;static&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;bool&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; GetDllMemInfo(&amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;void&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;);&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;void&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; Init(&amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;unsigned&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;char&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; *sig, &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;char&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; *mask, &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;size_t&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; len);&lt;br /&gt;
 };&amp;lt;br /&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;void&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; InitSigs(&amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;void&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;);&amp;lt;br /&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;/*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt; Sig Functions &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;*/&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;class&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; CBaseAnimating;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;void&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; CBaseAnimating_Ignite(CBaseAnimating *cba, &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;float&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; flFlameLifetime);&amp;lt;br /&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#a020f0&amp;quot;&amp;gt;#endif&amp;lt;/font&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mrmagu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=User:Mrmagu&amp;diff=2121</id>
		<title>User:Mrmagu</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=User:Mrmagu&amp;diff=2121"/>
		<updated>2006-01-16T05:20:45Z</updated>

		<summary type="html">&lt;p&gt;Mrmagu: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;is a nub :]&lt;br /&gt;
&lt;br /&gt;
C++ Highlighted test..&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#a020f0&amp;quot;&amp;gt;#ifndef SIGSCAN_H&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#a020f0&amp;quot;&amp;gt;#define SIGSCAN_H&amp;lt;/font&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;class&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; CSigScan {&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#804040&amp;quot;&amp;gt;&amp;lt;b&amp;gt;private&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;:&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;/*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt; Private Variables &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;*/&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;/*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt; Base Address of the server module in memory &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;*/&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;static&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;unsigned&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;char&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; *base_addr;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;/*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt; The length to the module's ending address &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;*/&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;static&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;size_t&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; base_len;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;/*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt; The signature to scan for &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;*/&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;unsigned&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;char&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; *sig_str;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;/*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt; A mask to ignore certain bytes in the signature such as addresses&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;      The mask should be as long as all the bytes in the signature string&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;      Use '?' to ignore a byte and 'x' to check it&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;      Example&amp;amp;quot;xxx????xx&amp;amp;quot; - The first 3 bytes are checked, then the next 4 are&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;      ignored, then the last 2 are checked &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;*/&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;char&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; *sig_mask;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;/*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt; The length of sig_str and sig_mask (not including a terminating null for sig_mask) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;*/&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;size_t&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; sig_len;&amp;lt;br/&amp;gt;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;/*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt; Private Functions &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;*/&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;void&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;* FindSignature(&amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;void&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;);&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#804040&amp;quot;&amp;gt;&amp;lt;b&amp;gt;public&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;:&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;/*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt; Public Variables &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;*/&amp;lt;/font&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;/*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt; sigscan_dllfunc is a pointer of something that resides inside the gamedll so we can get&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;      the base address of it. From a SourceMM plugin, just set this to ismm-&amp;amp;gt;serverFactory(0)&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;      in Load(). From a Valve Server Plugin, you must set this to an actual factory returned&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;      from gameServerFactory and hope that a SourceMM plugin did not override it. &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;*/&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;static&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;void&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; *(*sigscan_dllfunc)(&amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;const&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;char&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; *pName, &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;int&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; *pReturnCode);&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;/*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt; If the scan was successful or not &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;*/&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;char&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; is_set;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;/*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt; Starting address of the found function &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;*/&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;void&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; *sig_addr;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;/*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt; Public Functions &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;*/&amp;lt;/font&amp;gt;&lt;br /&gt;
    CSigScan(&amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;void&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;)sig_str(&amp;lt;font color=&amp;quot;#ff00ff&amp;quot;&amp;gt;NULL&amp;lt;/font&amp;gt;), sig_mask(&amp;lt;font color=&amp;quot;#ff00ff&amp;quot;&amp;gt;NULL&amp;lt;/font&amp;gt;), sig_len(&amp;lt;font color=&amp;quot;#ff00ff&amp;quot;&amp;gt;0&amp;lt;/font&amp;gt;), sig_addr(&amp;lt;font color=&amp;quot;#ff00ff&amp;quot;&amp;gt;NULL&amp;lt;/font&amp;gt;) {}&lt;br /&gt;
    ~CSigScan(&amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;void&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;);&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;static&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;bool&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; GetDllMemInfo(&amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;void&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;);&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;void&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; Init(&amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;unsigned&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;char&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; *sig, &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;char&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; *mask, &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;size_t&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; len);&lt;br /&gt;
 };&amp;lt;br /&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;void&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; InitSigs(&amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;void&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;);&amp;lt;br /&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;/*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt; Sig Functions &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;*/&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;class&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; CBaseAnimating;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;void&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; CBaseAnimating_Ignite(CBaseAnimating *cba, &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;float&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; flFlameLifetime);&amp;lt;br /&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#a020f0&amp;quot;&amp;gt;#endif&amp;lt;/font&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mrmagu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=User:Mrmagu&amp;diff=2120</id>
		<title>User:Mrmagu</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=User:Mrmagu&amp;diff=2120"/>
		<updated>2006-01-16T05:13:00Z</updated>

		<summary type="html">&lt;p&gt;Mrmagu: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;is a nub :]&lt;br /&gt;
&lt;br /&gt;
C++ Highlighted test..&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;font color=&amp;quot;#a020f0&amp;quot;&amp;gt;#ifndef SIGSCAN_H&amp;lt;/font&amp;gt;&lt;br /&gt;
	&amp;lt;font color=&amp;quot;#a020f0&amp;quot;&amp;gt;#define SIGSCAN_H&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;class&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; CSigScan {&lt;br /&gt;
	&amp;lt;font color=&amp;quot;#804040&amp;quot;&amp;gt;&amp;lt;b&amp;gt;private&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;:&lt;br /&gt;
        &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;/*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt; Private Variables &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;*/&amp;lt;/font&amp;gt;&lt;br /&gt;
        &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;/*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt; Base Address of the server module in memory &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;*/&amp;lt;/font&amp;gt;&lt;br /&gt;
        &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;static&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;unsigned&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;char&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; *base_addr;&lt;br /&gt;
        &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;/*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt; The length to the module's ending address &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;*/&amp;lt;/font&amp;gt;&lt;br /&gt;
        &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;static&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;size_t&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; base_len;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;/*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt; The signature to scan for &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;*/&amp;lt;/font&amp;gt;&lt;br /&gt;
        &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;unsigned&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;char&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; *sig_str;&lt;br /&gt;
        &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;/*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt; A mask to ignore certain bytes in the signature such as addresses&amp;lt;/font&amp;gt;&lt;br /&gt;
	&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;           The mask should be as long as all the bytes in the signature string&amp;lt;/font&amp;gt;&lt;br /&gt;
	&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;           Use '?' to ignore a byte and 'x' to check it&amp;lt;/font&amp;gt;&lt;br /&gt;
	&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;           Example&amp;amp;quot;xxx????xx&amp;amp;quot; - The first 3 bytes are checked, then the next 4 are&amp;lt;/font&amp;gt;&lt;br /&gt;
	&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;           ignored, then the last 2 are checked &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;*/&amp;lt;/font&amp;gt;&lt;br /&gt;
        &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;char&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; *sig_mask;&lt;br /&gt;
        &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;/*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt; The length of sig_str and sig_mask (not including a terminating null for sig_mask) &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;*/&amp;lt;/font&amp;gt;&lt;br /&gt;
        &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;size_t&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; sig_len;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;/*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt; Private Functions &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;*/&amp;lt;/font&amp;gt;&lt;br /&gt;
        &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;void&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;* FindSignature(&amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;void&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;font color=&amp;quot;#804040&amp;quot;&amp;gt;&amp;lt;b&amp;gt;public&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;:&lt;br /&gt;
        &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;/*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt; Public Variables &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;*/&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;/*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt; sigscan_dllfunc is a pointer of something that resides inside the gamedll so we can get&amp;lt;/font&amp;gt;&lt;br /&gt;
	&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;           the base address of it. From a SourceMM plugin, just set this to ismm-&amp;amp;gt;serverFactory(0)&amp;lt;/font&amp;gt;&lt;br /&gt;
	&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;           in Load(). From a Valve Server Plugin, you must set this to an actual factory returned&amp;lt;/font&amp;gt;&lt;br /&gt;
	&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;           from gameServerFactory and hope that a SourceMM plugin did not override it. &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;*/&amp;lt;/font&amp;gt;&lt;br /&gt;
        &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;static&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;void&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; *(*sigscan_dllfunc)(&amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;const&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;char&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; *pName, &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;int&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; *pReturnCode);&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;/*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt; If the scan was successful or not &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;*/&amp;lt;/font&amp;gt;&lt;br /&gt;
        &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;char&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; is_set;&lt;br /&gt;
        &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;/*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt; Starting address of the found function &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;*/&amp;lt;/font&amp;gt;&lt;br /&gt;
        &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;void&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; *sig_addr;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;/*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt; Public Functions &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;*/&amp;lt;/font&amp;gt;&lt;br /&gt;
        CSigScan(&amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;void&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;)sig_str(&amp;lt;font color=&amp;quot;#ff00ff&amp;quot;&amp;gt;NULL&amp;lt;/font&amp;gt;), sig_mask(&amp;lt;font color=&amp;quot;#ff00ff&amp;quot;&amp;gt;NULL&amp;lt;/font&amp;gt;), sig_len(&amp;lt;font color=&amp;quot;#ff00ff&amp;quot;&amp;gt;0&amp;lt;/font&amp;gt;), sig_addr(&amp;lt;font color=&amp;quot;#ff00ff&amp;quot;&amp;gt;NULL&amp;lt;/font&amp;gt;) {}&lt;br /&gt;
        ~CSigScan(&amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;void&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;static&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;bool&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; GetDllMemInfo(&amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;void&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;);&lt;br /&gt;
        &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;void&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; Init(&amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;unsigned&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;char&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; *sig, &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;char&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; *mask, &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;size_t&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; len);&lt;br /&gt;
	};&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;void&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; InitSigs(&amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;void&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;/*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt; Sig Functions &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#0000ff&amp;quot;&amp;gt;*/&amp;lt;/font&amp;gt;&lt;br /&gt;
	&amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;class&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; CBaseAnimating;&lt;br /&gt;
	&amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;void&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; CBaseAnimating_Ignite(CBaseAnimating *cba, &amp;lt;font color=&amp;quot;#2e8b57&amp;quot;&amp;gt;&amp;lt;b&amp;gt;float&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; flFlameLifetime);&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;font color=&amp;quot;#a020f0&amp;quot;&amp;gt;#endif&amp;lt;/font&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mrmagu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=User:Mrmagu&amp;diff=2113</id>
		<title>User:Mrmagu</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=User:Mrmagu&amp;diff=2113"/>
		<updated>2006-01-16T01:10:13Z</updated>

		<summary type="html">&lt;p&gt;Mrmagu: About&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;is a nub :]&lt;/div&gt;</summary>
		<author><name>Mrmagu</name></author>
		
	</entry>
</feed>