using Swed64; using System.Runtime.InteropServices; Swed swed = new Swed("cs2"); //…
- User
using Swed64; using System.Runtime.InteropServices;
Swed swed = new Swed("cs2"); // detecting cs2
IntPtr client = swed.GetModuleBase("client.dll"); // getting client
int dwForceAttack = 0x1730020; int dwEntityList = 0x19BEED0; int dwLocalPlayerPawn = 0x1824A18;
const int MOUSEEVENTF_LEFTDOWN = 0x02; const int MOUSEEVENTF_LEFTUP = 0x04; const int MOUSEEVENTF_RIGHTDOWN = 0x08; const int MOUSEEVENTF_RIGHTUP = 0x10;
// https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes int HOTKEY = 0x70; // Middle mouse
int m_iIDEntIndex = 0x13A8; // CEntityIndex int m_iTeamNum = 0x3C3;
while (true) { IntPtr entityList = swed.ReadPointer(client, dwEntityList); IntPtr localPlayerPawn = swed.ReadPointer(client, dwLocalPlayerPawn);
int team = swed.ReadInt(localPlayerPawn, m_iTeamNum); int entIndex = swed.ReadInt(localPlayerPawn,m_iIDEntIndex); Console.WriteLine($"Crosshair/Entity ID: {entIndex}"); if (entIndex != -1) { IntPtr listEntry = swed.ReadPointer(entityList, 0x8 * ((entIndex & 0x7FFF) >> 9) + 0x10); IntPtr currentPawn = swed.ReadPointer(listEntry, 0x78 * (entIndex & 0x1FF)); int entityTeam = swed.ReadInt(currentPawn, m_iTeamNum); if (team != entityTeam) { if (GetAsyncKeyState(HOTKEY) < 0) { // Simulate left mouse button press //swed.WriteInt(client, dwForceAttack, 65537); // +attack uint X = (uint)Cursor.Position.X; uint Y = (uint)Cursor.Position.Y; mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, X, Y, 0, 0); //Thread.Sleep(10); //swed.WriteInt(client, dwForceAttack, 256); // -attack //Thread.Sleep(10); } } } Thread.Sleep(2);}
[DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)] static extern void mouse_event(uint dwFlags, uint dx, uint dy, uint cButtons, uint dwExtraInfo);
[DllImport("user32.dll")] static extern short GetAsyncKeyState(int vKey); i don't have Cursor, fix that
- Assistant
- User
using Swed64; using System.Runtime.InteropServices;
Swed swed = new Swed("cs2"); // detecting cs2
IntPtr client = swed.GetModuleBase("client.dll"); // getting client
int dwForceAttack = 0x1730020; int dwEntityList = 0x19BEED0; int dwLocalPlayerPawn = 0x1824A18; int dwWindowHeight = 0x5F0424; int dwWindowWidth = 0x5F0420;
const int MOUSEEVENTF_LEFTDOWN = 0x02; const int MOUSEEVENTF_LEFTUP = 0x04; const int MOUSEEVENTF_RIGHTDOWN = 0x08; const int MOUSEEVENTF_RIGHTUP = 0x10;
- Assistant
- User
using Swed64; using System.Runtime.InteropServices;
Swed swed = new Swed("cs2"); // detecting cs2
IntPtr client = swed.GetModuleBase("client.dll"); // getting client
//int dwForceAttack = 0x1730020; int dwEntityList = 0x19BEED0; int dwLocalPlayerPawn = 0x1824A18; int dwWindowHeight = 0x5F0424; int dwWindowWidth = 0x5F0420;
- Assistant
- User
- Assistant