Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > C/C++
You last visited: Today at 16:47

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Frage]C++ Injector

Discussion on [Frage]C++ Injector within the C/C++ forum part of the Coders Den category.

Closed Thread
 
Old   #1
 
XxharCs's Avatar
 
elite*gold: 34
Join Date: Apr 2011
Posts: 1,475
Received Thanks: 1,228
[Frage]C++ Injector

Ok, ich habe zum ersten mal einen Injector in C++ gemacht. Nur leider funktioniert er nicht.
Ich will meine .dll in das Spiel injizieren. Die .dll hat aber auch noch ne Konfigurationsdatei, liegt es villeicht daran ?
Oder liegt das ich beim Namen des Spiels den Process Namen angeben soll oder doch einfach den Window name ?

Naja hier ist der Code, ich hoffe auf eure hilfe =)

Code:
#include "stdafx.h"
#include "windows.h"
#include <iostream>

using namespace std;

char const Path[]="Aimbot.dll";

void SetDebugPrivilege() 
{
	HANDLE hProcess=GetCurrentProcess(), hToken;
	TOKEN_PRIVILEGES priv;
	LUID luid;

	OpenProcessToken(hProcess, TOKEN_ADJUST_PRIVILEGES, &hToken);

    priv.PrivilegeCount = 1;
	priv.Privileges[0].Luid = luid;
	priv.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
    AdjustTokenPrivileges(hToken, false, &priv, 0, 0, 0);

	CloseHandle(hToken); 
}

int main(int argc, char* argv)
{
    HANDLE hWnd, hProcess, AllocAdresse, hRemoteThread;
    DWORD PID;


    hWnd = FindWindow(0, L"Counter-Strike"); //oder soll da hl stehen ? Da es der Process Name hl.exe ist
    GetWindowThreadProcessId((HWND)hWnd, &PID);
    
    hProcess = OpenProcess(PROCESS_ALL_ACCESS, false, PID);

    AllocAdresse = VirtualAllocEx(hProcess, 0, sizeof(Path), MEM_COMMIT, PAGE_EXECUTE_READWRITE);
    WriteProcessMemory(hProcess, (void*)AllocAdresse, (void*)Path, sizeof(Path), 0);
    hRemoteThread=CreateRemoteThread(hProcess, 0, 0, (LPTHREAD_START_ROUTINE) GetProcAddress(GetModuleHandle(L"kernel32.dll"),"LoadLibraryA"), AllocAdresse, 0, 0);
    
    WaitForSingleObject(hRemoteThread, INFINITE);

    VirtualFreeEx(hProcess, AllocAdresse, sizeof(Path), MEM_DECOMMIT);
    CloseHandle(hProcess);
}
XxharCs is offline  
Old 07/21/2011, 19:19   #2


 
MrSm!th's Avatar
 
elite*gold: 7110
Join Date: Jun 2009
Posts: 28,902
Received Thanks: 25,407
Srsly, du kannst die Sprache nicht und willst nen Injector schreiben?

Woher ich das weiß?

Quote:
//oder soll da hl stehen ? Da es der Process Name hl.exe ist
FindWindow.....wieso sollte man da den Prozessnamen angeben?
Natürlich den Fenstertitel...
Btw. bei einer Art Funktion FindProcess wäre es dann natürlich auch "hl.exe" und nicht nur "hl".

Füg mal ein paar Debug-Ausgaben in deinen Code!
Sprich, überprüf die Rückgabewerte und gib eventuelle Fehler aus.
Dann teile uns diese auch mit.
Hellsehen kann hier keiner.
MrSm!th is offline  
Thanks
1 User
Old 07/21/2011, 20:36   #3
 
XxharCs's Avatar
 
elite*gold: 34
Join Date: Apr 2011
Posts: 1,475
Received Thanks: 1,228
Ich kann die Sprache, aber nicht so gut wie du. Ich lerne Java in der Schule, und diese Sprache ist sehr C++ ähnlich. Aber naja das ist egal.

Ich probier es mal mit Debug Ausgaben. Aber ich denke das es an der Konfigurations datei meiner .dll liegt~
XxharCs is offline  
Old 07/21/2011, 20:47   #4


 
MrSm!th's Avatar
 
elite*gold: 7110
Join Date: Jun 2009
Posts: 28,902
Received Thanks: 25,407
Was für eine Konfigurationsdatei?
MrSm!th is offline  
Old 07/21/2011, 20:54   #5
 
XxharCs's Avatar
 
elite*gold: 34
Join Date: Apr 2011
Posts: 1,475
Received Thanks: 1,228
Ist so eine art kleine Options-speicherung für die .dll
Bild:
XxharCs is offline  
Old 07/21/2011, 21:41   #6
 
