Hooking wglSwapBuffers ?

Started by
5 comments, last by adnankhan 19 years, 6 months ago
Do anyone have idea about hooking wglSwapBuffers... Any Tutorial, Sample code, Article... Advance Thanx
Advertisement
Quote:Original post by adnankhan
Do anyone have idea about hooking wglSwapBuffers...

Hooking wglSwapBuffers? That doesn't make sense. Post more information...
My opinion is a recombination and regurgitation of the opinions of those around me. I bring nothing new to the table, and as such, can be safely ignored.[ Useful things - Firefox | GLee | Boost | DevIL ]
Okay

I wrote an openGL Wrapper which can take screen shots and Display FPS on games but ever time I have to copy the opengl32.dll to the game directory so that the game shd load my wrapper dll and enable me to take SCs and display FPS.

Now I want to Hook opengl32.dll wglSwapBuffers Function to inject my own Function.
What games don't support screen shots and fps displays? Smells like a cheat to me.
Quote:Original post by DrEvil
What games don't support screen shots and fps displays? Smells like a cheat to me.


Well I am a bit suprised with ur reply.

I never mentioned games not supporting screen shots or displaying FPS.

Let me explain again I wrote an openGL wrapper which works perfectly, Takes screen shots and displays FPS on almost all games of openGL.

I said that I have to copy my wrapper opengl32.dll evertime to the game directory before running a new game so that it shd be loaded instead of the orignal one.
I dont want to copy my wrapper opengl32.dll everytime I run the game.

Now I want to write my wglSwapBuffers Function and when the game runs and loads the openg32.dll I want to replace the orignal wglSwapBuffers with my wglSwapBuffers at runtime and that is Called Hooking.

Now can someone help me ?
I don't believe it can be done without copying the DLL. wglSwapBuffers is in opengl32.dll.

Believe me, even the CS hack community has to copy their DLLs, and if those punks can't figure out a way around that, there very likely isn't one.

You can, however, hook wglSwapBuffers from inside the copied opengl32.dll. Do you want to do that instead?
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
Quote:Original post by Promit
I don't believe it can be done without copying the DLL. wglSwapBuffers is in opengl32.dll.

Believe me, even the CS hack community has to copy their DLLs, and if those punks can't figure out a way around that, there very likely isn't one.

You can, however, hook wglSwapBuffers from inside the copied opengl32.dll. Do you want to do that instead?


Well I think I can prove you wrong. I have done it but 2 3 bugs
around and I will soon write an article on it.

It works beautifully on some games like MOHAA and Heavy Metal - FAKK2 but it crashes with Hitman-I. I am working really hard on it when it is finished I will post the article.

This topic is closed to new replies.

Advertisement