Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    andrew12's Avatar
    Join Date
    Nov 2008
    Gender
    male
    Location
    USA
    Posts
    263
    Reputation
    58
    Thanks
    255

    External Trigger not injecting.

    No errors or anything but when I launch the executable it just waits to be injected.
    Code:
    int main()
    {
    	Module Client, Engine;
    	while (!debugger.Attach("csgo.exe")) {
    		std::cout << ".";
    		Sleep(500);
    	}
    	Client = debugger.GetModule("Client.dll");
    	dwClient = Client.dwBase;
    	Engine = debugger.GetModule("Engine.dll");
    	dwEngine = Engine.dwBase;
    
    	CreateThread(0, 0, &TriggerThread, 0, 0, 0);
    	std::cout << "Trigger is running...";
    		
    		while (1)
    		{
    			if (GetAsyncKeyState(VK_F4)) {
    				exit(0);
    			}
    		}
    
    }

  2. #2
    Draig9's Avatar
    Join Date
    Feb 2016
    Gender
    male
    Posts
    23
    Reputation
    10
    Thanks
    249
    pretty sure your problem is at line 31, but seriously can't really help you without more info. do you mean it never actually attaches? If so you made sure your running as admin.... and so on. If so then post your attach function and we can help you more.

  3. #3
    andrew12's Avatar
    Join Date
    Nov 2008
    Gender
    male
    Location
    USA
    Posts
    263
    Reputation
    58
    Thanks
    255
    Code:
    #include <Windows.h>
    #include <tlhelp32.h>
    #include <string>
    #include <iostream>
    
    #define TRIGGER_KEY 0x56 //V key
    #define var template<typename T> T
    
    DWORD EntityList = 0x4A4ECA4;
    DWORD LocalPlayer = 0xA33504;
    DWORD LifeState = 0xFC;
    DWORD Team = 0xF0;
    DWORD CrossHairId = 0xAA44;
    DWORD EntitySize = 0x10;
    
    struct Module
    {
    	DWORD dwBase;
    	DWORD dwSize;
    
    };
    class Debugger
    {
    private:
    	HANDLE __process;
    	DWORD __pId;
    public:
    	bool Attach(char* ProcessName)
    	{
    		HANDLE PHANDLE = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, NULL);
    		PROCESSENTRY32 CSENTRY;
    		CSENTRY.dwFlags = sizeof(CSENTRY);
    		do {
    			if (!strcmp(CSENTRY.szExeFile, ProcessName)) {
    				__pId = CSENTRY.th32ProcessID;
    				CloseHandle(PHANDLE);
    				__process = OpenProcess(PROCESS_ALL_ACCESS, FALSE, __pId);
    				return true;
    
    			
    			}
    		} while (Process32Next(PHANDLE, &CSENTRY));
    		return false;
    	}
    	Module GetModule(char* ModuleName)
    	{
    		HANDLE module = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, __pId);
    		MODULEENTRY32 ModEntry;
    		ModEntry.dwSize = sizeof(ModEntry);
    		do {
    			if (!strcmp(ModEntry.szModule, (char*)ModuleName)) {
    				CloseHandle(module);
    				return{ (DWORD)ModEntry.hModule, ModEntry.modBaseSize };
    			}
    		} while (Module32Next(module, &ModEntry));
    		return{ (DWORD)NULL, (DWORD)NULL };
    
    
    
    	}
    
    	template <typename T> T read(DWORD Addr)
    	{	
    		T __read;
    		ReadProcessMemory(__process, (void*)Addr, &__read, sizeof(T), NULL);
    		return __read;
    	}
    
    };
    Debugger debugger;
    DWORD dwClient, dwEngine;
    class Entity
    {
    public:	
    	static DWORD GetBaseEntity(int PlayerNumber)
    	{
    		return debugger.read<DWORD>(dwClient + EntityList + (EntitySize * PlayerNumber));
    	}
    	static bool PlayerIsDead(int PlayerNumber)
    	{
    		static DWORD BaseEntity = GetBaseEntity(PlayerNumber);
    			if (BaseEntity) {
    					return debugger.read<bool>(BaseEntity + LifeState);
    			}
    	}
    
    	static int GetTeam(int PlayerNumber)
    	{
    		DWORD BaseEntity = GetBaseEntity(PlayerNumber);
    		if (BaseEntity) {
    			return debugger.read<bool>(BaseEntity + LifeState);
    		}
    	}
    };
    
    class Game
    {
    public:
    	static void GetPlayerBase(DWORD* retAddr)
    	{
    		(DWORD)*retAddr = debugger.read<DWORD>(dwClient + LocalPlayer);
    	}
    	static int GetTeam()
    	{
    		DWORD PlayerBase;
    		GetPlayerBase(&PlayerBase);
    		if (PlayerBase)
    			return debugger.read<int>(PlayerBase + Team);
    	}
    	static void GetCrosshairId(int* retAddr)
    	{
    		DWORD PlayerBase;
    		GetPlayerBase(&PlayerBase);
    		if (PlayerBase)
    			(int)*retAddr = debugger.read<int>(PlayerBase + CrossHairId) - 1;
    	}
    };
    
    void Click()
    {
    	mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
    	Sleep(1);
    	mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
    }
    DWORD WINAPI  TriggerThread(LPVOID PARAMS)
    {
    	while (1)
    	{
    		Sleep(1);
    			if (GetAsyncKeyState(TRIGGER_KEY) < 0 && TRIGGER_KEY != 1) {
    				int PlayerNumber= NULL;
    				Game::GetCrosshairId(&PlayerNumber);
    				if (PlayerNumber < 64 && PlayerNumber >= 0 && Entity::GetTeam(PlayerNumber) != Game::GetTeam() && Entity::PlayerIsDead(PlayerNumber) == false)
    				{
    					Click();
    				}
    		}
    	}
    	return 0;
    }
    int main()
    {
    	Module Client, Engine;
    	while (!debugger.Attach("csgo.exe")) {
    		std::cout << ".";
    		Sleep(500);
    	}
    	Client = debugger.GetModule("Client.dll");
    	dwClient = Client.dwBase;
    	Engine = debugger.GetModule("Engine.dll");
    	dwEngine = Engine.dwBase;
    
    	CreateThread(0, 0, &TriggerThread, 0, 0, 0);
    	std::cout << "Trigger is running...";
    		
    		while (1)
    		{
    			if (GetAsyncKeyState(VK_F4)) {
    				exit(0);
    			}
    		}
    
    }
    Just tried running as admin and no change even though I tried before.
    @WasserEsser, can you assist me?
    Last edited by andrew12; 07-10-2016 at 11:32 AM.

  4. #4
    cunikcze's Avatar
    Join Date
    May 2015
    Gender
    male
    Location
    192.168.0.100
    Posts
    223
    Reputation
    10
    Thanks
    2,677
    My Mood
    Happy
    Code:
    HANDLE PHANDLE = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, NULL);
    first is bad the second code is good try it
    Code:
    HANDLE PHANDLE = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL);
    should be fine

  5. #5
    WasserEsser's Avatar
    Join Date
    Jul 2015
    Gender
    male
    Posts
    735
    Reputation
    174
    Thanks
    677
    My Mood
    Busy
    You aren't calling Process32First nor do you call Module32First.
    You are also leaking the snapshot handles if the process or the module hasn't been found.

    The fix for your problem has been mentioned above.

  6. #6
    andrew12's Avatar
    Join Date
    Nov 2008
    Gender
    male
    Location
    USA
    Posts
    263
    Reputation
    58
    Thanks
    255
    Quote Originally Posted by cunikcze View Post
    Code:
    HANDLE PHANDLE = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, NULL);
    first is bad the second code is good try it
    Code:
    HANDLE PHANDLE = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL);
    should be fine
    Quote Originally Posted by WasserEsser View Post
    You aren't calling Process32First nor do you call Module32First.
    You are also leaking the snapshot handles if the process or the module hasn't been found.

    The fix for your problem has been mentioned above.
    Still not injecting into the process.

  7. #7
    WasserEsser's Avatar
    Join Date
    Jul 2015
    Gender
    male
    Posts
    735
    Reputation
    174
    Thanks
    677
    My Mood
    Busy
    Quote Originally Posted by andrew12 View Post
    Still not injecting into the process.
    It's an external cheat, you are not going to inject anything.

  8. #8
    andrew12's Avatar
    Join Date
    Nov 2008
    Gender
    male
    Location
    USA
    Posts
    263
    Reputation
    58
    Thanks
    255
    Quote Originally Posted by WasserEsser View Post
    It's an external cheat, you are not going to inject anything.
    Not injecting but hooking and functioning. Justing getting "." never getting "Trigger is running..."
    Last edited by andrew12; 07-10-2016 at 02:01 PM.

  9. #9
    WasserEsser's Avatar
    Join Date
    Jul 2015
    Gender
    male
    Posts
    735
    Reputation
    174
    Thanks
    677
    My Mood
    Busy
    Quote Originally Posted by andrew12 View Post
    Not injecting but hooking and functioning. Justing getting "." never getting "Trigger is running..."
    You aren't hooking anything either. Use your debugger and step through your code.

  10. #10
    TheNamless's Avatar
    Join Date
    Jun 2016
    Gender
    male
    Posts
    46
    Reputation
    10
    Thanks
    3
    My Mood
    Fine
    try to use "sendinput" instead of "mouse_event" , and the solution for your problem has been mentioned above

  11. #11
    andrew12's Avatar
    Join Date
    Nov 2008
    Gender
    male
    Location
    USA
    Posts
    263
    Reputation
    58
    Thanks
    255
    Quote Originally Posted by TheNamless View Post
    try to use "sendinput" instead of "mouse_event" , and the solution for your problem has been mentioned above
    Trigger still doesn't seem to work, I've used debugger and nothing helped.

  12. #12
    legit_player's Avatar
    Join Date
    Aug 2015
    Gender
    male
    Location
    /root
    Posts
    313
    Reputation
    10
    Thanks
    2,784
    My Mood
    Cool
    The thing is that you have literally no idea what are you doing.

  13. #13
    andrew12's Avatar
    Join Date
    Nov 2008
    Gender
    male
    Location
    USA
    Posts
    263
    Reputation
    58
    Thanks
    255
    Quote Originally Posted by legit_player View Post
    The thing is that you have literally no idea what are you doing.
    Perhaps not but I'm trying, this is the first time I've done anything with C++ besides from the coding in C++ for dummies. I usually do VB and VB.NET.

  14. #14
    TheNamless's Avatar
    Join Date
    Jun 2016
    Gender
    male
    Posts
    46
    Reputation
    10
    Thanks
    3
    My Mood
    Fine
    try to debug , and see the value of your crosshair when looking at your teammate and when looking at the enemie , if its 0 then your using the wrong crosshair offset cause i think its end with 48 and not 44 , also why your looping for 64 player your not always the first player in the server , use crosshairid -1 * 0x10
    Last edited by TheNamless; 07-14-2016 at 02:40 AM.

  15. #15
    andrew12's Avatar
    Join Date
    Nov 2008
    Gender
    male
    Location
    USA
    Posts
    263
    Reputation
    58
    Thanks
    255
    Quote Originally Posted by TheNamless View Post
    try to debug , and see the value of your crosshair when looking at your teammate and when looking at the enemie , if its 0 then your using the wrong crosshair offset cause i think its end with 48 and not 44 , also why your looping for 64 player your not always the first player in the server , use crosshairid -1 * 0x10
    Tired that but didn't seem to work, as for the crosshair offset the 44 seems to be the correct one.

Page 1 of 2 12 LastLast

Similar Threads

  1. Could not inject dll fix
    By deziwright in forum Combat Arms Hacks & Cheats
    Replies: 9
    Last Post: 11-06-2008, 03:44 PM
  2. Could not inject dll
    By led2411 in forum Combat Arms Hacks & Cheats
    Replies: 1
    Last Post: 10-26-2008, 09:56 AM
  3. could not inject .dll
    By Icu888 in forum Suggestions, Requests & General Help
    Replies: 0
    Last Post: 10-25-2008, 11:51 PM
  4. could not inject.dll
    By oneshot614 in forum Combat Arms Hacks & Cheats
    Replies: 14
    Last Post: 10-16-2008, 11:57 AM
  5. how to fix the error (could not inject) on vista
    By cute bs girl in forum Combat Arms Hacks & Cheats
    Replies: 4
    Last Post: 10-11-2008, 09:41 PM