Lazeboy's Avatar
 
elite*gold: 0
Join Date: Jun 2008
Posts: 451
Received Thanks: 410
Code:
#include "stdafx.h"
[COLOR="Red"]#include <windows.h>[/COLOR]
#include <iostream>

using namespace std;

char const Path[]="Aimbot.dll";

void SetDebugPrivilege() 
{
	HANDLE hProcess=GetCurrentProcess(), hToken;
	TOKEN_PRIVILEGES priv;
	LUID luid;

	OpenProcessToken(hProcess, TOKEN_ADJUST_PRIVILEGES, &hToken);

    priv.PrivilegeCount = 1;
	priv.Privileges[0].Luid = luid;
	priv.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
    AdjustTokenPrivileges(hToken, false, &priv, 0, 0, 0);

	CloseHandle(hToken); 
}

int main(int argc, char* argv)
{
    HANDLE hWnd, hProcess, AllocAdresse, hRemoteThread;
    DWORD PID;


    hWnd = FindWindow(0, L"Counter-Strike"); //oder soll da hl stehen ? Da es der Process Name hl.exe ist
    GetWindowThreadProcessId((HWND)hWnd, &PID);

    [COLOR="Red"]SetDebugPrivilege();[/COLOR] 

    hProcess = OpenProcess(PROCESS_ALL_ACCESS, false, PID);

    AllocAdresse = VirtualAllocEx(hProcess, 0, sizeof(Path), MEM_COMMIT, PAGE_EXECUTE_READWRITE);
    WriteProcessMemory(hProcess, (void*)AllocAdresse, (void*)Path, sizeof(Path), 0);
    hRemoteThread=CreateRemoteThread(hProcess, 0, 0, (LPTHREAD_START_ROUTINE) GetProcAddress(GetModuleHandle(L"kernel32.dll"),"LoadLibraryA"), AllocAdresse, 0, 0);
    
    WaitForSingleObject(hRemoteThread, INFINITE);

    VirtualFreeEx(hProcess, AllocAdresse, sizeof(Path), MEM_DECOMMIT);
    CloseHandle(hProcess);
}

dann gibste den kompletten Path an oder holst ihn dir

Code:
char lpModulePath[MAX_PATH] = {0};
GetModuleFileNameA(NULL,lpModulePath,MAX_PATH);
    lpModulePath[strlen(lpModulePath) - 4] = 0;
    strcat(lpModulePath,".dll");
wenn dein Injector jetzt "Injector.exe" heisst läd er eine Libary "Injector.dll" die in dem selben ordner ist
Lazeboy is offline  
Thanks
1 User
Old 07/21/2011, 21:48   #7
 
XxharCs's Avatar
 
elite*gold: 34
Join Date: Apr 2011
Posts: 1,475
Received Thanks: 1,228
Danke, funkt prima, kann geclosed werden.
XxharCs is offline  
Closed Thread


Similar Threads Similar Threads
[C++]Frage (injector)
03/21/2011 - C/C++ - 1 Replies
Kann man mit C++ Express einen guten dll injector machen? wenn ja kann mir jemand die codes geben?:confused:
Injector Frage
09/30/2010 - 4Story - 1 Replies
Mir kam grad so die Idee, kann ich mit nem Injector, PerX oder ähnlichem nicht auch alte Hacks oder Cheatengine wieder benutzen ? Bin grad nur vom Laptop on, kanns daher nicht testen grad.
Frage zum Injector
06/10/2010 - AutoIt - 2 Replies
Hallo liebe Elitepvpers, Ich habe mal ne Frage: Immer wenn ich einen 4Story-Hack, der einen Injector hat, starte, kommt folgende Fehlermeldung: "Die Anwendung konnte nicht richtig initialisiert werden (0xc0000135). Klicken sie auf "OK", um die Anwendung zu beenden." Was mache ich da falsch, bzw. was fehlt da meinem PC (win xp 32bit) ???
Injector Frage
04/08/2010 - WarRock - 3 Replies
Hallo. Ich bin nun gerade dabei meinen Injector zu Coden. Ich habe nun mein Injector abgespeichert. Aber nun wenn ich schaue: WarRock_Injector_by_Downlo4der\bin\Release Der Ordner ist leer. Da müssten doch eigentlich 3 oder 2 Dateien sein. Habe Microsoft Visual Basic 2008 Express Edition. Hoffe ihr könnt mir helfen :D
Injector Frage!
01/20/2010 - Combat Arms - 3 Replies
Hey leute. #undzwar habe ich folgende frage ich benütze den injector von PerX und dort füge ich die dll datei ein und gebe engine.exe ein "automatisch starten" aber wie öffne ich den hack dann ingame mit dem injector?



All times are GMT +1. The time now is 16:47.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.