Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Tiberian Technologies / Blackhand Studios » Tiberian Technologies Forum » Third party suicide hook crashes with beta 5
Third party suicide hook crashes with beta 5 [message #469928] Tue, 26 June 2012 11:38 Go to previous message
iRANian is currently offline  iRANian
Messages: 4308
Registered: April 2011
Karma:
General (4 Stars)
I've been using a suicide hook from the OnOeS bot released by Hex for a plugin (Suicide5MinWait), it works just fine with beta 4 but with beta 5 it crashes (even if I change the hook to just print something to the console):

Hook *Suicide = new Hook;
 
void __cdecl Suicide_Hook(int PlayerID)
{
	Console_Output("test\n");
}

void __declspec(naked) Suicide_Glue()
{
	__asm
	{
		mov eax, [edi+6B4h];
		push eax;
		call Suicide_Hook;
		add esp, 4;
		pop edi;
		pop ecx;
		retn;
	}
}

Suicide5MinWait::Suicide5MinWait()
{
	RegisterEvent(EVENT_LOAD_LEVEL_HOOK,this);
	RegisterEvent(EVENT_PLAYER_LEAVE_HOOK,this);

	Suicide->Install('\xE9', 0x004BA144, (int)&Suicide_Glue, "");
}


Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases
 
Read Message
Read Message
Read Message
Previous Topic: sshot / ssurl
Next Topic: Tiberian Technologies releases TT-scripts 4.0 open beta 4!
Goto Forum:
  


Current Time: Wed Nov 27 22:14:57 MST 2024

Total time taken to generate the page: 0.01378 seconds