New Way To Block Round End
1 Attachment(s)
As everyone knows, putting a fake bot in each team can prevent round end, but this way has a lot of disadvantage.
(1) take two server slots (2) waste server resources to deal with server status. (kick bots when players reach some amount etc.) (3) fake bot and real bot, what a mess! Here, I'll show a new and hacky way to block round end without adding a stupid fake bot in each team. This way is to block the roundend function in gamedll. Part 1. Finding the function Everyone knows that there are some situation to trigger the round end, such as all players in one team died off, all hostages rescued by ct, vip escaped... . All of them will trigger a log event Round_End, so my clue came out. First, disassemble game dll, "mp.dll", then I start to search keyword "round_end", found a string: Code:
"World triggered \"Round_End\"\n" I found that there are some calls from one function, then I jump to that function, I found some useful information what we exactly expected. Such as "#VIP_Escaped", "#VIP_Assassinated", "#Terrorists_Escaped"... So lucky that I found this function, sub_10094E90, this is the round end function. Part 2. Getting real address of this function at run-time Now It's an easy part since we know the function address. We can get it's real address at run-time, as windows always load process to a static address, this makes things easy. The real address of function sub_10094E90 is: Code:
mp.dll's entry + (0X10094E90 - Imagebase) // Imagebase is 0X10000000 here, so the function's offset is 0X94E90 Code:
#define OFFSET_ROUNDEND 0X94E90 Now we got the function's real address, the next is to patch it. It is easy to block a function without any conditions. No need to hook it, just write a 'retn' to this function's first byte. So when this function is called, it become dumb. Code:
void I_Can_Do_Some_Stuff(int a, int b) Code:
const unsigned char retn = 0xC3; //binary of retn Code:
#include <what_should_be_included.h> Advantage: plain & more efficient Using this method to block round end, you don't even have to remove the map entities such as "func_bomb_target"... Disadvantage: Hardcoded, which means when the binary updated, there may be a little chance that the function's address would change. You need to resolve the address by disassembing the game dll again to find the new address.(same method above) Solution: signature scanning, I will not go too much far for this. Finally, sorry for not handling linux, maybe someone could make it base this concept. Thanks for reading, not well written, and sorry for my bad English. Edit: upload a module, noroundend_amxx.dll and sourcecode include linux code, but not compiled and test, should work. Credit: bailopan for his signaturemanager class update: 1. changed the win32 signature 2. fix a small print tip bug 3. change to only command version sv_noroundend [0/1] |
Re: New Way To Block Round End
Interesting stuff !
It would be nice to have a module which allow us to execute or hook all the provided function in CS, like in SourceMod if I'm right. |
Re: New Way To Block Round End
it would be nice if someone compile this into a mm plugin so there won't be infinity posts with one and the same question >_<
p.s. and it would be perfect if you add offset for linux gamelib ;) p.p.s. we need to execute this code only once ? |
Re: New Way To Block Round End
Quote:
|
Re: New Way To Block Round End
Thanks jim.
Yes we need a new module that make us able to hook and call every function of CS (the signature scanning stuff of sourcemod is very nice and almost update proof) . There will be a rain of new plugins then and i'm looking forward to it. I don't have the knowledge to do that. I propose that we start a fund raise to achieve that goal and give the money to the one who make it. |
Re: New Way To Block Round End
thanks for replies, I uploaded a module as an example. no native, just put noroundend_amxx.dll in module folder and write noroundend in config file.
|
Re: New Way To Block Round End
any replies for linux version?
|
Re: New Way To Block Round End
Thanks you.
This is awesome.. |
Re: New Way To Block Round End
Awesome. :mrgreen:
Any command to turn back round ends ? |
Re: New Way To Block Round End
hi, here is a server command version
command: sv_noroundend [0/1] 1: block round end 0: enable round end null: check the status( whether round end or not) updated: see main post |
All times are GMT -4. The time now is 23:06. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.