Problems with hooking.

Please post any questions about developing your plugin here. Please use the search function before posting!
User avatar
InvisibleSoldiers
Senior Member
Posts: 114
Joined: Fri Mar 15, 2019 6:08 am

Problems with hooking.

Postby InvisibleSoldiers » Sun Jan 26, 2020 8:24 am

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
User avatar
Ayuto
Project Leader
Posts: 2098
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: Problems with hooking.

Postby Ayuto » Sun Jan 26, 2020 10:56 am

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?
User avatar
InvisibleSoldiers
Senior Member
Posts: 114
Joined: Fri Mar 15, 2019 6:08 am

Re: Problems with hooking.

Postby InvisibleSoldiers » Sun Jan 26, 2020 11:02 am

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.

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 3 guests