This one was slightly harder to find.
I know bots made use of CBot::IsVisible, but none of those contained strings.
So I wen't to look for TraceLine itself, after finding it, I chose to do Find all references
One of the references was
Code:
TraceLine(player1->o, dest, player1, true, &tr);
in BotManager, it uses player1, so it would give us a way to confirm we have the right function once we find it in olly.
So I double clicked it, and WHT THE FUCK!! YAY! ITS A COMMAND! =D
telebot!
Knowing from past usage of COMMAND, its a define takes two arguments, the first one is the name of the command and at the same time the name of the function it's calling, the second argument is what amount of arguments it has.
the define calls a function with 3 arguments, the first one being the text string, 2nd being the pointer to the function, and the third being the paramcount.
COMMAND(telebot, ARG_NONE);
"telebot" is what we will search for with olly!
it was quite easy to find, since its the only telebot command
Code:
00491BE0 . 6A 04 PUSH 4
00491BE2 . 68 90524700 PUSH ac_clien.00475290
00491BE7 . 68 0CDF4900 PUSH ac_clien.0049DF0C ; ASCII "telebot"
00491BEC . E8 8FDEFBFF CALL ac_clien.0044FA80
00491BF1 . 83C4 0C ADD ESP,0C
00491BF4 . A2 A0084E00 MOV BYTE PTR DS:[4E08A0],AL
00491BF9 . C3 RETN
ARG_NONE is 4(push 4, last param).
PUSH ac_clien.00475290 is the pointer to the telebot function.
Control+G in olly and go to 00475290
Code:
TraceLine(player1->o, dest, player1, true, &tr);
if (!tr.collided)
!tr.collided = !true = false = 0
Code:
...lots of arguments...
00475368 |. E8 A365FFFF CALL ac_clien.0046B910 ; \ac_clien.0046B910
0047536D |. 83C4 24 ADD ESP,24
00475370 |. 807C24 3C 00 CMP BYTE PTR SS:[ESP+3C],0 ;<-- compared to 0 ;)
00475375 |. 0F85 96000000 JNZ ac_clien.00475411
So 0x0046B910 is traceline!
Code:
void (*TraceLine)(vec from, vec to, dynent *pTracer, bool CheckPlayers, traceresult_s *tr, bool SkipTags) = (void (__cdecl *)(vec,vec,dynent *,bool,traceresult_s *,bool))0x0046B910;
bool IsVisible(vec v1, vec v2, dynent *tracer, bool SkipTags)
{
traceresult_s tr;
TraceLine(v1, v2, tracer, (tracer!=NULL), &tr, SkipTags);
return !tr.collided;
}
usage:
Code:
bool bEnemyVisible = IsVisible(player1->o, players[i]->o, NULL, false);
Now you have everyting to make a fully functional aimbot
