Speicheradressen Value ändern



  • Hallo, ich habe gestern einen Gamecheat für Left For Dead gecodet ( unendlich Leben, Munition ).
    Das hat auch super geklappt. Ich bin 14, also wundert euch bitte nicht, warum ich Videospiele spiele.
    Ich habe das ganze für GTA heute gecodet. Wenn ich die Speicheradressen manuell ändere, funktioniert das ganze Perfekt. Wenn ich es aber über C++ ändere, dann funktioniert es nicht.
    Was habe ich falsch gemacht? Die Speicheradressen sind alle korrekt (sind nur für das Wanted-Lvel).

    #include <iostream>
    #include <windows.h>
    
    void credits() {
    	std::cout << "------------------------------------------------------------------------------------------------------------------------";
    	std::cout << "\n\n";
    	std::cout << "GTA V Cheat - Developed by RedException";
    	std::cout << "\n\n";
    	std::cout << "------------------------------------------------------------------------------------------------------------------------";
    	std::cout << "\n\n";
    }
    
    int main(int argc, char** argv[]) {
    	int wantedlvl = 0;
    	credits();
    	std::cout << "searching for window..." << std::endl;
    	HWND hwnd = FindWindowA(NULL, "Grand Theft Auto V");
    	Sleep(1500);
    	if (!hwnd == NULL) {
    
    		std::cout << "window found.\ninjecting..." << std::endl;
    		Sleep(2000);
    		DWORD procid;
    		DWORD dw = GetWindowThreadProcessId(hwnd, &procid);
    		HANDLE handle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, procid);
    		if (procid == NULL) {
    			std::cout << "cannot optain process!" << std::endl;
    		}
    		else {
    			std::cout << "injecting succesfull!\nHave fun..." << std::endl;
    			while (true) {
    				WriteProcessMemory(handle, (LPVOID)0x1D81B9F55F8, &wantedlvl, sizeof(wantedlvl), 0);
    				WriteProcessMemory(handle, (LPVOID)0x1D8220F66C8, &wantedlvl, sizeof(wantedlvl), 0);
    				WriteProcessMemory(handle, (LPVOID)0x1D821748738, &wantedlvl, sizeof(wantedlvl), 0);
    				WriteProcessMemory(handle, (LPVOID)0x1D8220F66C8, &wantedlvl, sizeof(wantedlvl), 0);
    				WriteProcessMemory(handle, (LPVOID)0x1D8244B5C14, &wantedlvl, sizeof(wantedlvl), 0);
    				WriteProcessMemory(handle, (LPVOID)0x1D8244B5C18, &wantedlvl, sizeof(wantedlvl), 0);
    				WriteProcessMemory(handle, (LPVOID)0x7FF650C26404, &wantedlvl, sizeof(wantedlvl), 0);
    				WriteProcessMemory(handle, (LPVOID)0x7FF65147F228, &wantedlvl, sizeof(wantedlvl), 0);
    				WriteProcessMemory(handle, (LPVOID)0x7FF651549D20, &wantedlvl, sizeof(wantedlvl), 0);
    			}
    		}
    	}
    	else {
    
    		std::cout << "Couldn't found window.";
    		std::cout << "Please open GTA V!\nexiting...";
    		Sleep(3000);
    		exit(-1);
    	}
    }
    

    MfG



  • @Aleskej sagte in Speicheradressen Value ändern:

    Wenn ich es aber über C++ ändere

    Was heißt das?

    obtain schreibt man mit 'b'.

    Tip für bessere Lesbarkeit:

    Nicht

    if (everything_ok) {
        // loads of code
        // loads of code
        // loads of code
        // loads of code
        // loads of code
        // loads of code
        // loads of code
    } else {
        // few lines of code
        return;
    }
    

    sondern besser

    if (!everything_ok) {
        // few lines of code
        return;
    }
    // loads of code
    


  • @Swordfish ich meine es, wenn ich die Value von der Speicheradresse über C++ ändere. Mein Englisch ist nicht das beste ( mein Deutsch auch nicht) und darum geht es ja nicht.



  • @Aleskej sagte in Speicheradressen Value ändern:

    wenn ich die Value von der Speicheradresse über C++ ändere.

    Ja, das sagtest Du bereits. Aber was soll das bedeuten?? Code??



  • @Swordfish

    
    
    				WriteProcessMemory(handle, (LPVOID)0x1D81B9F55F8, &wantedlvl, sizeof(wantedlvl), 0);
    				WriteProcessMemory(handle, (LPVOID)0x1D8220F66C8, &wantedlvl, sizeof(wantedlvl), 0);
    				WriteProcessMemory(handle, (LPVOID)0x1D821748738, &wantedlvl, sizeof(wantedlvl), 0);
    				WriteProcessMemory(handle, (LPVOID)0x1D8220F66C8, &wantedlvl, sizeof(wantedlvl), 0);
    				WriteProcessMemory(handle, (LPVOID)0x1D8244B5C14, &wantedlvl, sizeof(wantedlvl), 0);
    				WriteProcessMemory(handle, (LPVOID)0x1D8244B5C18, &wantedlvl, sizeof(wantedlvl), 0);
    				WriteProcessMemory(handle, (LPVOID)0x7FF650C26404, &wantedlvl, sizeof(wantedlvl), 0);
    				WriteProcessMemory(handle, (LPVOID)0x7FF65147F228, &wantedlvl, sizeof(wantedlvl), 0);
    				WriteProcessMemory(handle, (LPVOID)0x7FF651549D20, &wantedlvl, sizeof(wantedlvl), 0);
    
    


  • Was gibt WriteProcessMemory() zurück? Wenn WriteProcessMemory() 0 zurückgibt, was liefert GetLastError()?

    Bzw. vorher schon. Welchen Wert hat handle?

    Process Security and Access Rights:

    To open a handle to another process and obtain full access rights, you must enable the SeDebugPrivilege privilege. For more information, see Changing Privileges in a Token.


Log in to reply