Quote:
Originally Posted by fdxx
Spoiler
Server crashes after trying, what am I doing wrong?
PHP Code:
/*
"Games"
{
"left4dead2"
{
"Addresses"
{
"CLunge::IsAbilityReadyToFire"
{
"linux"
{
"signature" "CLunge::IsAbilityReadyToFire"
"offset" "0xC8"
}
}
}
"Signatures"
{
"CLunge::IsAbilityReadyToFire"
{
"library" "server"
"linux" "@_ZNK6CLunge20IsAbilityReadyToFireEv"
}
}
}
}
*/
#pragma semicolon 1
#pragma newdecls required
#include <sourcemod>
#include <sdktools>
#include <midhook>
public void OnPluginStart()
{
GameData hGameData = new GameData("midhook_test");
Address addr = hGameData.GetAddress("CLunge::IsAbilityReadyToFire");
MidHook midhook = new MidHook(addr, OnMidHook);
if (!midhook)
SetFailState("Failed to create midhook");
delete hGameData;
}
void OnMidHook(MidHookRegisters regs)
{
PrintToServer("--- OnMidHook ---"); // Server crashes immediately after printing
}
|
Please provide an Accelerator crash dump if possible. At a glance, it appears that short jumps (the
74 0B) cannot be fixed up in the trampoline of a midhook. Try hooking somewhere that doesn't have a short jump within ~5 bytes of the target address. If that's the problem, then that is a limitation of the API but something I could consider working on in the future.
__________________