|
|
(3 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
| is a nub :] | | is a nub :] |
| | | |
− | C++ Highlighted test..<br />
| + | <hr style="border:0;border-top:1px solid #969696;" /> |
− | | |
− | <font color="#a020f0">#ifndef SIGSCAN_H</font>
| |
− | <font color="#a020f0">#define SIGSCAN_H</font><br />
| |
− | <font color="#2e8b57"><b>class</b></font> CSigScan {
| |
− | <font color="#804040"><b>private</b></font>:
| |
− | <font color="#0000ff">/*</font><font color="#0000ff"> Private Variables </font><font color="#0000ff">*/</font>
| |
− | <font color="#0000ff">/*</font><font color="#0000ff"> Base Address of the server module in memory </font><font color="#0000ff">*/</font>
| |
− | <font color="#2e8b57"><b>static</b></font> <font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>char</b></font> *base_addr;
| |
− | <font color="#0000ff">/*</font><font color="#0000ff"> The length to the module's ending address </font><font color="#0000ff">*/</font>
| |
− | <font color="#2e8b57"><b>static</b></font> <font color="#2e8b57"><b>size_t</b></font> base_len;<br />
| |
− | <font color="#0000ff">/*</font><font color="#0000ff"> The signature to scan for </font><font color="#0000ff">*/</font>
| |
− | <font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>char</b></font> *sig_str;
| |
− | <font color="#0000ff">/*</font><font color="#0000ff"> A mask to ignore certain bytes in the signature such as addresses</font>
| |
− | <font color="#0000ff"> The mask should be as long as all the bytes in the signature string</font>
| |
− | <font color="#0000ff"> Use '?' to ignore a byte and 'x' to check it</font>
| |
− | <font color="#0000ff"> Example"xxx????xx" - The first 3 bytes are checked, then the next 4 are</font>
| |
− | <font color="#0000ff"> ignored, then the last 2 are checked </font><font color="#0000ff">*/</font>
| |
− | <font color="#2e8b57"><b>char</b></font> *sig_mask;
| |
− | <font color="#0000ff">/*</font><font color="#0000ff"> The length of sig_str and sig_mask (not including a terminating null for sig_mask) </font><font color="#0000ff">*/</font>
| |
− | <font color="#2e8b57"><b>size_t</b></font> sig_len;<br/>
| |
− | <font color="#0000ff">/*</font><font color="#0000ff"> Private Functions </font><font color="#0000ff">*/</font>
| |
− | <font color="#2e8b57"><b>void</b></font>* FindSignature(<font color="#2e8b57"><b>void</b></font>);<br/>
| |
− | <font color="#804040"><b>public</b></font>:
| |
− | <font color="#0000ff">/*</font><font color="#0000ff"> Public Variables </font><font color="#0000ff">*/</font><br />
| |
− | <font color="#0000ff">/*</font><font color="#0000ff"> sigscan_dllfunc is a pointer of something that resides inside the gamedll so we can get</font>
| |
− | <font color="#0000ff"> the base address of it. From a SourceMM plugin, just set this to ismm->serverFactory(0)</font>
| |
− | <font color="#0000ff"> in Load(). From a Valve Server Plugin, you must set this to an actual factory returned</font>
| |
− | <font color="#0000ff"> from gameServerFactory and hope that a SourceMM plugin did not override it. </font><font color="#0000ff">*/</font>
| |
− | <font color="#2e8b57"><b>static</b></font> <font color="#2e8b57"><b>void</b></font> *(*sigscan_dllfunc)(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *pName, <font color="#2e8b57"><b>int</b></font> *pReturnCode);<br />
| |
− | <font color="#0000ff">/*</font><font color="#0000ff"> If the scan was successful or not </font><font color="#0000ff">*/</font>
| |
− | <font color="#2e8b57"><b>char</b></font> is_set;
| |
− | <font color="#0000ff">/*</font><font color="#0000ff"> Starting address of the found function </font><font color="#0000ff">*/</font>
| |
− | <font color="#2e8b57"><b>void</b></font> *sig_addr;<br />
| |
− | <font color="#0000ff">/*</font><font color="#0000ff"> Public Functions </font><font color="#0000ff">*/</font>
| |
− | CSigScan(<font color="#2e8b57"><b>void</b></font>)sig_str(<font color="#ff00ff">NULL</font>), sig_mask(<font color="#ff00ff">NULL</font>), sig_len(<font color="#ff00ff">0</font>), sig_addr(<font color="#ff00ff">NULL</font>) {}
| |
− | ~CSigScan(<font color="#2e8b57"><b>void</b></font>);<br />
| |
− | <font color="#2e8b57"><b>static</b></font> <font color="#2e8b57"><b>bool</b></font> GetDllMemInfo(<font color="#2e8b57"><b>void</b></font>);
| |
− | <font color="#2e8b57"><b>void</b></font> Init(<font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>char</b></font> *sig, <font color="#2e8b57"><b>char</b></font> *mask, <font color="#2e8b57"><b>size_t</b></font> len);
| |
− | };<br />
| |
− | <font color="#2e8b57"><b>void</b></font> InitSigs(<font color="#2e8b57"><b>void</b></font>);<br />
| |
− | <font color="#0000ff">/*</font><font color="#0000ff"> Sig Functions </font><font color="#0000ff">*/</font>
| |
− | <font color="#2e8b57"><b>class</b></font> CBaseAnimating;
| |
− | <font color="#2e8b57"><b>void</b></font> CBaseAnimating_Ignite(CBaseAnimating *cba, <font color="#2e8b57"><b>float</b></font> flFlameLifetime);<br />
| |
− | <font color="#a020f0">#endif</font>
| |