Raised This Month: $ Target: $400
 0% 

Module: CS Hack


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
DS
SourceMod Developer
Join Date: Sep 2004
Location: WI, USA
Old 12-06-2004 , 00:24   Module: CS Hack
Reply With Quote #1

CS Hack is an AMX Mod X module that adds even more Counter-Strike specific natives than the Cstrike and CSX modules. This goes beyond what is allowed by the Half-Life SDK and Metamod by using a technique that I like to call "memory hacking". It's a rather simple technique in reality. It's really just a matter of reading and patching bytes in memory. What this module does is read and patch values in the CS server binary (DLL or SO) while the server is running.

This has the potential to crash the server if the patching is incorrect. So any possible bugs in this module COULD crash your servers. I will warn you of that ahead of time. Also on the off chance that Counter-Strike gets an update, it's possible none of the natives will work due to offset changes.

The only hard part in creating this module was actually finding the right values that should be patched and/or read. There was the also the problem that executable code in memory cannot be overwritten by default. But that can be overcome fairly easily with a few functions in the Win32 API and Linux system calls.

I will be writing up a document/tutorial detailing the work I have done so that others might be able to find some useful memory values to change in the future. However, I want to make it clear that I will not be adding natives to this module. I will fix any possible bugs with the current set of natives though. Since I recently joined the SourceMod development team, I want to concentrate on doing anything I can to help that project and I don't really want to do any more work for games on the HL1 engine. I will be writing a similar version of this module for Counter-Strike: Source and SourceMod in the future.

This module has been released more as a proof of concept rather than a full and greatly usable module. I had been hoping to have more useful natives before I was going to release it. But you are all certainly welcome to use it in a plugin if you find some of these natives useful. I have not done any testing whatsoever on Condition Zero, so its possible this module will not work on that mod. The CS and CZ server binaries are quite similar, I have noticed. In fact they are the same size. So its also possible this will work. But I make no guarantees on CZ compatibilty.

The source code is available in the SVN (HERE). I feel that my memory code is a mess and could have been designed better. I'm really not that proud of the code overall, heh. But it should work. :-P But it surely will be rewritten for the CS:S version.

Known Issues
  • Changing the price of an HE grenade will also change the price of a smoke grenade and vice versa on an AMD64 machine. This appears it cannot be fixed very easily. If someone has a suggestion, I'm all ears.
  • Changing the minimum roundtime on an AMD64 machine can cause players to be virtually immobile if changed below 1.0. It could also cause a crash if set above 1.0. This also appears to be very difficult to fix.
  • The module doesn't seem to work on FreeBSD servers
If anyone finds any bugs, feel free to report them. I've tested all the natives on all platforms, but chances are I still missed something.

And much thanks goes to BAILOPAN, ghost_of_evilspy (AKA hullu), PM, JGHG, Ronkkrop, and BlueRaja for their help and support. Thanks for putting up with me on AIM, MSN, and IRC. I could not have completed this module without you guys.

EDIT: I am no longer supporting this module. I need to move on to HL2, CS:S, and SourceMod. If there's a bug you want fixed, just going to have to fix it yourself.

So without further ado, the download along with a sample plugin and the include files are provided below.
Attached Files
File Type: zip cshack_amxx.zip (60.0 KB, 7975 views)

Last edited by DS; 02-11-2008 at 12:03. Reason: Updated source code link to point to user SVN repository
DS is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:21.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode