Download OpenGL ModelLogger (fast, simple, easy to use)

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

Liduen

Hacker
Dank Tier VIP
May 19, 2013
702
8,478
33
Afaik this opengl model logger by Krampus was the only one on guidedhacking until now.
Krampus said his one is a bit laggy / slow, so here is my optimized opengl model logger I wrote up the last days and it's damn easy to use and log models with it.



How does it work?
This isn't supposed to be a tutorial but I made this section for the ones interested nonetheless.
My logger uses a really efficient technique of filtering the counts in glDrawElements(..., GLsizei count, ...).
This image I made shows how it works for those who never touched model logging.



It goes like this until the model we search is the only one in either the blue or the red section.
If that is the case the logger automatically logs the count.



How to use it
1. arrow-up to select blue models, arrow-down to select red models
2. arrow-left to reset red / blue selection (in case you accidentally selected the wrong section)
3. arrow-right to print logs to file (modellogs.txt in the game executable's directory, this works additionally so FileContent += NewLogs)
4. white models are already logged
5. delete to start logging another model type
6. open the log file and copy + paste the C++ code directly into your glDrawElements hook

That means you're only pressing up, down, up, up, down according to what color the model is, until the model gets white.
You should then get a notification through the console that the according count was logged.
You can immediately proceed to log counts as the borders get reset to their orignal state automatically.
When you finished logging all types and / or parts of a model, you can press delete to tell the logger that you now search for something else. These strings will show up in the logfile afterwards.
Note: Pressing delete will clear the vector which stores the counts of the model you logged before. So back them up by pressing arrow-right before starting to log something else (that is before pressing delete).



Logger output
The logs get saved in two formats:
1. As a C++ #define and
2. as an C++ if statement

It will look like this:
C++:
#define Enemy(count)(count == 852 || count == 1524 || count == 2220 || count == 1872 || count == 1965 || count == 426)
if (count == 852 || count == 1524 || count == 2220 || count == 1872 || count == 1965 || count == 426){}
You can then choose which one you want to use in your glDrawElements hook.

Virusscans:
1. https://virusscan.jotti.org/en-US/filescanjob/hl4azain4z
2. https://www.virustotal.com/de/file/87bcf556025b3b74dde1dee599b937030ff56f8fc2f488f8b5f04a7a614db2b2/analysis/1436975533/



Have fun ;)
Liduen
 

Attachments

Last edited:

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,118
78,998
2,392
Well done. :)

Thank you for sharing.
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,118
78,998
2,392
Thanks Liduen this is awesome, I will play with it when I have some time!
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,118
78,998
2,392
Liduen I'm working on OpenArena which is also a Quake3 Engine game. I'm able to draw the the screen when hooking glSwapBuffers and also glDrawElements but I'm having trouble with the viewMatrix and my ESP

C++:
typedef struct {
	int			currenttextures[2];
	int			currenttmu;
	float		currentModelViewMatrix[16];
	float		currentModelViewProjectionMatrix[16]; //this one
	float		currentProjectionMatrix[16];
} glstate_t;
If I hook glSwapBuffers the viewmatrix is always invalid and it draws in the wrong space. So now I've hooked glDrawElements which gets called hundreds of times every frame. The problem is all game engine calls to openGL functions modify glstate_t. For each call of glDrawElements the currentModelViewProjectionMatrix[16] is different. I'm logging the currentModelViewProjectionMatrix[16] and some other variables each time glDrawElements and trying to find what variables I can check that correspond to the correct viewMatrix. This way I can do an if statement and draw only when the conditional is met. Any idea for me?

This is how I'm currently drawing, it works in both glDrawElements and glSwapBuffers hooks if anyone is interested:
Function definitions:
C++:
inline void initGLDraw()
{
	glPushMatrix();
	glLoadIdentity();
	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();
	glOrtho(0, WINDOWWIDTH, WINDOWHEIGHT, 0, -1, 1);
	glDisable(GL_DEPTH_TEST);
	glDisable(GL_TEXTURE_2D);
	glDisable(GL_BLEND);
}

