I have tried to hook:
[CCSGameRules::GetMapRemainingTime]
shortname = "GetMapRemainingTime"
sig = " 55 8B EC 51 8B 15 2A 2A 2A 2A 56 8B F1 8B 0D 2A 2A 2A 2A 81"
symbol = "_ZN12CCSGameRules19GetMapRemainingTimeEv"
param = "p)f"
convention = "thiscall"
Here is the code:
Syntax: Select all
import memory
from memory import Convention, DataType
from memory.hooks import PreHook
from messages import SayText2
server = memory.find_binary('server', srv_check=False)
identifier = '_ZN12CCSGameRules19GetMapRemainingTimeEv'
GetMapRemainingTime = server[identifier].make_function(
Convention.THISCALL,
[DataType.POINTER],
DataType.FLOAT
)
def load():
@PreHook(GetMapRemainingTime)
def pre_terminate_round(stack_data):
SayText2(f'Timeleft: {stack_data}').send()
print(f'Timeleft: {stack_data}')
Whenever the round end i just get these errors:
Code: Select all
Timeleft: (<_memory.Pointer object at 0xe09c5a70>, 186542880)
Edit:
Syntax: Select all
import memory
from memory import Convention, DataType
from memory.hooks import PreHook
from messages import SayText2
server = memory.find_binary('server', srv_check=False)
identifier = '_ZN12CCSGameRules19GetMapRemainingTimeEv'
GetMapRemainingTime = server[identifier].make_function(
Convention.THISCALL,
[],
DataType.VOID
)
@PreHook(GetMapRemainingTime)
def pre_terminate_round(stack_data):
SayText2(f'Timeleft: {stack_data}').send()
Now it shows in chat: Timeleft: ()
How i can get it show remaining time of map?