glBindTexture useless ingame (esi trick)

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

Liduen

Hacker
Dank Tier VIP
May 19, 2013
702
8,478
33
So I hooked glBindTexture to use the esi trick to get the texture path and name of all the shaders.
C++:
DWORD currentTexture;
__asm mov currentTexture, esi
if(currentTexture> 0x1000) _cprintf("%s\n", (char*)currentTexture);
I do this to find the player textures and then disable the depth check in glDrawElements after they got binded in glBindTexture.

When loading the map the first time, all the textures get loaded and I see everything in the console.
But after that the only thing which gets moved to glBindTextures seems to be "*lightmap_xyz", _xyz being a random number.

What's wrong?

Thanks,
Liduen
 

till0sch

Respected Hacker
Dank Tier VIP
Dank Tier Donator
Oct 14, 2012
1,104
12,593
51
void HookFunction(int address,int jumpTo,int lengthOfCode)
{
BYTE HOOK;
int HOOKTMP;

HOOK = 0xE9; // what we know already..
jumpTo-=address;
jumpTo-=5; // JMP length
WriteProcessMemory(GetCurrentProcess(),(LPVOID)address,&HOOK,1,0);
WriteProcessMemory(GetCurrentProcess(),(LPVOID)(address+1),&jumpTo,4,0);
HOOK=0x90;
for(int i=0;i<lengthOfCode-5;i++)
{
WriteProcessMemory(GetCurrentProcess(),(LPVOID)(address+0x5+i),&HOOK,1,0);
}
}


try this because there u know what it does
 

Liduen

Hacker
Dank Tier VIP
May 19, 2013
702
8,478
33
Thanks for all the help and the links! :) till0sch97 Krampus Keddy
I'm using a hooking method from some tutorial I read some time ago and the hook isn't the problem I think.
- - - - - - - - - - -
I fixed the esi problem but now I have trouble to draw my chams. ^^
Later I have to check if the id's stay the same all the time...

Somehow all the textures only get pushed to the glBindTexture function at level startup and not during the gameplay.
Therefore you can't check the textur name in glDrawElements to do your wallhack.
Simply log all texture paths and names PLUS their id's (see the parameter list of glBindTexture(GLuint textur))once at level startup and search for the ones you want to apply your wallhack to.
Then you can hardcode and use the ids in glDrawElements to check wether the specific models gets drawn. Atleast this is working for me until now. ^^
Apply your wallhack:
C++:
glDepthRange(0, 0.5);
glDrawElements(mode, count, type, indices); // original glDrawElements!
glDepthRange(0.5, 1);

How do I color the models according to their visibility?

I tried it like this but it doesn't work:

C++:
glDisable(GL_TEXTURE_2D);
glDisableClientState(GL_COLOR_ARRAY);
glEnable(GL_COLOR_MATERIAL);

glDepthFunc(GL_LEQUAL); // normal state
glColor3ub(255, 0, 0); // red before walls
(*pDrawElements)(mode, count, type, indices);

glDepthFunc(GL_GREATER);
glColor3ub(0, 255, 0); // green behind walls
(*pDrawElements)(mode, count, type, indices);

glDisable(GL_COLOR_MATERIAL);
glEnableClientState(GL_COLOR_ARRAY);
glEnable(GL_TEXTURE_2D);
glDepthFunc(GL_LEQUAL); // restore normal state
Okay somehow the code above works only sometimes on some textures wtf o_O


EDIT: Okay the code above for the chams works fine but you can't base you model recognition on the texture ids, they change. I'll try a different model recognition.
 
Last edited:
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods