This site is no longer active, all members have migrated to devotedcheating.com . Thankyou
This site is no longer active, all members have migrated to devotedcheating.com . Thankyou
Would you like to react to this message? Create an account in a few clicks or log in to continue.



 
Actionhacks.netHomeLatest imagesRegisterLog in

 

 OpenGL Chams

Go down 
AuthorMessage
unasianazn
Coder



Posts : 52
Reputation : 5
Join date : 2009-11-28
Age : 29

OpenGL Chams Empty
PostSubject: OpenGL Chams   OpenGL Chams EmptySat Dec 12, 2009 3:32 pm

These are for UrbanTerror. Had a massive tutorial. It broked.

http://unasianaznsupercodetutorials.pastebin.com/f22a317ce

Code:
library UT_Hook;

uses
  SysUtils,
  Classes,
  MagicApiHook,
  dglOpenGL,
  Windows;

var
  oBindTexture : procedure(target : GLenum; texture: GLuint);  stdcall;
  oDrawElements : procedure(mode: GLenum; count: GLsizei; _type: GLenum; indices: PGLvoid); stdcall;
  oBegin : procedure(mode: GLenum); stdcall;
  cTarget : Boolean; // Cham Target

{$R *.res}

procedure Colorize(r:Double; g:Double; b:Double);
// Colorize the OpenGL Model for Chams
var
  color : array[0..5010] of Double;
  d    : Integer;
begin
  d := 0;
  while(d <= 5007) do
  begin
    color[d]  := r;
    color[d+1] := g;
    color[d+2] := b;
    d := d+3;
  end;
  glColorPointer(3, GL_FLOAT, 0, @color);
end;

procedure CheckTarget(c : PAnsiChar);
begin
  if(AnsiPos('player',c) > 0) then // This is part of the texture path
    cTarget := True                //  that I logged. I will post my
  else begin                      //  texture logger in the tutorial.
    cTarget := False;              // Again, credz to Quicktime` for
  end;                            //  idea. (Logger)
end;

procedure hBindTexture(target : GLenum; texture: GLuint); stdcall;
var
  Shader : DWORD;
begin
  asm
    mov Shader, esi            // MAJOR Credits to Quicktime`, this
  end;                          // method is so easy for model rec.
  if(Shader > 4096) then
  begin
    CheckTarget(Pointer(Shader));
  end;
 
  oBindTexture(target, texture);
end;

procedure hDrawElements(mode : GLenum; count : GLsizei; _type : GLenum; indices: PGLvoid); stdcall;
begin
  if(cTarget) then
  begin
    glDisable(GL_DEPTH_TEST);
    Colorize(1, 0, 0); // Divide the rgb values by 255. This will be red when behind walls.
    oDrawElements(mode, count, _type, indices); // Draw the model
    //Colorize(0, 1, 0); // Green for visible
    glEnable(GL_DEPTH_TEST);
  end;
 
  oDrawElements(mode, count, _type, indices);
end;

procedure hBegin(mode: GLenum); stdcall;
begin
  if(cTarget) then
  begin
    glDisable(GL_CULL_FACE);
    glDisable(GL_FOG);
  end;
  oBegin(mode);
end;

begin
  // Hooking GL Functions
  InitOpenGL();
  ReadExtensions();
  ReadImplementationProperties();
  cTarget := false;

  ApiHook('opengl32.dll','glBindTexture',nil,@hBindTexture,@oBindTexture);
  ApiHook('opengl32.dll','glDrawElements',nil,@hDrawElements,@oDrawElements);
  ApiHook('opengl32.dll','glBegin',nil,@hBegin,@oBegin);
end.
Back to top Go down
 
OpenGL Chams
Back to top 
Page 1 of 1
 Similar topics
-
» crossfire chams
» Chams tutorial. D3D9

Permissions in this forum:You cannot reply to topics in this forum
 :: Public Section: Coding :: Delphi :: Source Code-
Jump to: