|
19.05.2014, 09:43
|
#1
|
|
|
|
Пехотинец
|
Регистрация: 09.04.2010
Сообщений: 95
Популярность: -1654
Сказал(а) спасибо: 30
Поблагодарили 7 раз(а) в 6 сообщениях
|
Исходник [C++] External TriggerBot
//
Код:
#include <Windows.h>
#include <iostream>
#include <TlHelp32.h>
using namespace std;
bool GetGameAccess();
void PressKey(unsigned short KeyCode);
ULONG GetModuleAddress(const char *szModuleName, const ULONG dwProcessId);
int IsAlive();
int GetMyTeam();
int GetTargetTeam(int AimTarget);
HANDLE phandle;
ULONG ClientDLL;
ULONG EngineDLL;
int main()
{
bool Continue = GetGameAccess();
if(Continue)
{
cout << "Triggerbot loaded!" << endl;
int i = 0, AimTarget = 0; ULONG AimOffset=0;
while(1)
{
ReadProcessMemory(phandle, LPCVOID(ClientDLL+0x780CD0), &i, sizeof(i), 0); AimOffset = i + 0x14A8;
ReadProcessMemory(phandle, LPCVOID(AimOffset), &AimTarget, sizeof(AimTarget), NULL);
if(AimTarget != 0)
{
int TargetTeam = GetTargetTeam(AimTarget);
int MyTeam = GetMyTeam();
int IsDead = IsAlive();
if (TargetTeam != MyTeam &&
(TargetTeam == 2 || TargetTeam == 3) &&
(MyTeam == 2 || MyTeam == 3) &&
IsDead == 0)
PressKey(0x1A);
}
else
Sleep(1);
}
}
cin.get();
}
int IsAlive()
{
int Alive = 0;
ReadProcessMemory(phandle, LPCVOID(ClientDLL + 0x77C5F0), &Alive, sizeof(Alive), NULL);
return Alive;
}
int GetMyTeam()
{
int Value = 0, PlayerID = 0;
ReadProcessMemory(phandle, LPCVOID(EngineDLL + 0x42CAD8), &PlayerID, sizeof(PlayerID), NULL);
PlayerID = 0x6E4+(4*PlayerID);
ReadProcessMemory(phandle, LPCVOID(ClientDLL + 0x74B430), &Value, sizeof(Value), NULL);
ReadProcessMemory(phandle, LPCVOID(Value+0x26C), &Value, sizeof(Value), NULL);
ReadProcessMemory(phandle, LPCVOID(Value+PlayerID), &Value, sizeof(Value), NULL);
return Value;
}
int GetTargetTeam(int AimTarget)
{
int Value1 = 0, Value2 = 0;
ReadProcessMemory(phandle, LPCVOID(ClientDLL + 0x74B430), &Value1, sizeof(Value1), NULL);
ReadProcessMemory(phandle, LPCVOID(Value1 + 0x26C), &Value1, sizeof(Value1), NULL);
Value2 = 0x6E4+(4*AimTarget);
ReadProcessMemory(phandle, LPCVOID(Value1 + Value2), &Value1, sizeof(Value1), NULL);
return Value1;
}
bool GetGameAccess()
{
ULONG pid;
HWND hWnd;
hWnd = FindWindow(NULL, "Counter-Strike Source");
if(!hWnd)
{
cout <<"Game not found. Press enter to retry.\n";
cin.get();
main();
return false;
}
else
{
GetWindowThreadProcessId(hWnd, &pid);
phandle = OpenProcess(PROCESS_VM_READ, 0, pid);
if(!phandle)
{
cout << "Could not get handle to window. Press enter to retry.\n";
cin.get();
main();
return false;
}
else
{
ClientDLL = GetModuleAddress("client.dll", pid);
EngineDLL = GetModuleAddress("engine.dll", pid);
return true;
}
}
}
ULONG GetModuleAddress(const char *szModuleName, const ULONG dwProcessId)
{
if (!szModuleName || !dwProcessId)
return 0;
HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, dwProcessId);
if (hSnap == INVALID_HANDLE_VALUE)
return 0;
MODULEENTRY32 me;
me.dwSize = sizeof(MODULEENTRY32);
if (Module32First(hSnap, &me))
{
while (Module32Next(hSnap, &me))
{
if (strcmp(reinterpret_cast<const char*>(me.szModule), szModuleName) == 0)
{
CloseHandle(hSnap);
return (ULONG)me.modBaseAddr;
}
}
}
CloseHandle(hSnap);
return 0;
}
void PressKey(unsigned short KeyCode)
{
INPUT InputData;
InputData.type = INPUT_KEYBOARD;
InputData.ki.wScan = KeyCode;
InputData.ki.time = (0);
InputData.ki.dwExtraInfo = 0;
InputData.ki.dwFlags = 0;
SendInput(1, &InputData, sizeof(InputData));
Sleep(10);
InputData.ki.dwFlags = KEYEVENTF_KEYUP;
SendInput(1, &InputData, sizeof(InputData));
Sleep(10);
}
________________
Знаю все хитрости и баги в игре Легенда, пишем в ЛС.
Кому помог, жмём "Спасибо"
|
|
|
19.05.2014, 09:59
|
#2
|
|
|
|
Маршал
|
Регистрация: 20.11.2012
Сообщений: 864
Популярность: 12544
Золото Zhyk.Ru: 90
Сказал(а) спасибо: 1,246
Поблагодарили 1,440 раз(а) в 756 сообщениях
|
Re: Исходник [C++] External TriggerBot
Новый проект - C++c/ap - мн.кодировка.
Ctrl+c / ctrl+v
Последний раз редактировалось InfectedXMP; 21.05.2014 в 12:36.
|
|
|
19.05.2014, 11:04
|
#3
|
|
|
|
Сержант
|
Регистрация: 11.11.2011
Сообщений: 98
Популярность: 33905
Золото Zhyk.Ru: 70
Сказал(а) спасибо: 792
Поблагодарили 342 раз(а) в 205 сообщениях
|
Re: Исходник [C++] External TriggerBot
Исправленный
Код:
#include <Windows.h>#include <iostream>
#include <TlHelp32.h>
using namespace std;
bool GetGameAccess();
void PressKey(unsigned short KeyCode);
ULONG GetModuleAddress(const char *szModuleName, const ULONG dwProcessId);
int IsAlive();
int GetMyTeam();
int GetTargetTeam(int AimTarget);
HANDLE phandle;
ULONG ClientDLL;
ULONG EngineDLL;
int main()
{
bool Continue = GetGameAccess();
if(Continue)
{
cout << "Triggerbot loaded!" << endl;
int i = 0, AimTarget = 0; ULONG AimOffset=0;
while(1)
{
ReadProcessMemory(phandle, LPCVOID(ClientDLL+0x780CD0), &i, sizeof(i), 0); AimOffset = i + 0x14A8;
ReadProcessMemory(phandle, LPCVOID(AimOffset), &AimTarget, sizeof(AimTarget), NULL);
if(AimTarget != 0)
{
int TargetTeam = GetTargetTeam(AimTarget);
int MyTeam = GetMyTeam();
int IsDead = IsAlive();
if (TargetTeam != MyTeam &&
(TargetTeam == 2 || TargetTeam == 3) &&
(MyTeam == 2 || MyTeam == 3) &&
IsDead == 0)
PressKey(0x1A);
}
else
Sleep(1);
}
}
cin.get();
}
int IsAlive()
{
int Alive = 0;
ReadProcessMemory(phandle, LPCVOID(ClientDLL + 0x77C5F0), &Alive, sizeof(Alive), NULL);
return Alive;
}
int GetMyTeam()
{
int Value = 0, PlayerID = 0;
ReadProcessMemory(phandle, LPCVOID(EngineDLL + 0x42CAD8), &PlayerID, sizeof(PlayerID), NULL);
PlayerID = 0x6E4+(4*PlayerID);
ReadProcessMemory(phandle, LPCVOID(ClientDLL + 0x74B430), &Value, sizeof(Value), NULL);
ReadProcessMemory(phandle, LPCVOID(Value+0x26C), &Value, sizeof(Value), NULL);
ReadProcessMemory(phandle, LPCVOID(Value+PlayerID), &Value, sizeof(Value), NULL);
return Value;
}
int GetTargetTeam(int AimTarget)
{
int Value1 = 0, Value2 = 0;
ReadProcessMemory(phandle, LPCVOID(ClientDLL + 0x74B430), &Value1, sizeof(Value1), NULL);
ReadProcessMemory(phandle, LPCVOID(Value1 + 0x26C), &Value1, sizeof(Value1), NULL);
Value2 = 0x6E4+(4*AimTarget);
ReadProcessMemory(phandle, LPCVOID(Value1 + Value2), &Value1, sizeof(Value1), NULL);
return Value1;
}
bool GetGameAccess()
{
ULONG pid;
HWND hWnd;
hWnd = FindWindow(NULL, L"Counter-Strike Source");
if(!hWnd)
{
cout <<"Game not found. Press enter to retry.\n";
cin.get();
main();
return false;
}
else
{
GetWindowThreadProcessId(hWnd, &pid);
phandle = OpenProcess(PROCESS_VM_READ, 0, pid);
if(!phandle)
{
cout << "Could not get handle to window. Press enter to retry.\n";
cin.get();
main();
return false;
}
else
{
ClientDLL = GetModuleAddress("client.dll", pid);
EngineDLL = GetModuleAddress("engine.dll", pid);
return true;
}
}
}
ULONG GetModuleAddress(const char *szModuleName, const ULONG dwProcessId)
{
if (!szModuleName || !dwProcessId)
return 0;
HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, dwProcessId);
if (hSnap == INVALID_HANDLE_VALUE)
return 0;
MODULEENTRY32 me;
me.dwSize = sizeof(MODULEENTRY32);
if (Module32First(hSnap, &me))
{
while (Module32Next(hSnap, &me))
{
if (strcmp(reinterpret_cast<const char*>(me.szModule), szModuleName) == 0)
{
CloseHandle(hSnap);
return (ULONG)me.modBaseAddr;
}
}
}
CloseHandle(hSnap);
return 0;
}
void PressKey(unsigned short KeyCode)
{
INPUT InputData;
InputData.type = INPUT_KEYBOARD;
InputData.ki.wScan = KeyCode;
InputData.ki.time = (0);
InputData.ki.dwExtraInfo = 0;
InputData.ki.dwFlags = 0;
SendInput(1, &InputData, sizeof(InputData));
Sleep(10);
InputData.ki.dwFlags = KEYEVENTF_KEYUP;
SendInput(1, &InputData, sizeof(InputData));
Sleep(10);
}
|
|
|
Ваши права в разделе
|
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения
HTML код Выкл.
|
|
|
Заявление об ответственности / Список мошенников
Часовой пояс GMT +4, время: 23:16.
|
|