This tutorial for begginers tells how to make a simple wallhack for CS 1.6 OpenGL engine. We'll be using Ollydbg.
Some base knowledge of OpenGL would help, though I'll try to explain it easy.
Some Skills using Ollydbg are required. We'll need some constants defined in OpenGl library: OpenGL constants in hex
We also need a Counter strike client non steam (don't try pull any of these tricks on steam version!) configured to use opengl engine.
First of all we'll be using an OpenGL function here called glDepthFunc. Let's take a look at function specification
So this function sets the the condition for pixels to pass according to weather the pixel is closer or further to the eye.
This can be used to make the wall solid so you can't see what's behind it. Now launch Ollydbg & CS client. Using Ollydbg attach to the CS process.
If you did'nt end up in hl module once the debugger is paused use "execute till user code" to get to hl module. Once you're
there right click on the main disassembly window and choose "search for" -> "name in all modules" and in the new window find function glDepthFunc.
Right click on the line with our function and toggle breakpoint. Then Run. Now connect to a server or start a new game. You should stop here:
Now disable the breakpoint (in the breakpoints window) and execute till user code. you should stop here:
Notice that the function takes 203 as the one an only argument.
#define GL_NEVER 0x0200 #define GL_LESS 0x0201 #define GL_EQUAL 0x0202 #define GL_LEQUAL 0x0203 #define GL_GREATER 0x0204 #define GL_NOTEQUAL 0x0205 #define GL_GEQUAL 0x0206 #define GL_ALWAYS 0x0207We see that OpenGL is instructed to draw only those pixels that have less or equal depth. Lets change it to GL_ALWAYS = 207. to pass all pixels.