Quote:
Originally Posted by Geesu
Any possibility you could point us noobs in the direction of say a book/site that taught you guys this stuff?
|
Yea :pointing-at: vancelorgin...
My "direction" is vancelorgin's first post in the thread... then I used my mdump server command (display memory in hex and printable chars, 16 per row) and a command to display the current engines class pointer... after that, well the hard part was to fool the GCC compiler as you are not allowed to cast virtual object functions (thats why my casting looks so ugly)...
Quote:
Originally Posted by vancelorgin
::edit:: lol - nice idea about the struct of funcs. I'm far too lazy for that, however
|
Well didn't take many minutes as it is only a slightly modified code from the IVEngineServer Class in the header file.
Quote:
Originally Posted by vancelorgin
Please watch your terminology. You aren't copying the functions, you're copying their addresses in the vtable. I've written funcs to copy functions before - not fun :/
|
Ouch... you are right... copying the functions would have been bad...
Well, to be correct I should then also correct myself and say I use a structure of function pointers and not a structure of functions... :hurtme:
Quote:
Originally Posted by vancelorgin
...Please, however, try it in linux...
|
Well I think I will leave that exercise to you as I have a feeling it could cause problems...
Quote:
Originally Posted by vancelorgin
...That's exactly what I do, and have done for weeks now....... look at the macros... it's what that code does...
|
Sorry... but well as I thought function pointer copying would be enough I didn't even check your assemblers and macros as I couldn't think of why you would need it and therefore I didn't dig in to it
(but that's also why I asked in my reply if it was doing something more)....
/X
PS! Again... thanks for sharing your knowledge and findings :bowdown:... without your first post I wouldn't have been able to do my "hooking" so easy as the code I use to override three engine functions now looks as:
SET_ENGINEFUNC(LogPrint,MetaLogPrint);
SET_ENGINEFUNC(UserMessageBegin,MetaUserMessa geBegin);
SET_ENGINEFUNC(MessageEnd,MetaMessageEnd);