[H3LP] StartObserver with Orpheu
I want to hook CBasePlayer::ObserverStart with Orpheu, since Okapi is having some issues especially on Linux and with virtual functions mostly, so I don't wanna use it at all anymore, as my server eprforms much betetr since I got rid of it.
Plugin test: PHP Code:
PHP Code:
|
Re: [H3LP] StartObserver with Orpheu
Nope, orpheu doesn't like Vector. Only Vector* IIRC.
You could try changing vector to float, float, float and see if it's passed properly. |
Re: [H3LP] StartObserver with Orpheu
Quote:
|
Re: [H3LP] StartObserver with Orpheu
I know about okapi, I was the one who reported it years ago. If you don't want to use the float, float, float trick then I'm afraid there's nothing else to be done.
|
Re: [H3LP] StartObserver with Orpheu
Quote:
|
Re: [H3LP] StartObserver with Orpheu
Quote:
Orpheu actually implements Vector Handlers (apart from Vec* Handler) from the start. And Sig scanning dosent really care about the funtion params. But it is the Orpheu which requires the Params types so that it, 1. Can interpret and convert OriginalFunc Args to AMX Cells, what it actual got from memory (Function::Call()#L208 [TypeHandler::ConvertToAMX]). 2. If the Original Call is not superceded, call the OriginalFuntion after pushing actual arguments onto stack (Function::callOriginal()#L284) Interpretation of memory is already taken care of by Orpheu:TypeHandlers. The problem with Vector is that we have to push sizeof(Float)*3 (*3 in-case of 3D, *2 in-case of 2D) on to stack Function::CallOriginal(). On the other hand, Vector* (or any <Class>*), only pointer which is of constant size need to be pushed onto stack before Calling OriginalFunc(CBasePlayer::StartObserver in this case). So Orpheu is only designed to push pointers or any vars with size < sizeof(long*) (4 Bytes) per argument onto stack before calling OriginalFunc. So as a hack to the hacker, just say to Orpheu that there are 3 Float (or 2 Float for Vec2D) instead of one Vector Argument in Sig file. Now orpheu in CallOrigical() will keep pushing sizeof(Float)x3 bytes onto stack thinking there are 3 arguments to the OriginalFunc, which is really what we need :twisted: This workaround should work for all nonStd nonPointer Class object arguments (having said that their interpretation type handlers are implemented), since in memory 3xFloats and Vector3D are same. I don't think this is any less reliable. And about returning a NonStd Type, more info is required : ) Actually editing Orpheu to directly support nonStd Classes is not that hard but, since we have a busy(lazy) maintainer for Orpheu and AMXX and the official feature frozen state, the changes would not make their way into a release, and would not help the greater purpose of this community. |
All times are GMT -4. The time now is 22:15. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.