// RegistryInfo.cpp : Defines the entry point for the DLL application.
//
#include "stdafx.h"
#include <stdlib.h>
#include "HookInfo.h"
#include <gl/gl.h>
#pragma comment ( lib , "Opengl32.lib" )
int _stdcall Export()
{
return 0;
}
typedef void(WINAPI * MYGLBEGIN)(DWORD mode);
MYGLBEGIN MyglBegin = NULL;
///////////////////////////////////////////////////////////////////
////////////////////回调函数///////////////////////////////////////
void WINAPI MYglBeginCallback(DWORD mode);
/////////////////////////////////
CHookInfo *ChookMyglBegin;
HINSTANCE m_hinstDll;
HWND m_hWnd;
DWORD m_ProcessId;
//初始NT系列的函数
VOID LoadNtDll()
{
HMODULE hMod = LoadLibrary("opengl32.dll");
MyglBegin = (MYGLBEGIN)GetProcAddress(hMod,"glBegin"); //得到某个Nt函数地址
FreeLibrary(hMod);
}
//DLL入口点函数
BOOL APIENTRY DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
m_hinstDll=hInstance;
if (dwReason == DLL_PROCESS_ATTACH)
{
LoadNtDll();
if (GetCurrentProcessId()!=0)
{
ChookMyglBegin = new CHookInfo("opengl32.dll","glBegin",(DWORD)MYglBeginCallback);
}
}
else if (dwReason == DLL_PROCESS_DETACH)
{
if (GetCurrentProcessId()==m_ProcessId)
{
delete ChookMyglBegin;
}
}
return TRUE; // ok
}
//MytextoutA的回调函数
void APIENTRY MYglBeginCallback(DWORD mode )
{
switch (mode) //wall不透明
{
if (mode == GL_TRIANGLE_STRIP || mode == GL_TRIANGLE_FAN || mode== GL_TRIANGLES)
{
glDepthRange( 0, 0.5);
// (*p_fnglDisable)(GL_DEPTH_TEST);
}else
{
glDepthRange( 0.5, 1);
glBegin(mode);
}
break;
break;
case 2:
break;
default:
break;
}
}
代码写的简单啊,可是就达不到透视效果,到CS里面是满屏红色的
我就要个简单的透视就行啊。
求指点迷津
[课程]FART 脱壳王!加量不加价!FART作者讲授!