Results 1 to 3 of 3
  1. #1
    wootwoot1234's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    1
    Reputation
    10
    Thanks
    0

    Injecter crashing game?

    Im having problems with my injecter. I cant find out why its crashing the game

    Code:
    #include <iostream>
    #include <Windows.h>
    
    using namespace std;
    
    bool InjectEngine(const wchar_t *PROC_NAME, const char *DLL_PATH)
    {
    	HANDLE PH, myThread;
    	DWORD PID, AddressBase, ExitThreadCode;
    	LPVOID RemoteMem;
    
    	GetWindowThreadProcessId(FindWindow(NULL, (LPCWSTR)PROC_NAME), &PID); // Find Window Process ID
    	if((PH = OpenProcess(PROCESS_VM_READ | PROCESS_VM_WRITE | PROCESS_VM_OPERATION | PROCESS_CREATE_THREAD | PROCESS_QUERY_INFORMATION, false, PID)) != NULL) // Open Process
    	{ 
    		RemoteMem = VirtualAllocEx(PH, NULL, strlen(DLL_PATH) +1, MEM_COMMIT, PAGE_READWRITE); // Locate Memory for DLL
    
    		if((WriteProcessMemory(PH, RemoteMem, DLL_PATH, strlen(DLL_PATH) +1, &AddressBase)) == true) // Write into process and checks if it worked or not
    		{
    
    			myThread = CreateRemoteThread(PH, NULL, 0, (LPTHREAD_START_ROUTINE)GetProcAddress(GetModuleHandleA("Kernal32.dll"), "LoadLibarayA"), RemoteMem, 0, 0);
    
    			WaitForSingleObject(myThread, INFINITE);
    			GetExitCodeThread(myThread, &ExitThreadCode);
    			if(!ExitThreadCode)
    				return false;
    		}
    		else
    		{
    			cout << "Could not write to file" << endl;
    			return false;
    		}
    	}
    	else
    	{
    		cout << "Could not find Window" << endl;
    		return false;
    	}
    	cout << GetLastError() << endl;
    
    	VirtualFreeEx(PH, RemoteMem, strlen(DLL_PATH) +1, MEM_RELEASE);
    	CloseHandle(PH);
    	CloseHandle(myThread);
    
    	return true;
    }
    
    int main()
    {	
    	if(InjectEngine(L"Minesweeper", "TrainerInjectorDll.dll") == false)
    		cout << "Error" << endl;
    	else
    		cout << "Injected" << endl;
    
    	cin.get();
    	return 0;
    }

  2. #2
    Toxic Waltz's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    114
    Reputation
    14
    Thanks
    18
    injector

  3. #3
    Auxilium's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    深い碧の果てに
    Posts
    4,518
    Reputation
    445
    Thanks
    609
    My Mood
    Happy
    Thanks for free, non-working code.

Similar Threads

  1. iw4mp.exe Hack injecting crash.
    By jburton in forum Call of Duty Modern Warfare 2 Help
    Replies: 8
    Last Post: 07-29-2010, 03:46 AM
  2. All Hacks Crash Game
    By Backspinningaxekick in forum Combat Arms Help
    Replies: 23
    Last Post: 05-14-2010, 10:58 AM
  3. Crashing Game
    By lis-mati in forum Combat Arms Help
    Replies: 7
    Last Post: 01-22-2010, 04:24 AM
  4. [Help] Hack Crashing Game
    By Scrcrw in forum CrossFire Hacks & Cheats
    Replies: 11
    Last Post: 10-08-2009, 05:24 PM
  5. Pub Hack crashing game?
    By lolwutpear in forum CrossFire Hacks & Cheats
    Replies: 29
    Last Post: 10-07-2009, 03:39 PM