-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.cpp
53 lines (44 loc) · 1.24 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*!
* A proof-of-concept that demonstrated using CSGO's internal nametags to trigger a shot.
*/
#include <windows.h>
#include <stdio.h>
#include "GOProcessUtils.h"
int main( int argc, char** argv )
{
GOProcessUtils gpu;
// Get a handle to csgo
HANDLE CSHandle = gpu.findCSGoProcess();
if( CSHandle == NULL )
{
printf( "Could not find GO");
return 1;
}
// Find the base of client.dll
DWORD clientHandle = gpu.findClientModule();
if( clientHandle == 0 )
{
printf( "Could not find client base");
return 1;
}
DWORD curTargetAddress, curTarget;
// clientHandle + 0x00A6C434 holds the address of the player structure.
ReadProcessMemory( CSHandle, (void*)(clientHandle + 0x00A6C434), &curTargetAddress, 4, NULL );
// + 0x23ac points to the value that holds whether or not we are pointing at another player
curTargetAddress += 0x23AC;
// Constantly read the target address and if we are pointing at another player,
// send a down then up mouse press.
while( 1 )
{
ReadProcessMemory( CSHandle, (void*)curTargetAddress, &curTarget, 4, NULL );
if( curTarget > 0 )
{
mouse_event( MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0 );
Sleep( 10 );
mouse_event( MOUSEEVENTF_LEFTUP, 0, 0, 0, 0 );
Sleep( 10 );
}
Sleep( 100 );
}
return 0;
}