Raised This Month: $51 Target: $400
 12% 

How to implement ITempEntsSystem?


Post New Thread Reply   
 
Thread Tools Display Modes
BAILOPAN
Join Date: Jan 2004
Old 11-03-2005 , 03:03  
Reply With Quote #11

hardcoded offset. only works on windows and is hugely subject to recompiles of any sort.
__________________
egg
BAILOPAN is offline
Ryan
Senior Member
Join Date: May 2004
Location: NH, USA
Old 11-03-2005 , 03:14  
Reply With Quote #12

Hmm a line similar to this code was pulled from NemoD for the tempent effects. Are you sure fysh did signatures for everything? Maybe I just don't know what I'm looking for...
Ryan is offline
Send a message via AIM to Ryan
BAILOPAN
Join Date: Jan 2004
Old 11-03-2005 , 04:59  
Reply With Quote #13

Actually, my mistake, it looks a bit different. Looks like it grabs an offset from a virtual function pointer. It might be okay then, since it's only using offsets to find distances.
__________________
egg
BAILOPAN is offline
Mani
Veteran Member
Join Date: Dec 2004
Location: UK
Old 11-03-2005 , 07:47  
Reply With Quote #14

Didn't fysh just externally link to te in his linux code and add the server_i486.so lib into his makefile ?

My version for both linux (Bailopan deserves some credit for this as I'd got it slightly wrong initially) and windows (Lance VOrgin):-

I've sent this to a few people but it should probably be posted as public too. The class ManiGameType corresponds to the gametypes.txt file that I use for compatibilty across different source games.

The gpManiGameType->GetLinuxBin() function returns "./cstrike/bin/server_i486.so" for CSS. It should be different for each mod that it runs on.

Code:
	if (effects && gpManiGameType->GetAdvancedEffectsAllowed())
	{

#ifdef __linux__
		void	*handle;
		void	*var_address;

		handle = dlopen(gpManiGameType->GetLinuxBin(), RTLD_NOW);
	
		if (handle == NULL)
		{
			Msg("Failed to open server image, error [%s]\n", dlerror());
			gpManiGameType->SetAdvancedEffectsAllowed(false);
		}
		else
		{ 
			Msg("Program Start at [%p]\n", handle);

			var_address = dlsym(handle, "te");
			if (var_address == NULL)
			{
				Msg("dlsym failure : Error [%s]\n", dlerror());
				gpManiGameType->SetAdvancedEffectsAllowed(false);
			}
			else
			{
				Msg("var_address = %p\n", var_address);
				temp_ents = *(ITempEntsSystem **) var_address;
			}

			dlclose(handle);
		}
#else
		temp_ents = **(ITempEntsSystem***)(VFN2(effects, gpManiGameType->GetAdvancedEffectsVFuncOffset()) + (gpManiGameType->GetAdvancedEffectsCodeOffset()));
#endif
	}
Mani
__________________
Installation files, documentation and help can be found at: -

www.mani-admin-plugin.com
Mani is offline
Ryan
Senior Member
Join Date: May 2004
Location: NH, USA
Old 11-03-2005 , 14:10  
Reply With Quote #15

How does this work exactly? are you locating some known/available class or function, then offsetting the memory location to the hidden class that the known class is a part of?

Also Mani, can you show your define of VFN2? I've seen a few different implementations of it and am not sure which one to use if using the code you've provided.
Ryan is offline
Send a message via AIM to Ryan
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:51.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode