S4 League Dmg Hack Problem

12/29/2009 00:11 Σternαl.#1
Hallo liebe Comunity !

Ich habe mir demletzt einen kleinen S4 League Hack gecodet,
nachdem ich mir hier ein Gamehacking mit C++ Tutorial durchgelesen hatte.
Ich will 2 Values verändern, das Programm läuft zwar, jedoch
wird der Dmg nicht verändert.
Hoffe, ihr könnt mir helfen :)
Btw bin noch ein kompletter Anfänger, also bitte kein geflame^^
Info: Die zu verändernden Values sind Float 1.
€dit: Ich benutze Visual Studios Express.

Hallo everyone !

I've coded a little dmg hack for S4 League having read
a tutorial about gamehacking with C++.
The hack is supposed to change 2 values. The programm is running,
but the dmg doesn't get changed. I hope you can help me. :)
Btw I'm a complete beginner so pls don't flame^^
Info: the values that shall be changed are both float 1.
€dit: I'm using Visual Studios Express.

Here's the sourcecode:
Hier ist der Sourcecode:

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

using namespace std; 

int main()  
{
	HWND hwnd; 
	hwnd = FindWindow(0,L"S4 Client");
	DWORD Id; 
	HANDLE ProcessHandle;
	float value; 
	unsigned adress = 0x000D57BC0; 
	unsigned adress2 = 0x0000D57BC4;

		if(!hwnd) 
		{
			cout << "S4 League not found !" << endl; 
		}
		else  
		{
			cout << "S4 League found !" << endl; 
			cout << "Windowhandle: " << hwnd << endl; 
       
			GetWindowThreadProcessId(hwnd,&Id); 

			cout << "Process Id: " << Id << endl;
			ProcessHandle = OpenProcess(PROCESS_VM_WRITE |PROCESS_VM_OPERATION ,FALSE,Id);
	
			cout << "ProcessHandle: " << ProcessHandle << endl;

			cout << "How much points to add? "; 
			cin >> value; 
			fflush(stdin);

			WriteProcessMemory(ProcessHandle,(LPVOID)adress,&value,sizeof(int),NULL);
			WriteProcessMemory(ProcessHandle,(LPVOID)adress2,&value,sizeof(int),NULL);
			cout << "Points added " << endl;
			cin.get();
		}



}
12/29/2009 00:56 wurstbrot123#2
nehm mal fflush raus
nebenbei:
du Fragst danach wieviele Punkte er hinzufügen soll, jedoch
schreibst du einfach das was eingegeben wurde im Speicher.
Wenn du den eingegebenen Wert nur hinzufügen willst,
musst du natürlich vorher auslesen was für ein Wert an
der Addresse ist bevor du den neuen reinschreibst.
DH lesen was der momentane wert ist, eingabe holen,
eingabe += alter wert
Und dann eingabe im Speicher schreiben
12/29/2009 00:56 MrSm!th#3
Quote:
Originally Posted by FooFightah View Post
Hallo liebe Comunity !

Ich habe mir demletzt einen kleinen S4 League Hack gecodet,
nachdem ich mir hier ein Gamehacking mit C++ Tutorial durchgelesen hatte.
Ich will 2 Values verändern, das Programm läuft zwar, jedoch
wird der Dmg nicht verändert.
Hoffe, ihr könnt mir helfen :)
Btw bin noch ein kompletter Anfänger, also bitte kein geflame^^
Info: Die zu verändernden Values sind Float 1.
€dit: Ich benutze Visual Studios Express.

Hallo everyone !

I've coded a little dmg hack for S4 League having read
a tutorial about gamehacking with C++.
The hack is supposed to change 2 values. The programm is running,
but the dmg doesn't get changed. I hope you can help me. :)
Btw I'm a complete beginner so pls don't flame^^
Info: the values that shall be changed are both float 1.
€dit: I'm using Visual Studios Express.

Here's the sourcecode:
Hier ist der Sourcecode:

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

using namespace std; 

int main()  
{
	HWND hwnd; 
	hwnd = FindWindow(0,L"S4 Client");
	DWORD Id; 
	HANDLE ProcessHandle;
	float value; 
	unsigned adress = 0x000D57BC0; 
	unsigned adress2 = 0x0000D57BC4;

		if(!hwnd) 
		{
			cout << "S4 League not found !" << endl; 
		}
		else  
		{
			cout << "S4 League found !" << endl; 
			cout << "Windowhandle: " << hwnd << endl; 
       
			GetWindowThreadProcessId(hwnd,&Id); 

			cout << "Process Id: " << Id << endl;
			ProcessHandle = OpenProcess(PROCESS_VM_WRITE |PROCESS_VM_OPERATION ,FALSE,Id);
	
			cout << "ProcessHandle: " << ProcessHandle << endl;

			cout << "How much points to add? "; 
			cin >> value; 
			fflush(stdin);

			WriteProcessMemory(ProcessHandle,(LPVOID)adress,&value,[COLOR="Red"]sizeof(int)[/COLOR],NULL);
			WriteProcessMemory(ProcessHandle,(LPVOID)adress2,&value,[COLOR="Red"]sizeof(int)[/COLOR],NULL);
			cout << "Points added " << endl;
			cin.get();
		}



}
;)
12/29/2009 01:04 wurstbrot123#4
MrSmith das ist eigentlich nicht der Fehler.
Denn ein int und ein Float sind beide 4 Bytes groß.
Und if(!hwnd) ist das selbe wie if(hwnd == 0)
also ist das schon richtig
12/29/2009 01:16 Σternαl.#5
Und wie mache ich das, dass er den Wert ließt?
ReadProcessMemory(?) vergesst nicht ich bin
Anfänger also pls erklären welche Parameter man braucht / wie diese aussehen^^
12/29/2009 01:17 wurstbrot123#6
[Only registered and activated users can see links. Click Here To Register...]

google ist bei sowas sehr hilfreich =P

edit:
[Only registered and activated users can see links. Click Here To Register...]
natürlich brauchst du dann auch lese rechte
12/29/2009 01:20 Σternαl.#7
Sry aber ich versteh sowas noch nciht xD
Wäre nett, wenn jemand den fertigen ReadProcessMemory Code angeben würde.
12/29/2009 01:24 wurstbrot123#8
Durch copy / paste wirst du auch nicht allzu weit kommen...
Lern am besten erstmal die basics von c++ dann verstehst du
auch die Informationen die du in MSDN findest. Wenn es dir nur darum
geht irgendwelche hacks zu machen, lern besser Auto It :>
12/29/2009 01:28 Σternαl.#9
Ja also ein bisschen was hab ich ja schon gelernt/bin es am lernen.
AutoIt is nix für mich^^
Wenn ne Sprache, dann auch eine, womit man mehr als Bots
programmieren kann^^ Ich find C++, obwohl ich es noch garnich
richtig kann, jetzt schon ne gute Sprache, also die gefällt mir
von der Übersichtlichkeit und von den Funktionen her^^
12/29/2009 01:32 wurstbrot123#10
Mit Auto It kann man auch mehr als Bots machen :>.
Naja ich will mal nicht so sein :>
Code:
float a = 0;
float value = 0;

ProcessHandle = OpenProcess(PROCESS_VM_WRITE | PROCESS_VM_READ ,FALSE,Id);
ReadProcessMemory(ProcessHandle, (void*)address, &a, 4, NULL);
cout << ">";
cin >> value;
value += a;
WriteProcessMemory(ProcessHandle, (void*)address, &value, 4, NULL);
Das ist ein Beispiel, das anpassen auf deinem Sourcecode musst du
selber hinbekommen :p
12/29/2009 02:02 Σternαl.#11
So klappen tut es immernoch nicht, aber ich habs wenigstens versucht^^
Code:
#include <windows.h> 
#include <iostream> 

using namespace std; 

