Renegade Public Forums
C&C: Renegade -- Dead since 2012!™
Home » Renegade Discussions » 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: 4295
Registered: April 2011
General (4 Stars)
From: *cm-5-3b.dynamic.ziggo.nl
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] Tue, 26 June 2012 14:25 Go to previous messageGo to next message
Whitedragon  is currently offline Whitedragon  
Messages: 829
Registered: February 2003
Location: California
Colonel

From: *lsanca.dsl-w.verizon.net
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] Tue, 26 June 2012 14:51 Go to previous message
iRANian  is currently offline iRANian  
Messages: 4295
Registered: April 2011
General (4 Stars)
From: *cm-5-3b.dynamic.ziggo.nl
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: Wed Apr 24 15:31:09 MST 2019
.:: Contact :: Home ::.

Powered by: FUDforum 2.7.7RC2.
Copyright ©2001-2007 FUD Forum Bulletin Board Software