-
Автор темы
- #1
C#:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
namespace Triggerbot
{
class Program
{
static int clientmodule;
static VAMemory memchanger = new VAMemory("csgo");
static void Main()
{
clientmodule = GetModule("csgo", "client_panorama");
while (true)
{
if (CheckCrosshairForEnemy(clientmodule) == true)
{
Attack(clientmodule);
}
System.Threading.Thread.Sleep(2);
}
}
public static void Attack(int module)
{
memchanger.WriteInt32((IntPtr)module + Offsets.adrShoot, 1);
System.Threading.Thread.Sleep(1);
memchanger.WriteInt32((IntPtr)module + Offsets.adrShoot, 4);
}
public static bool CheckCrosshairForEnemy(int module)
{
int LocalPlayer = memchanger.ReadInt32((IntPtr)module + Offsets.adrLocalPlayer);
int LocalTeam = memchanger.ReadInt32((IntPtr)LocalPlayer + Offsets.offTeam);
int CrosshairID = memchanger.ReadInt32((IntPtr)LocalPlayer + Offsets.offCrosshairID);
if (CrosshairID > 0 && CrosshairID < 64)
{
int EntityListPlayer = memchanger.ReadInt32((IntPtr)module + Offsets.adrEntityList + (CrosshairID - 1) * Offsets.EntityLoop);
int crossTeam = memchanger.ReadInt32((IntPtr)EntityListPlayer + Offsets.offTeam);
int crossHealth = memchanger.ReadInt32((IntPtr)EntityListPlayer + Offsets.offHealth);
if (LocalTeam != crossTeam && crossHealth > 0)
{
return true;
}
}
return false;
}
public static int GetModule(string process, string moduleName)
{
if (moduleName.EndsWith(".dll"))
moduleName = moduleName.Split('.')[0];
if (process.EndsWith(".exe"))
process = process.Split('.')[0];
if (Process.GetProcessesByName(process).Length > 0)
{
foreach (ProcessModule module in Process.GetProcessesByName(process)[0].Modules)
{
if (module.ModuleName == (moduleName + ".dll"))
{
return (int)module.BaseAddress;
}
}
}
return 0;
}
}
}