LostGamerz
[Gamehacking] Gamehacking with C++ for beginners. 1296785282
LostGamerz
[Gamehacking] Gamehacking with C++ for beginners. 1296785282
LostGamerz
Would you like to react to this message? Create an account in a few clicks or log in to continue.



 
HomePinoy VendeTaLatest imagesRegisterLog in

 

 [Gamehacking] Gamehacking with C++ for beginners.

Go down 
AuthorMessage
Crowd™
Administrator
Administrator
Crowd™


Join date : 31/01/2011
LostPoints : 10383
Thanks & Rep : 28
Posts : 229
Age : 33
Location : 6ret
Warning Level : [Gamehacking] Gamehacking with C++ for beginners. WarningBar-Gloss1

[Gamehacking] Gamehacking with C++ for beginners. Empty
PostSubject: [Gamehacking] Gamehacking with C++ for beginners.   [Gamehacking] Gamehacking with C++ for beginners. Icon_minitimeSun Aug 05, 2012 4:00 am

Moin Moin, since here pretty little los is, I would like to try a small tutorial on the topic of "Gamehacking" enrich. I chose a program as "victims" that everyone has and everybody knows: Windows solitary .

First time what your needs/need to know:

- Basic C++ knowledge - a C++ IDE. I use Visual C++ Express Edition 2008.]
-TSearch delphi vcl. (can be found here:[Only admins are allowed to see this link]

- Windows XP (the offset is under other versions of windows (probably) different. However, there should be no problem for other versions of Windows, that also implement .
- You need to be at least a partial understanding how in solitary points makes . If not -> Wikipedia, the free encyclopedia . -A little time

What we want to do:

We would like to find out the memory address of the rapid test scoring in solitary and then write a C++ program that the value in our value has changed.

So, let's go's .

First we open 's TSearch delphi vcl. and solitary. We then choose in 'S Tsearch delphi vcl. the solitary process from


[Only admins are allowed to see this image]

Now we need the Offset, the memory address is stored in the number of marks, find. First we click on the small magnifying glass and select as our starting value 0. Logical , or ? We start with 0 points

[Only admins are allowed to see this image]

We must now make something that the points raised. Then we click on the magnifying glass with the three points and then select "has increased," ( deu: "has increased" ) from. So we're looking for a value, the time was 0 but now has increased.
[Only admins are allowed to see this image]

Click on OK and we connect you a small window that says, how many "Kanidaten" is still available for selection. Closes the window with one click on the OK button.

So, now we let our points tally again fall to 0 and then we will increase the points again. Then we click quickly back on the small magnifying glass with the three points and then select "exact value" in the dropdown menu. We then will give quickly the current score and click on OK. Then it should really only have a value remain. If this is not so, leads the Games continue until only a value is left. Your memory address space had in Windows XP is supposed to be "A5060".

[Only admins are allowed to see this image]

Our small hack:


Many people will now probably questions: how the hell i countries a value with C++ ??? Don't worry, it isn't possible at all times so sword . Creates a new, empty a console application. We first time to start with our basic structure:

Code:
#include <windows.h> // Hier sind die Funktionen die wir später noch brauchen
#include <iostream> // Sollte klar sein

using namespace std; // Sollte auch klar sein ...

int main()  // Unsere Main Funktion...
{




cin.get(); //Damit sich unser Programm nicht sofort schließt...
}

That is something everybody should know. Some will probably learn something new. In the first place we would like to find out the window handle of solitary. The window handle is an integer value, of a window or control identified. In C++ such therefore in the 611 'hwnd' saved. With the function FindWindow then we can to get the window handle.

Code:
#include <windows.h> // Hier sind die Funktionen die wir später noch brauchen
#include <iostream> // Sollte klar sein

using namespace std; // Sollte auch klar sein ...

int main()  // Unsere Main Funktion...
{
HWND hwnd; // Unsere Variable die das Fensterhandle speichert.
hwnd = FindWindow(0,L"Solitär");

// Der Fenstertitel vom Solitärfenster ist "Solitär". Das erste Parameter ist der "ClassName" den wir aber getrost ignorieren können. Das zweite Parameter ist unser Fenstername. Das "L" steht für eine Typkonvertierung..

if(!hwnd) // Also das Fenster nicht vorhanden ist...
{
   cout << "Solitär nicht gefunden!" << endl; // Gebe das aus
}
else  // ansonsten...
{
   cout << "Solitär gefunden!" << endl; // gebe das aus
        cout << "Fensterhandle: " << hwnd << endl; // Wir können uns das Handle auch nochmal angucken ...
}


cin.get(); //Damit sich unser Programm nicht sofort schließt...
}

So try this code and then it goes on. Now we have to have the ID of the thread's to get the window has produced. The ID we need later. (If you don't know what a thread is, is not quite so tragic. When the opportunity time at Wikipedia and email confirmations ) So, here's the Code:

Code:
#include <windows.h> // Hier sind die Funktionen die wir später noch brauchen
#include <iostream> // Sollte klar sein

using namespace std; // Sollte auch klar sein ...

int main()  // Unsere Main Funktion...
{
HWND hwnd; // Unsere Variable die das Fensterhandle speichert.
hwnd = FindWindow(0,L"Solitär");
DWORD Id; // Die ID wird in einer Variable des Typ's DWORD gespeichert.

// Der Fenstertitel vom Solitärfenster ist "Solitär". Das erste Parameter ist der "ClassName" den wir aber getrost ignorieren können. Das zweite Parameter ist unser Fenstername. Das "L" steht für eine Typkonvertierung..

if(!hwnd) // Also das Fenster nicht vorhanden ist...
{
   cout << "Solitär nicht gefunden!" << endl; // Gebe das aus
}
else  // ansonsten...
{
   cout << "Solitär gefunden!" << endl; // gebe das aus
        cout << "Fensterhandle: " << hwnd << endl; // Wir können uns das Handle auch nochmal angucken ...
     
        GetWindowThreadProcessId(hwnd,&Id); // Mit GetWindowThreadProcessId kann man die ID herausfinden. Das erste Parameter ist unser Fensterhandle. Das zweite gibt an, wo die ID gespeichert werden soll.

        cout << Id << endl;

}


cin.get();//Damit sich unser Programm nicht sofort schließt...
}

So now it is no longer so far . Now we open up to the process so that we can finally write ... First we create a variable that holds our handle to the open process. This is of the type "handle". Then we open up to the process with OpenProcess.

Code:
#include <windows.h> // Hier sind die Funktionen die wir später noch brauchen
#include <iostream> // Sollte klar sein

using namespace std; // Sollte auch klar sein ...

int main()  // Unsere Main Funktion...
{
HWND hwnd; // Unsere Variable die das Fensterhandle speichert.
hwnd = FindWindow(0,L"Solitär");
DWORD Id; // Die ID wird in einer Variable des Typ's DWORD gespeichert.
HANDLE ProcessHandle;

// Der Fenstertitel vom Solitärfenster ist "Solitär". Das erste Parameter ist der "ClassName" den wir aber getrost ignorieren können. Das zweite Parameter ist unser Fenstername. Das "L" steht für eine Typkonvertierung..
if(!hwnd) // Also das Fenster nicht vorhanden ist...
{
   cout << "Solitär nicht gefunden!" << endl; // Gebe das aus
}
else  // ansonsten...
{
   cout << "Solitär gefunden!" << endl; // gebe das aus
        cout << "Fensterhandle: " << hwnd << endl; // Wir können uns das Handle auch nochmal angucken ...
     
        GetWindowThreadProcessId(hwnd,&Id); // Mit GetWindowThreadProcessId kann man die ID herausfinden. Das erste Parameter ist unser Fensterhandle. Das zweite gibt an, wo die ID gespeichert werden soll.

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


}

The first parameter are our "rights" which we have for the process. PROCESS_VM_WRITE means that we must write in the process and PROCESS_VM_OPERATION means that we be allowed to operate in the process. The second parameter specifies whether our "victims" process generated processes inherit the handle. We set to false. The third parameter is our ThreadID. So now where the process is open we will finally be able to write him. We do this with "WriteProcessMemory".

Code:
{
HWND hwnd; // Unsere Variable die das Fensterhandle speichert.
hwnd = FindWindow(0,L"Solitär");
DWORD Id; // Die ID wird in einer Variable des Typ's DWORD gespeichert.
HANDLE ProcessHandle;
int value; // Der Wert den wir schreiben wollen.
unsigned adress = 0x0A5060; // Unsere Adresse

// Der Fenstertitel vom Solitärfenster ist "Solitär". Das erste Parameter ist der "ClassName" den wir aber getrost ignorieren können. Das zweite Parameter ist unser Fenstername. Das "L" steht für eine Typkonvertierung..

if(!hwnd) // Also das Fenster nicht vorhanden ist...
{
   cout << "Solitär nicht gefunden!" << endl; // Gebe das aus
}
else  // ansonsten...
{
   cout << "Solitär gefunden!" << endl; // gebe das aus
        cout << "Fensterhandle: " << hwnd << endl; // Wir können uns das Handle auch nochmal angucken ...
     
        GetWindowThreadProcessId(hwnd,&Id); // Mit GetWindowThreadProcessId kann man die ID herausfinden. Das erste Parameter ist unser Fensterhandle. Das zweite gibt an, wo die ID gespeichert werden soll.

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

      cout << "How much points to add? "; // Wieviel Punkte sollen geschrieben werden ???
   cin >> value; // Den Wer übernehmen
   fflush(stdin);

   
   
   WriteProcessMemory(ProcessHandle,(LPVOID)adress,&value,sizeof(int),NULL);  // Den Wert schreiben !
   cout << "Wert geschrieben" << endl;
   cin.get();// Damit sich unser Programm nicht sofort schließt...
}



}

Once I have an int variable with the name "value" has been drawn up. It keeps the points we want to write. In addition the address of type unsigned (int). We then the value to write with a cin queried and then the function called WriteProcessMemory. The first parameter is the handle to the open process. The second parameter our to LPCVOID converted address. The third parameter of the value to write. The fourth parameter specifies how many bytes we want to write.

Spoiler:
Back to top Go down
https://pinoyvendetta.forumtl.com
 
[Gamehacking] Gamehacking with C++ for beginners.
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
LostGamerz :: Coding Section :: Coding and Programming-
Jump to: