opengl

社区服务
高级搜索
猴岛论坛CSGO反恐精英CS作弊器交流讨论opengl
发帖 回复
倒序阅读 最近浏览的帖子最近浏览的版块
1个回复

opengl

楼层直达
作弊辅导员_h

ZxID:1019634

等级: 元老
定做作弊器
举报 只看楼主 使用道具 楼主   发表于: 2007-06-30 0

Tutorials > OpenGL


Lambert

ok people this is my first tutorial ever 8-)
this tutorial will try and show you how to make your very own vac proof openGL wrapper with Lambert :)
its not much but its a start :)

you will need a C++ compiler for this.
i made and compiled this in Microsoft Visual C++ 6.0
but it should work with other C++ compilers

ok lets get started

start a new win32 Dynamic-Link Library (DLL) and call it what ever you want. you want it to be an empty dll project if it asks you.

right now you want to create a new source file (CPP) in are project and call it "main.ccp" just to keep it simple. now we are going to add are first bit of code to are project :)

we are going to be using OpenGL so it is a good idea to add the library抯 for OpenGL to are project :) so at the top of are "main.ccp" file we add:

#pragma comment(lib, "opengl32.lib")
#pragma comment(lib, "glu32.lib")
#pragma comment(lib, "glaux.lib ")

this tells are compile that we want to use these library抯 in are project. ok now that we have added are OpenGL library抯 we can include some headers to are project, so add to are "main.ccp" file:

#include
#include
#include
#include

ok this adds some header files to are project that we need for are OpenGL and windows fuctions.

right that is are "main.ccp" file done for now :) ok it does not have much in it yet but we will come back to that in a wee bit :)

ok now we need to add another file to are project. this file has lots of "writing" in it and i will save you from copying and pasting it from here and into your project so right click and save target as on http://ploughpro.users.btopenworld.com/files/hack.def

it is only a small file so when you have it put it in the folder that you project is in and add it to your project :)

this file called "hack.def" is full of lot of OpenGL exports. if we want to "hook" a OpenGL function this will be the place to do it :)

ok now in this file we want to find where it says "glVertex3f" coz we want to hook it :) when you find it add this to the end of it "=MYglVertex3f" so now the line will look like this "glVertex3f=MYglVertex3f". wow you have just hooked you first OpenGL function :D
what this has done is it has pointed "glVertex3f" to a function in are DLL file and now we can play around with it 8-)

ok the "=MYglVertex3f" bit means that we are pointing it to a function called "MYglVertex3f" in are project so we want to go back to are "main.ccp" file and add this code to it:

void __stdcall MYglVertex3f(GLfloat x, GLfloat y, GLfloat z)
{
 glColor3f(1.0f,1.0f,1.0f);
 glVertex3f(x,y,z);
}

I will explain what this does now. this means we have made a function called "MyglVertex3f". when a program calls glVertex3f it also sends 3 values to it and they are called x,y,z. we dont need to pay much attention to them yet.

Half-Life calls this function to do things like add shadows to players and a few other things. so if we set the color to white then the players shadows will be white making them see able in dark area抯 on a map :D this is called Lambert.

we set the color to white be doing this: "glColor3f(1.0f,1.0f,1.0f);"
glColor3f takes 3 values (RGB) the first is the red value, second green and third is blue. the values  range from 0.0 to 1.0
if all 3 values are 1.0 it is white and if all 3 are 0.0 it is black. you can play around with these values later to see what i mean :)

after we set are color to white we want to call the real glVertex3f function so it all works :) this is done be doing "glVertex3f(x,y,z);" we also pass are 3 values to it so it all works.

right now we need to add one more thing to the bottom of are "main.ccp" file so are this:

BOOL __stdcall DllMain(HANDLE hInst, DWORD reason, LPVOID p)
{
 if (reason == DLL_PROCESS_ATTACH) 
 {
  //if you need to init anything it would be done here
 }
 return TRUE;
}

this is the first function that is called when the dll is loaded. at the moment we dont need to do any thing with this. sorry i forgot this the first time i typed up this tutorial lol

ok now that you have done all that you can compile your project and you should get a nice error free DLL file :)

right how to use your hack in counter-strike :) you need to download the OGC OpenGL Load. you can get this from the ogc web site or you can download it from http://ploughpro.users.btopenworld.com/files/OGC_OpenGL_Loader.zip rename your DLL to "Xqz2.dll" and put it in the ogc loader folder and start "gl-loader.exe" and when you get into a game you should have Lambert :)

if you have any problems just ask on the forum and I will try and help :)
http://script0rz.cjb.net/
I wish you all the best luck with it

you can download the project if you want from http://ploughpro.users.btopenworld.com/files/OpenGL_Wrapper_Lambert.zip

Plough


Toggle Key

hi people :)

ok in this tutorial i will try and show you how to add a toggle key to your hack. i will be continuing from my first opengl tutorial and adding a toggle key for Lambert

ok lets get started :)

we are going to use "glViewport" to check when a key is being pressed. so first thing we need to do is hook this function. we do this by going to are "Hack.def" file and finding "glViewport" in the list. we then add "=MYglViewport" after it so it now looks like "glViewport=MYglViewport"

once we have done that we go back to are "main.ccp" file. First thing we do here is add two bool variables (these are true/false variables), so at the top of are "main.ccp" file we add:

bool Lambert = false;
bool Last_Key = false;

this makes two variables called "Lambert" and "Last_Key" and sets there value to "false"

ok now we go down to are hooked "glVertex3f" function and we need to add some code to it:

void __stdcall MYglVertex3f(GLfloat x, GLfloat y, GLfloat z)
{
 if(Lambert == true)
 {
  glColor3f(1.0f,1.0f,1.0f);
 }
 glVertex3f(x,y,z);
}

we have added an if statement. this means when are variable "Lambert" equals "true" color the models white other wise dont.

ok now we need to add are hooked "glViewport" function :) so at the bottom of are "main.ccp" file we add:

void __stdcall MYglViewport(GLint x, GLint y, GLsizei width, GLsizei height)  
{
 if((GetAsyncKeyState(VK_END) < 0) && !Last_Key)
 {
  Lambert = !Lambert;
  Last_Key = true;
 }
 else if(!(GetAsyncKeyState(VK_END) < 0))
 {
  Last_Key = false;
 }
 glViewport(x,y,width,height);
}

ok this is are hooked "glViewport" function. "glViewport" takes 4 values but wont dont need to do any thing to them so we pass them along to the real "glViewport" by doing "glViewport(x,y,width,height);". right now in the middle of that we have are code to check if are key is pressed down or not. we do this with a function called "GetAsyncKeyState" and the key we are checking for is "End". If the key is pressed down and "Last_Key" equals "false" we change are variable "Lambert" to its opposite (if Lambert is true it would be come false) and we set "Last_Key" to true. We do this so that we dont switch Lambert on and off from just one key press. So the user needs to lift the "End" key up before he can change it again.


you can find out more about "GetAsyncKeyState" function on the Microsoft site.
if you have any problems with any thing just post below and i will try and help. post your code as well to make it easier for me to help you with.


hope you all do well with this and I hope I have not forgot some thing again this time :)

you can get the source code and the compiled version of this tutorial at http://ploughpro.users.btopenworld.com/files/OpenGL_Wrapper_Lambert.zip

Plough


[此贴子已经被作者于2007-6-29 17:04:34编辑过]
密码被盗,请联系cscheat取回
jiangsao_h

ZxID:1155155

等级: 下士
举报 只看该作者 沙发   发表于: 2007-07-02 0
[em03]做什么用的啊?
« 返回列表
发帖 回复