Page 1 of 1

Problems with hooking.

Posted: Sun Jan 26, 2020 8:24 am
by InvisibleSoldiers
Tried to hook CLagCompensationManager::StartLagCompensation https://github.com/ValveSoftware/source ... n.cpp#L328
Problems with it game crash and ESP not present output in the console when the function was called.

Syntax: Select all

start_lag_compensation = server_binary[b'\x55\x8B\xEC\x83\xE4\xF8\x83\xEC\x48\x56\x8B\xF1\xC7\x44\x24\x48\x00\x00\x00\x00'].make_function(
Convention.THISCALL,
(DataType.POINTER, DataType.POINTER, DataType.POINTER),
DataType.VOID
)


Tried to hook FX_FireBullets https://github.com/ValveSoftware/source ... d.cpp#L108
Problems with it game crash when the function was called.

Syntax: Select all

fx_firebullets = server_binary[b'\x55\x8B\xEC\x83\xE4\xF8\x81\xEC\x40\x02\x00\x00'].make_function(
Convention.CDECL,
(DataType.INT, DataType.POINTER, DataType.POINTER, DataType.INT, DataType.INT, DataType.INT, DataType.FLOAT),
DataType.VOID
)


OS: Windows 8.1
Game: CS:GO

Re: Problems with hooking.

Posted: Sun Jan 26, 2020 10:56 am
by Ayuto
Could you please post the full test code, so tests can be done using exactly the same code and doesn't require us to complement your snippets?

Re: Problems with hooking.

Posted: Sun Jan 26, 2020 11:02 am
by InvisibleSoldiers

Syntax: Select all

from memory import find_binary
from memory import Convention
from memory import DataType
from memory.hooks import PreHook

server_binary = find_binary('server')

start_lag_compensation = server_binary[b'\x55\x8B\xEC\x83\xE4\xF8\x83\xEC\x48\x56\x8B\xF1\xC7\x44\x24\x48\x00\x00\x00\x00'].make_function(
Convention.THISCALL,
(DataType.POINTER, DataType.POINTER, DataType.POINTER),
DataType.VOID
)

fx_firebullets = server_binary[b'\x55\x8B\xEC\x83\xE4\xF8\x81\xEC\x40\x02\x00\x00'].make_function(
Convention.CDECL,
(DataType.INT, DataType.POINTER, DataType.POINTER, DataType.INT, DataType.INT, DataType.INT, DataType.FLOAT),
DataType.VOID
)

@PreHook(start_lag_compensation)
def pre_hook(stack_data):
print('start_lag_compensation')

@PreHook(fx_firebullets)
def pre_hook(stack_data):
print('fx_firebullets')


Both function should be called when player shoot.