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 next message
iRANian is currently offline  iRANian
Messages: 4308
Registered: April 2011
Karma: 0
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
Re: Third party suicide hook crashes with beta 5 [message #469961 is a reply to message #469928] Tue, 26 June 2012 14:25 Go to previous messageGo to next message
Whitedragon is currently offline  Whitedragon
Messages: 832
Registered: February 2003
Location: California
Karma: 1
Colonel
Mine still works fine.

void __declspec(naked) Suicide_Hook() {
	__asm {
		mov eax, [ecx+6B4h]
		push eax
		call DAEventManager::Suicide_Event
		add esp, 4
		ret
	}
}

void InitEngineDA() {
	DAMemoryPatcher::Install_Jump_Hook(0x004BA140,Suicide_Hook); //Hook cSuicideEvent::Act
}


Black-Cell.net
Network Administrator (2003 - )

DragonServ, Renegade's first IRC interface bot
Creator and lead coder (2002 - )

Dragonade, Renegade's first server side modification
Lead coder (2005 - )
Re: Third party suicide hook crashes with beta 5 [message #469969 is a reply to message #469928] Tue, 26 June 2012 14:51 Go to previous message
iRANian is currently offline  iRANian
Messages: 4308
Registered: April 2011
Karma: 0
General (4 Stars)
Thanks a bunch

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
Previous Topic: sshot / ssurl
Next Topic: Tiberian Technologies releases TT-scripts 4.0 open beta 4!
Goto Forum:
  


Current Time: Sat Nov 30 13:06:47 MST 2024

Total time taken to generate the page: 0.00812 seconds