Accesing metamod modules by cvar address
I was trying to hook functions in metamod modules using an amxmodx module and I found that, in linux using dladdr within the cvar pointer registered by the metamod module (even with amxmodx) can't be mapped to an already opened library.
For example Code:
cvar_t *a = CVAR_GET_POINTER("amx_client_languages"); Using GDB I found the address is in non-allocated space by any library loaded... It's really strange. At least should be engine_i686.so. If I do the same with mp_timelimit or sv_proxies I get the corresponding library (CS or ENGINE). Some time ago I was trying to do this with orpheu using the included method to define additional libraries and I get the same error. It's possible that last updates on engine changed something about how cvar pointers works? Anyone has similar problems? |
Re: Accesing metamod modules by cvar address
Metamod does not supply plugin configurable variables directly to the engine to avoid segmentation
faults. Check the 'reg_support.cpp' at line 178, it should explain everything for you. |
Re: Accesing metamod modules by cvar address
Yes, I found that the correct way is to hook CVarRegister before OnMetaAttach, then at each call check cvar_t pointer passed as parameter and that memory will be for the calling module.
Thanks |
All times are GMT -4. The time now is 17:39. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.