LUDIX-BoT Forum
 
HomeHome  CalendarCalendar  FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  RegisterRegister  Log inLog in  

Share | 
 

 Wallhack/Chams The Easy Way

Go down 
AuthorMessage
Shagrath



Posts : 57
Join date : 2009-10-10
Location : Istanbul/Turkey

PostSubject: Wallhack/Chams The Easy Way   Mon Oct 12, 2009 6:34 am

Ok, when I first started out my main goal was just to get a damn hook working for ET. Then of course once it did work (meaning not crashing) it still didn't do anything. So using Mombatu's newbie tutorial, I found out how to get a very general wall hack going. The problem was almost everything was visible through the walls... water, pumps, flag, etc. I needed to figure out a way to filter out only the things I wanted to see... players. So after toying around with some different checks it became apparent that trying to get all the different parts of player to come through and nothing else was a bit of a chore. You have to consider that the scope, sniper rifle, hat, backpack etc. are all drawn seperately. Now, you can do these sort of checks within syscall but there is a much easier way. Looking through the source code, you'll find that each player is drawn by the function:
Code:
void CG_player(centity_t *cent);

Well, that's interesting... looking at where it is called it seems it draws all the players that had information in the last snapshot. So, why reinvent the wheel?

By simply creating a global centity_t pointer and using this function to set it to the current player being drawn, you have a simple yet very efficient way of checking for player models and all their components.
Here is a bit of code...

Our global pointer...
Code:
centity_t *playerDrawn = NULL; // set it to NULL just to be safe

In our hooked CG_Player we check if the player is dead, if not we set it to the current player being drawn and go from there...
** NOTE: Finding function offsets and hooking is beyond the scope of this article, though there are plenty of good resources for that elsewhere
Code:
void CG_Player_Hook(centity_t *cent)
{
  if (cent->currentState.eFlags & EF_DEAD) // check if dead
    playerDrawn = NULL;
  else playerDrawn = cent;  // this is our 'filter', more processing could be done here as well
  orig_CG_Player(cent);  // the orignal hooked function
  playerDrawn = NULL;  // reset our pointer to null after drawing is done
}

So, now whenever a player is drawn and they are alive our pointer is set to their centity_t struct. So within your syscall you can simply do this:
Code:
.
.
.
  case CG_ADDREFENTITYTOSCENE:
    if (playerDrawn != NULL) {
      // do wallhack / cham stuff here
    }
    break;
.
.
.

In addition, since you have the centity_t pointer already, you can check for same team etc. To take this further, it would be possible to do a lot of processing using CG_Player as well... instead of running through every client (MAX_CLIENTS) with a for loop, you could instead cheack each that was updated and use it for target selection, esp, and much more.

If you're just starting out, this may not make a lot of sense and I would recommend checking out Mombatu's tutorial at EC. Once you are semi-comfortable with the SDK, then this will be much clearer. Hopefully, most of this stuff is correct... though I am at work and just working off memory.

Thanks to solCRUSHR
Back to top Go down
View user profile
SUXXX
Admin
Admin


Posts : 66
Join date : 2009-10-10

PostSubject: Re: Wallhack/Chams The Easy Way   Mon Oct 12, 2009 11:38 am

thanks man !!
Back to top Go down
View user profile http://ludix-bot.tk
Shagrath



Posts : 57
Join date : 2009-10-10
Location : Istanbul/Turkey

PostSubject: Re: Wallhack/Chams The Easy Way   Fri Oct 23, 2009 2:22 pm

anytime Wink
Back to top Go down
View user profile
Sponsored content




PostSubject: Re: Wallhack/Chams The Easy Way   

Back to top Go down
 
Wallhack/Chams The Easy Way
Back to top 
Page 1 of 1
 Similar topics
-
» ECE (Easy Chess Engine) v.11.01
» Quick and easy Shit On A Shingle.
» Easy Guide to Chess
» ZODIAC TIPS
» Bonn: No easy path for the Favorites

Permissions in this forum:You cannot reply to topics in this forum
LUDIX-BoT Forum :: Coding :: General Coding-
Jump to: