Intente compilarla con Visual C++ 6.0, con Dev C++ y hasta con ASM... pero nada, siempre me tira errores.. me gustaria que alguien me enseñe xq juro q no me acuerdo nada.. jaja..
Por cierto, estaria bueno hacer un manual de como crear un cheat de 0, xq los post q hay aca no estan taaann claros de como empezarlo (para alguien novato)... yo x suerte entendi y arranke a armarme los cheats... (obvio sin pasar el sxe, xq todavia no se me dio x eso), pero me costo bastante entender.. je.. x eso seria bueno si alguien podria hacer un manual de hasta q codigos van en los .cpp y los .h , etc je.
Si alguien es amable y me ayuda, se lo agradezco de corazon, ayudenme a compilar este codigo fuente...
asi ya empiezo a armar mis cheats y estudiar para tratar de pasar el sxe...
ahora q tengo tiempo je...
aca esa el codigo
Citar
#define _WIN32_WINNT 0x0500
#include <windows.h>
#include <shlwapi.h>
#include <stdio.h>
#include <sys/stat.h>
#include <gl/gl.h>
#include <gl/glu.h>
//#include "wallhack.h" //redefine resources
typedef void (WINAPI *TBE)(GLuint);
typedef void (WINAPI *TGLED)(GLenum);
typedef void (WINAPI *TGFV)(GLenum,GLfloat *);
typedef void (WINAPI *TC3F)(GLfloat,GLfloat,GLfloat);
typedef void (WINAPI *TC4F)(GLfloat,GLfloat,GLfloat,GLfloat);
typedef void (WINAPI *TV2F)(GLfloat,GLfloat);
typedef void (WINAPI *TV3F)(GLfloat x, GLfloat y, GLfloat z);
typedef void (WINAPI *TV3FV)(const GLfloat *v);
typedef void (WINAPI *TC)(GLbitfield);
typedef void (WINAPI *TCC)(GLclampf,GLclampf,GLclampf,GLclampf);
typedef void (WINAPI *TBF)(GLenum,GLenum);
typedef void (WINAPI *TTE)(GLenum,GLenum,GLenum);
typedef void (WINAPI *TVP)(GLint,GLint,GLsizei,GLsizei);
typedef void (WINAPI *TPM)(void);
typedef void (WINAPI *TGIV)(GLenum,GLint*);
typedef void (WINAPI *TLW)(GLfloat);
typedef void (WINAPI *TV2I)(GLint,GLint);
typedef PVOID (*TGEBI)(int);
typedef struct _cheat_cfg{
BOOL bWall;
BOOL bWhiteWalls;
BOOL bNoSmoke;
BOOL bNoFlash;
BOOL bNoSky;
BOOL bLambert;
BOOL bFullbright;
BOOL bExtraCrosshair;
}cheat_cfg,*pcheat_cfg;
typedef struct PACKED _UserMgsList{
DWORD unknown1,unknown2;
CHAR msgname[16];
struct _UserMgsList *next;
DWORD address;
}UserMgsList,*PUserMgsList;
HANDLE hThread=NULL;WNDPROC pHLWndProc=NULL;HMENU hMenu=NULL;
TGFV pglGetFloatv;TV3FV pglVertex3fv;TLW pglLineWidth;
TV2F pglVertex2f;TC3F pglColor3f;TC4F pglColor4f;
TC pglClear;TCC pglClearColor;TV3F pglVertex3f;
TBE pglBegin,pglEnd;TGLED pglEnable,pglDisable;
TBF pglBlendFunc;TTE pglTexEnvi;TV2I pglVertex2i;
TPM pglPushMatrix,pglPopMatrix;TGIV pglGetIntegerv;
TGEBI pGetEntityByIndex;
BOOL bSmoke=FALSE,bSky=FALSE,bFlash=FALSE,bTex=FALSE,bDisabled=FALSE;
cheat_cfg cfg={FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE};
void *DetourFunc(BYTE *src, const BYTE *dst, const int len,const int type){
PBYTE jmp;DWORD dwback;
if(src&&*src==0xE9){
if(type==1)
src=(src+*(PDWORD)(src+1)+5)+34;//SXE HOOK Offset1
else
src=(src+*(PDWORD)(src+1)+5)+57;//SXE HOOK Offset2
//rare hook
jmp=(PBYTE)malloc(len+5);
while(!VirtualProtect(src,len+5,PAGE_READWRITE,&dwback));
memcpy(jmp,src,len);jmp+=len;
jmp[0] = 0xE9;
*(DWORD*)(jmp+1)=(DWORD)(*(DWORD*)(src+len+1)-(DWORD)jmp)-5;
*(DWORD*)(src+len+1)=(DWORD)dst;
while(!VirtualProtect(src,len+5,dwback,&dwback));
return (jmp-len);
}
return NULL;
}
PBYTE GetRealAddress(PBYTE pf,BYTE offset){
if(*pf==0xE9)pf=(pf+*(PDWORD)(pf+1)+5)+offset;
return pf;
}
void *GetProcAddress2(HMODULE hModule,char *func){
PBYTE pf=(PBYTE)GetProcAddress(hModule,func);
return GetRealAddress(pf,34);//SXE HOOK Offset
}
void *GetProcAddress3(HMODULE hModule,char *func){
PBYTE pf=(PBYTE)GetProcAddress(hModule,func);
return GetRealAddress(pf,57);//SXE HOOK Offset
}
void WINAPI hglBegin(GLenum mode){
float col[4];
if(!bDisabled){
switch(cfg.bWall){
case 1:
if(mode==GL_TRIANGLE_STRIP||mode==GL_TRIANGLE_FAN)
pglDisable(GL_DEPTH_TEST);
else if(mode!=GL_QUADS&&mode!=GL_LINES)
pglEnable(GL_DEPTH_TEST);
break;
case 2:
if(!(mode==GL_TRIANGLE_STRIP||mode==GL_TRIANGLE_FAN||mode==GL_QUADS)){
pglGetFloatv(GL_CURRENT_COLOR, col);
pglDisable(GL_DEPTH_TEST);
pglEnable(GL_BLEND);
pglBlendFunc(GL_ONE_MINUS_SRC_ALPHA, GL_SRC_ALPHA_SATURATE);
pglColor4f(col[0], col[1], col[2],.667f);
}else
if(mode==GL_TRIANGLES || mode==GL_TRIANGLE_STRIP || mode==GL_TRIANGLE_FAN){
pglEnable(GL_DEPTH_TEST);
pglDisable(GL_BLEND);
}
break;
default:break;
}
if(!(mode==GL_TRIANGLES||mode==GL_TRIANGLE_STRIP||mode==GL_TRIANGLE_FAN||mode==GL_QUADS)){
if(cfg.bWhiteWalls)
pglTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_DECAL);
if(cfg.bFullbright&&bTex)
pglDisable(GL_TEXTURE_2D);
}
if(mode==GL_QUADS){
if(cfg.bNoFlash||cfg.bNoSmoke){
pglGetFloatv(GL_CURRENT_COLOR, col);
bSmoke = (col[0] == col[1] && col[0] == col[2] && col[0] != 0.0 && col[0] != 1.0);
bFlash = (col[0] >= 0.80 && col[1] >= 0.80 && col[2] >= 0.80 && col[3] > 0.2);//AntiFlash Fix (:S)
//bFlash = (col[0] == 1.0 && col[1] == 1.0 && col[2] == 1.0 && col[3] > 0.2);
}
bSky=TRUE;
}else
bSky=FALSE;
}
pglBegin(mode);
}
void WINAPI hglVertex3fv(const GLfloat *v){
if(!bDisabled){
if(bSmoke)return;
if((cfg.bWall==2||cfg.bNoSky)&&bSky)return;
}
pglVertex3fv(v);
}
void WINAPI hglVertex2f(GLfloat x, GLfloat y){
if(!bDisabled&&bFlash&&x==0.0&&y==0.0)
pglColor4f(1.0f, 1.0f, 1.0f, 0.2f);
pglVertex2f(x, y);
}
void WINAPI hglVertex3f(GLfloat x, GLfloat y, GLfloat z){
if(!bDisabled&&cfg.bLambert)
pglColor3f(1.0f,1.0f,1.0f);
pglVertex3f(x,y,z);
}
void WINAPI hglClear(GLbitfield mask){
if(!bDisabled&&mask==GL_DEPTH_BUFFER_BIT){
mask+=GL_COLOR_BUFFER_BIT;
pglClearColor(0.0f, 0.0f, 0.0f, 0.0f);
}
pglClear(mask);
}
void WINAPI hglDisable(GLenum mode){
if(!bDisabled&&mode==GL_TEXTURE_2D)bTex=FALSE;
pglDisable(mode);
}
#ifdef __GNUC__
PVOID hGetEntityByIndex(int index);//ONLY GCC, VC NOT IMPLEMENTED
asm(
".globl _hGetEntityByIndex\n"
"_hGetEntityByIndex:\n"
"pop %eax;\n\t"
"xor $0xFF,%eax;\n\t"
"mov %eax,0x8(%esp);\n\t"
"jmp *_pGetEntityByIndex;\n\t"
);
#else
//VC Implementation
#endif
LRESULT CALLBACK NewHLWndProc(HWND hWnd,UINT uMsg,WPARAM wParam, LPARAM lParam){
BOOL bCallDefault=TRUE;LRESULT result=0;BYTE ct;
switch(uMsg){
case WM_COMMAND:
switch(wParam){
case IDM_NONE:case IDM_XQZ:case IDM_ASUS:
cfg.bWall=wParam-IDM_NONE;
break;
case IDM_NOSMOKE:
cfg.bNoSmoke=!cfg.bNoSmoke;
break;
case IDM_NOFLASH:
cfg.bNoFlash=!cfg.bNoFlash;
break;
case IDM_NOSKY:
cfg.bNoSky=!cfg.bNoSky;
break;
case IDM_LAMBERT:
cfg.bLambert=!cfg.bLambert;
break;
case IDM_FULLBRIGHT:
cfg.bFullbright=!cfg.bFullbright;
if(cfg.bFullbright&&cfg.bWhiteWalls)
cfg.bWhiteWalls=!cfg.bWhiteWalls;
break;
case IDM_WHITEWALLS:
cfg.bWhiteWalls=!cfg.bWhiteWalls;
if(cfg.bWhiteWalls&&cfg.bFullbright)
cfg.bFullbright=!cfg.bFullbright;
break;
case IDM_DISABLE:
bDisabled=!bDisabled;
break;
default:break;
}
break;
case WM_KEYDOWN:
switch (wParam){
case VK_F3:
bDisabled=!bDisabled;
break;
case VK_F4:
for(ct=0;ct<3;ct++)
CheckMenuItem(hMenu,IDM_NONE+ct,MF_BYCOMMAND|((cfg.bWall==ct)?MF_CHECKED:MF_UNCHECKED));
CheckMenuItem(hMenu,IDM_NOSMOKE,MF_BYCOMMAND|(cfg.bNoSmoke?MF_CHECKED:MF_UNCHECKED));
CheckMenuItem(hMenu,IDM_NOFLASH,MF_BYCOMMAND|(cfg.bNoFlash?MF_CHECKED:MF_UNCHECKED));
CheckMenuItem(hMenu,IDM_NOSKY,MF_BYCOMMAND|(cfg.bNoSky?MF_CHECKED:MF_UNCHECKED));
CheckMenuItem(hMenu,IDM_LAMBERT,MF_BYCOMMAND|(cfg.bLambert?MF_CHECKED:MF_UNCHECKED));
CheckMenuItem(hMenu,IDM_FULLBRIGHT,MF_BYCOMMAND|(cfg.bFullbright?MF_CHECKED:MF_UNCHECKED));
CheckMenuItem(hMenu,IDM_WHITEWALLS,MF_BYCOMMAND|(cfg.bWhiteWalls?MF_CHECKED:MF_UNCHECKED));
if(bDisabled)
ModifyMenu(hMenu,IDM_DISABLE,MF_BYCOMMAND|MF_STRING,IDM_DISABLE,"Enable");
else
ModifyMenu(hMenu,IDM_DISABLE,MF_BYCOMMAND|MF_STRING,IDM_DISABLE,"Disable");
TrackPopupMenu(GetSubMenu(hMenu,0),TPM_LEFTALIGN|TPM_TOPALIGN|TPM_HORIZONTAL|TPM_VERTICAL,100,100,0,hWnd,NULL);
break;
default:break;
}
break;
default:break;
}
if(bCallDefault)
return CallWindowProc(pHLWndProc, hWnd, uMsg, wParam, lParam);
return result;
}
DWORD SetUserMsgHook(PBYTE address,PCHAR name,DWORD address2){
PUserMgsList uml=*(PUserMgsList*)(*(PDWORD)(((address+=0x1A)+*(PDWORD)(address+1)+5)+0x0D));
while(uml){
if(!strncmp(uml->msgname,name,16)){
uml->address=address2;
return TRUE;
}
uml=uml->next;
}
return FALSE;
}
static int MysXeSS(const char *pszName, int iSize, void *pbuf){
return 0;
}
DLLEXPORT VOID Init(){//DisableSS
DWORD address=0x1d0d450;//gEngfuncs.pfnHookUserMsg
if(address)
SetUserMsgHook((PBYTE)address,"sXe-SS",(DWORD)MysXeSS);
}
DWORD WINAPI HookOpenGL(LPVOID lpParam){
DWORD dwThreadId,dwProcessId;
HWND hdHalfLife;HMODULE hModule;
while(
((hdHalfLife=FindWindow("Valve001",NULL))==NULL)&&
((hdHalfLife=FindWindow(NULL,"Counter-Strike"))==NULL)
)Sleep(100);
while((hModule=GetModuleHandle("opengl32.dll"))==NULL)Sleep(100);
dwThreadId=GetWindowThreadProcessId(hdHalfLife,&dwProcessId);
HANDLE hThread=OpenThread(THREAD_GET_CONTEXT|THREAD_SUSPEND_RESUME|THREAD_QUERY_INFORMATION,FALSE,dwThreadId);
if(!hThread){
CloseHandle(hThread);
ExitThread(0);
return 0;
}
MessageBox(hdHalfLife,"www.inexinferis.com.ar","Inexinferis Lite 2 - SXE 9.0",0);
SuspendThread(hThread);
Init();
pHLWndProc=(WNDPROC)SetWindowLongPtr(hdHalfLife,GWLP_WNDPROC,(INT_PTR)NewHLWndProc);
pglGetFloatv=(TGFV)GetProcAddress2(hModule,"glGetFloatv");
pglColor3f=(TC3F)GetProcAddress2(hModule,"glColor3f");
pglColor4f=(TC4F)GetProcAddress2(hModule,"glColor4f");
pglClearColor=(TCC)GetProcAddress2(hModule,"glClearColor");
pglBlendFunc=(TBF)GetProcAddress2(hModule,"glBlendFunc");
pglTexEnvi=(TTE)GetProcAddress2(hModule,"glTexEnvi");
pglPushMatrix=(TPM)GetProcAddress3(hModule,"glPushMatrix");
pglPopMatrix=(TPM)GetProcAddress3(hModule,"glPopMatrix");
pglEnd=(TBE)GetProcAddress2(hModule,"glEnd");
pglGetIntegerv=(TGIV)GetProcAddress2(hModule,"glGetIntegerv");
pglLineWidth=(TLW)GetProcAddress2(hModule,"glLineWidth");
pglVertex2i=(TV2I)GetProcAddress2(hModule,"glVertex2i");
pglEnable=(TGLED)GetProcAddress2(hModule,"glEnable");
pglDisable=(TGLED)DetourFunc((PBYTE)GetProcAddress(hModule,"glDisable"),(PBYTE)hglDisable,6,1);
pglVertex3f=(TV3F)DetourFunc((PBYTE)GetProcAddress(hModule,"glVertex3f"),(PBYTE)hglVertex3f,6,1);
pglVertex3fv=(TV3FV)DetourFunc((PBYTE)GetProcAddress(hModule,"glVertex3fv"),(PBYTE)hglVertex3fv,6,1);
pglBegin=(TBE)DetourFunc((PBYTE)GetProcAddress(hModule,"glBegin"),(PBYTE)hglBegin,6,1);
pglVertex2f=(TV2F)DetourFunc((PBYTE)GetProcAddress(hModule,"glVertex2f"),(PBYTE)hglVertex2f,6,1);
pglClear=(TC)DetourFunc((PBYTE)GetProcAddress(hModule,"glClear"),(PBYTE)hglClear,7,2);
//anti-anti-wallhack... GetEntityByIndex
#ifdef __GNUC__
pGetEntityByIndex=(TGEBI)DetourFunc((PBYTE)0x01D0ECC0,(PBYTE)hGetEntityByIndex,5,2);
#else
//VC Implementation
#endif
ResumeThread(hThread);
CloseHandle(hThread);
ExitThread(0);
return 0;
}
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, LPVOID lpvReserved){
if(fdwReason==DLL_PROCESS_ATTACH){
hMenu=LoadMenu(hInstance,MAKEINTRESOURCE(IDR_WALLMENU));
hThread=CreateThread(NULL,0,HookOpenGL,NULL,0,NULL);
}
if(fdwReason==DLL_PROCESS_DETACH){
TerminateThread(hThread,0);
DestroyMenu(hMenu);
}
return TRUE;
#include <windows.h>
#include <shlwapi.h>
#include <stdio.h>
#include <sys/stat.h>
#include <gl/gl.h>
#include <gl/glu.h>
//#include "wallhack.h" //redefine resources
typedef void (WINAPI *TBE)(GLuint);
typedef void (WINAPI *TGLED)(GLenum);
typedef void (WINAPI *TGFV)(GLenum,GLfloat *);
typedef void (WINAPI *TC3F)(GLfloat,GLfloat,GLfloat);
typedef void (WINAPI *TC4F)(GLfloat,GLfloat,GLfloat,GLfloat);
typedef void (WINAPI *TV2F)(GLfloat,GLfloat);
typedef void (WINAPI *TV3F)(GLfloat x, GLfloat y, GLfloat z);
typedef void (WINAPI *TV3FV)(const GLfloat *v);
typedef void (WINAPI *TC)(GLbitfield);
typedef void (WINAPI *TCC)(GLclampf,GLclampf,GLclampf,GLclampf);
typedef void (WINAPI *TBF)(GLenum,GLenum);
typedef void (WINAPI *TTE)(GLenum,GLenum,GLenum);
typedef void (WINAPI *TVP)(GLint,GLint,GLsizei,GLsizei);
typedef void (WINAPI *TPM)(void);
typedef void (WINAPI *TGIV)(GLenum,GLint*);
typedef void (WINAPI *TLW)(GLfloat);
typedef void (WINAPI *TV2I)(GLint,GLint);
typedef PVOID (*TGEBI)(int);
typedef struct _cheat_cfg{
BOOL bWall;
BOOL bWhiteWalls;
BOOL bNoSmoke;
BOOL bNoFlash;
BOOL bNoSky;
BOOL bLambert;
BOOL bFullbright;
BOOL bExtraCrosshair;
}cheat_cfg,*pcheat_cfg;
typedef struct PACKED _UserMgsList{
DWORD unknown1,unknown2;
CHAR msgname[16];
struct _UserMgsList *next;
DWORD address;
}UserMgsList,*PUserMgsList;
HANDLE hThread=NULL;WNDPROC pHLWndProc=NULL;HMENU hMenu=NULL;
TGFV pglGetFloatv;TV3FV pglVertex3fv;TLW pglLineWidth;
TV2F pglVertex2f;TC3F pglColor3f;TC4F pglColor4f;
TC pglClear;TCC pglClearColor;TV3F pglVertex3f;
TBE pglBegin,pglEnd;TGLED pglEnable,pglDisable;
TBF pglBlendFunc;TTE pglTexEnvi;TV2I pglVertex2i;
TPM pglPushMatrix,pglPopMatrix;TGIV pglGetIntegerv;
TGEBI pGetEntityByIndex;
BOOL bSmoke=FALSE,bSky=FALSE,bFlash=FALSE,bTex=FALSE,bDisabled=FALSE;
cheat_cfg cfg={FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE};
void *DetourFunc(BYTE *src, const BYTE *dst, const int len,const int type){
PBYTE jmp;DWORD dwback;
if(src&&*src==0xE9){
if(type==1)
src=(src+*(PDWORD)(src+1)+5)+34;//SXE HOOK Offset1
else
src=(src+*(PDWORD)(src+1)+5)+57;//SXE HOOK Offset2
//rare hook
jmp=(PBYTE)malloc(len+5);
while(!VirtualProtect(src,len+5,PAGE_READWRITE,&dwback));
memcpy(jmp,src,len);jmp+=len;
jmp[0] = 0xE9;
*(DWORD*)(jmp+1)=(DWORD)(*(DWORD*)(src+len+1)-(DWORD)jmp)-5;
*(DWORD*)(src+len+1)=(DWORD)dst;
while(!VirtualProtect(src,len+5,dwback,&dwback));
return (jmp-len);
}
return NULL;
}
PBYTE GetRealAddress(PBYTE pf,BYTE offset){
if(*pf==0xE9)pf=(pf+*(PDWORD)(pf+1)+5)+offset;
return pf;
}
void *GetProcAddress2(HMODULE hModule,char *func){
PBYTE pf=(PBYTE)GetProcAddress(hModule,func);
return GetRealAddress(pf,34);//SXE HOOK Offset
}
void *GetProcAddress3(HMODULE hModule,char *func){
PBYTE pf=(PBYTE)GetProcAddress(hModule,func);
return GetRealAddress(pf,57);//SXE HOOK Offset
}
void WINAPI hglBegin(GLenum mode){
float col[4];
if(!bDisabled){
switch(cfg.bWall){
case 1:
if(mode==GL_TRIANGLE_STRIP||mode==GL_TRIANGLE_FAN)
pglDisable(GL_DEPTH_TEST);
else if(mode!=GL_QUADS&&mode!=GL_LINES)
pglEnable(GL_DEPTH_TEST);
break;
case 2:
if(!(mode==GL_TRIANGLE_STRIP||mode==GL_TRIANGLE_FAN||mode==GL_QUADS)){
pglGetFloatv(GL_CURRENT_COLOR, col);
pglDisable(GL_DEPTH_TEST);
pglEnable(GL_BLEND);
pglBlendFunc(GL_ONE_MINUS_SRC_ALPHA, GL_SRC_ALPHA_SATURATE);
pglColor4f(col[0], col[1], col[2],.667f);
}else
if(mode==GL_TRIANGLES || mode==GL_TRIANGLE_STRIP || mode==GL_TRIANGLE_FAN){
pglEnable(GL_DEPTH_TEST);
pglDisable(GL_BLEND);
}
break;
default:break;
}
if(!(mode==GL_TRIANGLES||mode==GL_TRIANGLE_STRIP||mode==GL_TRIANGLE_FAN||mode==GL_QUADS)){
if(cfg.bWhiteWalls)
pglTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_DECAL);
if(cfg.bFullbright&&bTex)
pglDisable(GL_TEXTURE_2D);
}
if(mode==GL_QUADS){
if(cfg.bNoFlash||cfg.bNoSmoke){
pglGetFloatv(GL_CURRENT_COLOR, col);
bSmoke = (col[0] == col[1] && col[0] == col[2] && col[0] != 0.0 && col[0] != 1.0);
bFlash = (col[0] >= 0.80 && col[1] >= 0.80 && col[2] >= 0.80 && col[3] > 0.2);//AntiFlash Fix (:S)
//bFlash = (col[0] == 1.0 && col[1] == 1.0 && col[2] == 1.0 && col[3] > 0.2);
}
bSky=TRUE;
}else
bSky=FALSE;
}
pglBegin(mode);
}
void WINAPI hglVertex3fv(const GLfloat *v){
if(!bDisabled){
if(bSmoke)return;
if((cfg.bWall==2||cfg.bNoSky)&&bSky)return;
}
pglVertex3fv(v);
}
void WINAPI hglVertex2f(GLfloat x, GLfloat y){
if(!bDisabled&&bFlash&&x==0.0&&y==0.0)
pglColor4f(1.0f, 1.0f, 1.0f, 0.2f);
pglVertex2f(x, y);
}
void WINAPI hglVertex3f(GLfloat x, GLfloat y, GLfloat z){
if(!bDisabled&&cfg.bLambert)
pglColor3f(1.0f,1.0f,1.0f);
pglVertex3f(x,y,z);
}
void WINAPI hglClear(GLbitfield mask){
if(!bDisabled&&mask==GL_DEPTH_BUFFER_BIT){
mask+=GL_COLOR_BUFFER_BIT;
pglClearColor(0.0f, 0.0f, 0.0f, 0.0f);
}
pglClear(mask);
}
void WINAPI hglDisable(GLenum mode){
if(!bDisabled&&mode==GL_TEXTURE_2D)bTex=FALSE;
pglDisable(mode);
}
#ifdef __GNUC__
PVOID hGetEntityByIndex(int index);//ONLY GCC, VC NOT IMPLEMENTED
asm(
".globl _hGetEntityByIndex\n"
"_hGetEntityByIndex:\n"
"pop %eax;\n\t"
"xor $0xFF,%eax;\n\t"
"mov %eax,0x8(%esp);\n\t"
"jmp *_pGetEntityByIndex;\n\t"
);
#else
//VC Implementation
#endif
LRESULT CALLBACK NewHLWndProc(HWND hWnd,UINT uMsg,WPARAM wParam, LPARAM lParam){
BOOL bCallDefault=TRUE;LRESULT result=0;BYTE ct;
switch(uMsg){
case WM_COMMAND:
switch(wParam){
case IDM_NONE:case IDM_XQZ:case IDM_ASUS:
cfg.bWall=wParam-IDM_NONE;
break;
case IDM_NOSMOKE:
cfg.bNoSmoke=!cfg.bNoSmoke;
break;
case IDM_NOFLASH:
cfg.bNoFlash=!cfg.bNoFlash;
break;
case IDM_NOSKY:
cfg.bNoSky=!cfg.bNoSky;
break;
case IDM_LAMBERT:
cfg.bLambert=!cfg.bLambert;
break;
case IDM_FULLBRIGHT:
cfg.bFullbright=!cfg.bFullbright;
if(cfg.bFullbright&&cfg.bWhiteWalls)
cfg.bWhiteWalls=!cfg.bWhiteWalls;
break;
case IDM_WHITEWALLS:
cfg.bWhiteWalls=!cfg.bWhiteWalls;
if(cfg.bWhiteWalls&&cfg.bFullbright)
cfg.bFullbright=!cfg.bFullbright;
break;
case IDM_DISABLE:
bDisabled=!bDisabled;
break;
default:break;
}
break;
case WM_KEYDOWN:
switch (wParam){
case VK_F3:
bDisabled=!bDisabled;
break;
case VK_F4:
for(ct=0;ct<3;ct++)
CheckMenuItem(hMenu,IDM_NONE+ct,MF_BYCOMMAND|((cfg.bWall==ct)?MF_CHECKED:MF_UNCHECKED));
CheckMenuItem(hMenu,IDM_NOSMOKE,MF_BYCOMMAND|(cfg.bNoSmoke?MF_CHECKED:MF_UNCHECKED));
CheckMenuItem(hMenu,IDM_NOFLASH,MF_BYCOMMAND|(cfg.bNoFlash?MF_CHECKED:MF_UNCHECKED));
CheckMenuItem(hMenu,IDM_NOSKY,MF_BYCOMMAND|(cfg.bNoSky?MF_CHECKED:MF_UNCHECKED));
CheckMenuItem(hMenu,IDM_LAMBERT,MF_BYCOMMAND|(cfg.bLambert?MF_CHECKED:MF_UNCHECKED));
CheckMenuItem(hMenu,IDM_FULLBRIGHT,MF_BYCOMMAND|(cfg.bFullbright?MF_CHECKED:MF_UNCHECKED));
CheckMenuItem(hMenu,IDM_WHITEWALLS,MF_BYCOMMAND|(cfg.bWhiteWalls?MF_CHECKED:MF_UNCHECKED));
if(bDisabled)
ModifyMenu(hMenu,IDM_DISABLE,MF_BYCOMMAND|MF_STRING,IDM_DISABLE,"Enable");
else
ModifyMenu(hMenu,IDM_DISABLE,MF_BYCOMMAND|MF_STRING,IDM_DISABLE,"Disable");
TrackPopupMenu(GetSubMenu(hMenu,0),TPM_LEFTALIGN|TPM_TOPALIGN|TPM_HORIZONTAL|TPM_VERTICAL,100,100,0,hWnd,NULL);
break;
default:break;
}
break;
default:break;
}
if(bCallDefault)
return CallWindowProc(pHLWndProc, hWnd, uMsg, wParam, lParam);
return result;
}
DWORD SetUserMsgHook(PBYTE address,PCHAR name,DWORD address2){
PUserMgsList uml=*(PUserMgsList*)(*(PDWORD)(((address+=0x1A)+*(PDWORD)(address+1)+5)+0x0D));
while(uml){
if(!strncmp(uml->msgname,name,16)){
uml->address=address2;
return TRUE;
}
uml=uml->next;
}
return FALSE;
}
static int MysXeSS(const char *pszName, int iSize, void *pbuf){
return 0;
}
DLLEXPORT VOID Init(){//DisableSS
DWORD address=0x1d0d450;//gEngfuncs.pfnHookUserMsg
if(address)
SetUserMsgHook((PBYTE)address,"sXe-SS",(DWORD)MysXeSS);
}
DWORD WINAPI HookOpenGL(LPVOID lpParam){
DWORD dwThreadId,dwProcessId;
HWND hdHalfLife;HMODULE hModule;
while(
((hdHalfLife=FindWindow("Valve001",NULL))==NULL)&&
((hdHalfLife=FindWindow(NULL,"Counter-Strike"))==NULL)
)Sleep(100);
while((hModule=GetModuleHandle("opengl32.dll"))==NULL)Sleep(100);
dwThreadId=GetWindowThreadProcessId(hdHalfLife,&dwProcessId);
HANDLE hThread=OpenThread(THREAD_GET_CONTEXT|THREAD_SUSPEND_RESUME|THREAD_QUERY_INFORMATION,FALSE,dwThreadId);
if(!hThread){
CloseHandle(hThread);
ExitThread(0);
return 0;
}
MessageBox(hdHalfLife,"www.inexinferis.com.ar","Inexinferis Lite 2 - SXE 9.0",0);
SuspendThread(hThread);
Init();
pHLWndProc=(WNDPROC)SetWindowLongPtr(hdHalfLife,GWLP_WNDPROC,(INT_PTR)NewHLWndProc);
pglGetFloatv=(TGFV)GetProcAddress2(hModule,"glGetFloatv");
pglColor3f=(TC3F)GetProcAddress2(hModule,"glColor3f");
pglColor4f=(TC4F)GetProcAddress2(hModule,"glColor4f");
pglClearColor=(TCC)GetProcAddress2(hModule,"glClearColor");
pglBlendFunc=(TBF)GetProcAddress2(hModule,"glBlendFunc");
pglTexEnvi=(TTE)GetProcAddress2(hModule,"glTexEnvi");
pglPushMatrix=(TPM)GetProcAddress3(hModule,"glPushMatrix");
pglPopMatrix=(TPM)GetProcAddress3(hModule,"glPopMatrix");
pglEnd=(TBE)GetProcAddress2(hModule,"glEnd");
pglGetIntegerv=(TGIV)GetProcAddress2(hModule,"glGetIntegerv");
pglLineWidth=(TLW)GetProcAddress2(hModule,"glLineWidth");
pglVertex2i=(TV2I)GetProcAddress2(hModule,"glVertex2i");
pglEnable=(TGLED)GetProcAddress2(hModule,"glEnable");
pglDisable=(TGLED)DetourFunc((PBYTE)GetProcAddress(hModule,"glDisable"),(PBYTE)hglDisable,6,1);
pglVertex3f=(TV3F)DetourFunc((PBYTE)GetProcAddress(hModule,"glVertex3f"),(PBYTE)hglVertex3f,6,1);
pglVertex3fv=(TV3FV)DetourFunc((PBYTE)GetProcAddress(hModule,"glVertex3fv"),(PBYTE)hglVertex3fv,6,1);
pglBegin=(TBE)DetourFunc((PBYTE)GetProcAddress(hModule,"glBegin"),(PBYTE)hglBegin,6,1);
pglVertex2f=(TV2F)DetourFunc((PBYTE)GetProcAddress(hModule,"glVertex2f"),(PBYTE)hglVertex2f,6,1);
pglClear=(TC)DetourFunc((PBYTE)GetProcAddress(hModule,"glClear"),(PBYTE)hglClear,7,2);
//anti-anti-wallhack... GetEntityByIndex
#ifdef __GNUC__
pGetEntityByIndex=(TGEBI)DetourFunc((PBYTE)0x01D0ECC0,(PBYTE)hGetEntityByIndex,5,2);
#else
//VC Implementation
#endif
ResumeThread(hThread);
CloseHandle(hThread);
ExitThread(0);
return 0;
}
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, LPVOID lpvReserved){
if(fdwReason==DLL_PROCESS_ATTACH){
hMenu=LoadMenu(hInstance,MAKEINTRESOURCE(IDR_WALLMENU));
hThread=CreateThread(NULL,0,HookOpenGL,NULL,0,NULL);
}
if(fdwReason==DLL_PROCESS_DETACH){
TerminateThread(hThread,0);
DestroyMenu(hMenu);
}
return TRUE;
abrazos amigos,