[Release&Source] (InCross-) Triggerbot

09/13/2015 18:27 pycache#1
Ganze 111 Zeilen! Da einige Leute von den Tiggersounds genervt waren.
A full 111 lines of code! As some people were pissed off by the sounds from the tiggerbot.

Code:
#include <windows.h>
#include <tlhelp32.h>
#include <fstream>

DWORD dwEntityList, dwLocalPlayer, dwClient, dwTeam, dwCrosshairId, TriggerDelay, TriggerKey;
HANDLE hProcess;

DWORD GetModuleHandleByName(char* ModuleName, DWORD ProcID) {
	MODULEENTRY32 Entry;
	Entry.dwSize = sizeof(MODULEENTRY32);
	HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, ProcID);
	if (Module32First(hSnap, &Entry) == TRUE) {
		if (!_stricmp(Entry.szModule, ModuleName)) {
			DWORD hModule = (DWORD)Entry.modBaseAddr;
			return hModule;
		}
		else {
			while (Module32Next(hSnap, &Entry) == TRUE) {
				if (!_stricmp(Entry.szModule, ModuleName)) {
					DWORD hModule = (DWORD)Entry.modBaseAddr;
					return hModule;
				}
			}
			return 0;
		}
	}
	CloseHandle(hSnap);
}
HANDLE GetProcessHandleByName(char* ProcessName) {
	PROCESSENTRY32 Entry;
	Entry.dwSize = sizeof(PROCESSENTRY32);
	HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL);
	if (Process32First(hSnap, &Entry) == TRUE) {
		if (!_stricmp(Entry.szExeFile, ProcessName)) {
			HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, Entry.th32ProcessID);
			return hProc;
		}
		else {
			while (Process32Next(hSnap, &Entry) == TRUE) {
				if (!_stricmp(Entry.szExeFile, ProcessName)) {
					HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, Entry.th32ProcessID);
					return hProc;
				}
			}
			return 0;
		}
	}
	CloseHandle(hSnap);
}
template <typename ReadType> ReadType Read(DWORD Address) {
	ReadType Data;
	ReadProcessMemory(hProcess, (LPVOID)(Address), &Data, sizeof(ReadType), 0);
	return Data;
}
int eGetTeam(int PlayerNumber) {
	return Read<int>((Read<DWORD>(dwClient + dwEntityList + (0x10 * PlayerNumber))) + 0xF0);
}
int eGetHealth(int PlayerNumber) {
	return Read<int>((Read<DWORD>(dwClient + dwEntityList + (0x10 * PlayerNumber))) + 0xFC);
}
void Click() {
	mouse_event(MOUSEEVENTF_LEFTDOWN, NULL, NULL, NULL, NULL);
	Sleep(5);
	mouse_event(MOUSEEVENTF_LEFTUP, NULL, NULL, NULL, NULL);
}
void ReadFile() {
	std::ifstream f("trigger.ini");
	std::string buf;
	int cur = 0;
	for (; std::getline(f, buf); cur++) {
		if (cur == 0) {
			std::istringstream ss(&buf[15]);
			ss >> TriggerDelay;
		}
		if (cur == 1) {
			std::istringstream ss(&buf[15]);
			ss >> std::hex >> TriggerKey;
		}
	}
	f.close();
}
void UpdateOffsets() {//replace with the current offsets.
    dwEntityList = 0x00000000; 
    dwLocalPlayer = 0x00000000;
    dwCrosshairId = 0x0000;
    dwTeam = 0xF0;
}
int main() {
#ifdef NDEBUG
	HWND hWnd = GetConsoleWindow();
	ShowWindow(hWnd, SW_HIDE);
#endif
	hProcess = GetProcessHandleByName("csgo.exe");
	dwClient = GetModuleHandleByName("Client.dll", GetProcessId(hProcess));
	ReadFile();
    UpdateOffsets();
	while (!((GetKeyState(VK_F12) & 0x100) != 0)) {
		if ((GetKeyState(TriggerKey) & 0x100) != 0) {
			int cId = Read<int>((Read<DWORD>(dwClient + dwLocalPlayer)) + dwCrosshairId);
			int myTeam = Read<int>((Read<DWORD>(dwClient + dwLocalPlayer)) + dwTeam);
			if (cId > 0 && cId <= 64) {
				int eTeam = eGetTeam(cId - 1);
				int eHealth = eGetHealth(cId - 1);
				if (eTeam != 0 && eTeam != myTeam && (eHealth > 0)) {
					Sleep(TriggerDelay);
					Click();
				}
			}
		}
	}
}
READ THIS:

Credits: Microsoft, WinApi.

Edit: Offsets are now automatically updating, make sure to download the new .rar. "trigger.ini" shall now only contain TriggerKey & TriggerDelay!
09/14/2015 14:37 e543321#2
Kein Download .....
09/14/2015 15:39 pycache#3
Dann kompiliers dir selbst, ich habs extra alles in eine Datei gepresst, damit es jeder verstehen und selbst kompilieren kann. Die einzigen Dependencies sind Standardheader.

Oder du wartest 'nen paar Stunden, morgen werd ich eine Version mit Pattern Scanning machen, dann braucht man keine Offsets raussuchen.

Und vll. demnächst einen mit Hitbox Trigger + Raytrace Check, bin gerade an Shellcode Injection, weniger aufwändig als ne Dll als Resource zu embedden. Ob das dann nen public release wird hängt allerdings u.a. davon ab inwiefern der Anklang hier ist und ob ichs selbst verwenden würde.
09/14/2015 17:04 burncode#4
Hättest ja bisschen sauberer machen können.
Mensch pycache, sei mal ein Beispiel.
Aber schickes Release, schön gemacht.
09/14/2015 18:39 pycache#5
Quote:
Originally Posted by burncode View Post
Hättest ja bisschen sauberer machen können.
Mensch pycache, sei mal ein Beispiel.
Aber schickes Release, schön gemacht.
Ein bisschen? :D
Habs extra in ein File geklatscht (und auf jedliche Projektstruktur oder sonstiges verzichtet), damit es jeder, der keine Ahnung von hat, mal sieht wie wenig Code so etwas an sich braucht. Das nächste Release wird ordentlich strukturiert, versprochen.
09/16/2015 11:10 doscripter#6
[Only registered and activated users can see links. Click Here To Register...]

ez life my friends ^^
09/16/2015 19:13 pycache#7
Quote:
Originally Posted by doscripter View Post
[Only registered and activated users can see links. Click Here To Register...]

ez life my friends ^^
Und du meinst das kennen mehr als 2% der Nutzer dieses Forums? :D

Update fix:
09/16/2015 20:33 r1ven#8
Triggerkey?
09/16/2015 21:25 pycache#9
Quote:
Originally Posted by r1ven View Post
Triggerkey?
Quote:
Originally Posted by pycache View Post
READ THIS:
trigger.ini:
Code:
dwLocalPlayer = 0x00A932BC
dwEntityList = 0x04A35994
TriggerDelay = 80
TriggerKey = 0x06
^
09/17/2015 14:34 SemihRize#10
cant use this it says im missing some files on my comp
09/17/2015 14:59 r1ven#11
not working
09/17/2015 20:25 pycache#12
Updated in main post. This will now automatically keep itself up to date, unless there's major changes to cs:go!
09/18/2015 11:36 r1ven#13
I know everything is detectable, but is this -easily- detectable?
09/18/2015 13:04 pycache#14
Not more and not less than any other cheat you'll find here.
09/24/2015 22:20 baze952#15
kann mir einer sagen wie man es installiert ?