Re:Hotpatching a C Function on x86
by specialist on Friday April 01, 2016 @10:41AM
(#11405081)
Huh.
Ages ago, I tried to figure out how to dynamically probe OpenGL extensions. My intent was that the first time a method call was attempted, the method proxy would
look for a concrete implementation
on success, swap its pointer to the concrete implementation
on fail (not found), swap its pointer for a generic error method
then call itself again
By doing it dynamically, an app would only be probing extensions it actually used, versus every extension from every vendor. Back then, all the stubs were code generated. To avoid probing everything, we'd manually modify the headers, which I didn't like maintaining.
I didn't get very far. Looking at your implementation reminded me of that effort.
I haven't done OpenGL in probably 15 years. I don't even know if extension probing is still a thing (useful).
Ages ago, I tried to figure out how to dynamically probe OpenGL extensions. My intent was that the first time a method call was attempted, the method proxy would
By doing it dynamically, an app would only be probing extensions it actually used, versus every extension from every vendor. Back then, all the stubs were code generated. To avoid probing everything, we'd manually modify the headers, which I didn't like maintaining.I didn't get very far. Looking at your implementation reminded me of that effort.
I haven't done OpenGL in probably 15 years. I don't even know if extension probing is still a thing (useful).
Thanks for sharing.