Ayuto's hooking of "OnTakeDamage" should work on CSGO., due to the signatures are already supplied in the SourcePython data. I am not to sure how the point_hurt entity has been changed in CSGO, or whether it has changed at all.
I will have a play with this quickly on CSGO, will post back if I find a method of doing this.
EDIT - Found a way to hook all entity damage, so this will add 100 damage to any entity you damage. Tested on Windows CSGO.
Code: Select all
# =============================================================================
# >> IMPORTS
# =============================================================================
from memory import find_binary
from memory import make_object
from memory import Convention
from memory import Argument
from memory import Return
from memory.hooks import PreHook
from basetypes import TakeDamageInfo
from core import PLATFORM
# =============================================================================
# >> CONSTANTS
# =============================================================================
# Signature and symbol for CBaseEntity::TakeDamage
if PLATFORM == 'windows':
IDENTIFIER = b'\x55\x8B\xEC\x83\xE4\xF8\x83\xEC\x70\x56\x57\x8B\xF9\x8B\x0D\x2A\x2A\x2A\x2A\x85\xC9'
else:
IDENTIFIER = '_ZN11CBaseEntity10TakeDamageERK15CTakeDamageInfo'
POINTER = Argument.POINTER
# =============================================================================
# >> GLOBAL VARIABLES
# =============================================================================
server = find_binary('csgo/bin/server')
OnTakeDamage = server[IDENTIFIER].make_function(Convention.THISCALL, (POINTER, POINTER), Return.VOID)
# =============================================================================
# >> CALLBACK
# =============================================================================
@PreHook(OnTakeDamage)
def pre_on_take_damage(args):
info = make_object(TakeDamageInfo, args[1])
info.damage += 100