int main()  
{
	HWND hwnd; 
	DWORD Id; 
	HANDLE ProcessHandle;
	float value; 
	float value2;
	float a;
	float b;
	unsigned adress = 0x000D57BC0; 
	unsigned adress2 = 0x0000D57BC4;
	hwnd = FindWindow(0,L"S4 Client");

		if(!hwnd) 
		{
			cout << "S4 League not found !" << endl; 
		}
		else  
		{
			cout << "S4 League found !" << endl; 
			cout << "Windowhandle: " << hwnd << endl; 
       
			GetWindowThreadProcessId(hwnd,&Id); 

			cout << "Process Id: " << Id << endl;
			ProcessHandle = OpenProcess(PROCESS_VM_WRITE |PROCESS_VM_READ ,FALSE,Id);
	
			cout << "ProcessHandle: " << ProcessHandle << endl;

			ReadProcessMemory(ProcessHandle, (void*)adress, &value, 4, NULL);
			ReadProcessMemory(ProcessHandle, (void*)adress2, &value2, 4, NULL);
			
			cout << "How much points to add? "; 

			cin >> a;
			cin >> b;
			a += value;
			b += value2;

			WriteProcessMemory(ProcessHandle,(LPVOID)adress,&a,sizeof(int),NULL);
			WriteProcessMemory(ProcessHandle,(LPVOID)adress2,&b,sizeof(int),NULL);
			
			cout << "Points added " << endl;

			cin.get();
		}
12/29/2009 12:39 MrSm!th#12
Quote:
Originally Posted by wurstbrot123 View Post
MrSmith das ist eigentlich nicht der Fehler.
Denn ein int und ein Float sind beide 4 Bytes groß.
Und if(!hwnd) ist das selbe wie if(hwnd == 0)
also ist das schon richtig
war mir schon klar
warum bist du schneller als meine edits? >.<
da hatte ich mich (um 1 uhr :rolleyes:) verlesen

und das mit den 4bytes hatte ich vergessen

wie schon per PN
versuch mal mit PRCESS_ALL_ACCESS
12/29/2009 12:48 Σternαl.#13
Klappt immernoch nicht^^
Der fürht alles aus aber "Points added" kommt nicht^^

#include <windows.h>
#include <iostream>

using namespace std;

int main()
{
HWND hwnd;
DWORD Id;
HANDLE ProcessHandle;
float value;
float value2;
float a;
float b;
unsigned adress = 0x000D57BC0;
unsigned adress2 = 0x0000D57BC4;
hwnd = FindWindow(0,L"S4 Client");

if(!hwnd)
{
cout << "S4 League not found !" << endl;
}
else
{
cout << "S4 League found !" << endl;
cout << "Windowhandle: " << hwnd << endl;

GetWindowThreadProcessId(hwnd,&Id);

cout << "Process Id: " << Id << endl;

ProcessHandle = OpenProcess(PROCESS_ALL_ACCESS ,FALSE,Id);

cout << "ProcessHandle: " << ProcessHandle << endl;

ReadProcessMemory(ProcessHandle, (void*)adress, &value, 4, NULL);
ReadProcessMemory(ProcessHandle, (void*)adress2, &value2, 4, NULL);

cout << "How much points to add? " << endl;

cin >> a;
cin >> b;
a += value;
b += value2;

WriteProcessMemory(ProcessHandle,(LPVOID)adress,&a ,sizeof(float),NULL);
WriteProcessMemory(ProcessHandle,(LPVOID)adress2,& b,sizeof(float),NULL);

cout << "Points added " << endl;

cin.get();
}



}
12/29/2009 12:57 wurstbrot123#14
unsigned adress = 0xD57BC0;
unsigned adress2 = 0xD57BC4;

Ansonten, bitte Code tags benutzen.
Wenn du Vista oder Win7 hast starte natürlich als Administrator.

Dann mach noch folgendes:

Code:
if(!processhandle)
{
        cout << "wasnt able to get Proccess Acces, errorcode: "
        << GetLastError() << '\n';
}
Falls es immernoch nicht klappen sollte, benutz mal GetLastError
am ende. Wenn du dann einen Errorcode hast,
[Only registered and activated users can see links. Click Here To Register...]
guckst du da nach was los ist.

@MrSmith
weil du müde warst :p
12/29/2009 13:01 MrSm!th#15
Ja hab ich ihm auch schon geraten.

Einfach mal
Code:
if(!WriteProcessMemory(...))
{
 cout << GetLastError();
}
denn er sagt ja, dass er nur nicht bis zum points added kommt!

Übrigens bin ich mir sicher, es liegt am Hackshield ;)

Probiers doch erstmal übungsweise mit Solitär