inline void endGLDraw()
{
	glEnable(GL_BLEND);
	glEnable(GL_TEXTURE_2D);
	glEnable(GL_DEPTH_TEST);
	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();
	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();
}
C++:
void __stdcall hglDrawElements(GLenum Mode, GLsizei Count, GLenum Type, DWORD * Indices)
{
oglDrawElements(Mode, Count, Type, Indices);

initGLDraw();
DrawESP();
endGLDraw();

}
And my openGL world2screen works perfectly for this game as well
 

Liduen

Hacker
Dank Tier VIP
May 19, 2013
702
8,478
33
I wouldn't draw in the glDrawElements() hook if it's avoidable. Gave me tons of frame drops in the past.

Never made an esp myself so I'm sot sure if I'm the right one to help you. You're trying to find the correct matrix?
Where do you get them from?
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,118
78,998
2,392
well I have the addresses for all these things:

viewParms_t:
C++:
typedef struct {
	orientationr_t	or;
	orientationr_t	world;
	vec3_t		pvsOrigin;			// may be different than or.origin for portals
	qboolean	isPortal;			// true if this view is through a portal
	qboolean	isMirror;			// the portal is a mirror, invert the face culling
	int			frameSceneNum;		// copied from tr.frameSceneNum
	int			frameCount;			// copied from tr.frameCount
	cplane_t	portalPlane;		// clip anything behind this if mirroring
	int			viewportX, viewportY, viewportWidth, viewportHeight;
	float		fovX, fovY;
	float		projectionMatrix[16];
	cplane_t	frustum[4];
	vec3_t		visBounds[2];
	float		zFar;
	stereoFrame_t	stereoFrame;
} viewParms_t;
C++:
typedef struct {
	int			currenttextures[2];
	int			currenttmu;
	float		currentModelViewMatrix[16];
	float		currentModelViewProjectionMatrix[16];
	float		currentProjectionMatrix[16];
	qhandle_t	currentProgram;
	qhandle_t	postprocessingProgram;
	qboolean	finishCalled;
	int			texEnv[2];
	int			faceCulling;
	unsigned long	glStateBits;
} glstate_t;

SetViewportAndScissor():
C++:
static void SetViewportAndScissor( void ) {
	qglMatrixMode(GL_PROJECTION);
	qglLoadMatrixf( backEnd.viewParms.projectionMatrix );
	qglMatrixMode(GL_MODELVIEW);

	// set the window clipping
	qglViewport( 
	backEnd.viewParms.viewportX,
	backEnd.viewParms.viewportY, 
	backEnd.viewParms.viewportWidth, 
	backEnd.viewParms.viewportHeight );
		
	qglScissor ( 
	backEnd.viewParms.viewportX,
	backEnd.viewParms.viewportY,
	backEnd.viewParms.viewportWidth,
	backEnd.viewParms.viewportHeight );
		
	Matrix4Copy(
	backEnd.viewParms.projectionMatrix,
	glState.currentProjectionMatrix);
	
	
	Matrix4Multiply(
	glState.currentProjectionMatrix,
	glState.currentModelViewMatrix,
	glState.currentModelViewProjectionMatrix);
}
Well there is backEnd.viewParms and glState, they are seperate and they interact. The variables change constantly depending what openGL functions are called.

Here's the good part of SetViewportAndScissor:
C++:
	Matrix4Multiply(
	glState.currentProjectionMatrix,
	glState.currentModelViewMatrix,
	glState.currentModelViewProjectionMatrix);

It multiplies the ProjectionMatrix with the ModelViewMatrix and stores it in glState.currentModelViewProjectionMatrix. This is the correct matrix but it changes everytime openGL does anything. I can manually multiply the 2 matrices to get the MVP but again, all 3 matrices are constantly changing. I need to find a good hook location when the matrices are always correct for my view. I was going to hook SetViewPortAndScissor but that function got inlined by the compiler :( Really frustrating me godamnit
 

Liduen

Hacker
Dank Tier VIP
May 19, 2013
702
8,478
33
The correct matrix has to be stored somewhere in memory, why don't you try searching for the matrix manually like Fleep did?

Rake Maybe hook Matrix4Multiply() and log the return addresses...
 
Last edited:

xploiitz

Coder
Fleep Tier Donator
Trump Tier Donator
Nobleman
Jul 26, 2012
155
1,698
7
Any chance we could see the source to this?

it would help learning a bit :)
 
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