Page 1 of 2 12 LastLast
Results 1 to 15 of 29
  1. #1
    Tightmarrow's Avatar
    Join Date
    Dec 2016
    Gender
    male
    Posts
    40
    Reputation
    31
    Thanks
    21

    Making C++ Hacks

    Basics of a C++ Cheat
    Note: Sorry if I have some mistakes, also you should read everything so you'll be able to fix stuff in case of errors.

    Code:
    #include <iostream>
    #include <windows.h>
    This is pretty much all we're going to need for a simple console program, even if you want to add some other stuff, it's probably already in one of these two. Also, you will need to also include "stdafx.h" if you're using visual studio.

    Code:
    int main(){
    We're using this because we will eventually have to return some integer values too, else we would just use void main.

    Code:
    SetConsoleTitle(L"Whatever_You_Like");
    This is used to set the title of our console program (that means the name you see at the top) to something else. The L before the string is there for compatibility reasons and as long as you don't use any numbers, everything should go well.

    Code:
    HWND Window = FindWindow(NULL, L"Game");
    With this code, we are getting the handle of a specific window, which is "Game" (you can of course change it with whatever your game's window name is) and remember, it's not case-sensitive (If your window says "Battlefield" you can use "battlefield" too).

    Code:
    	if (!Window){
    		return 0;
    	}
    If the window (the one used above) has not been found (that's why the '!' is there), it closes the console (return 0);

    Code:
    else{
                    DWORD Pid;
    		GetWindowThreadProcessId(Window, &Pid);
    		HANDLE ProcessHandle= OpenProcess(PROCESS_ALL_ACCESS, FALSE, Pid);
    Pretty understandable from the code itself, we are getting a handle on the process itself to be able to edit its memory, of course.

    Code:
    		if(!ProcessHandle){
    			return 0;
    		}
    Again, if the program can't attach to it or maybe the process is stopping this from happening it will close your program.

    Code:
    else{
    This is where the actual hack begins, if all goes well.

    Code:
    for(;;){
    This is a not-so-very popular way to create a loop, while(0){ can be used too. A loop basically means it will keep running trough the code and see if anything change or actually change something. Basically think it as freezing an address in cheat engine (though that's not the only thing we'll use it for.

    Code:
    if(GetAsyncKeyState(VK_F2)){
    This check if a key has been pressed, in this example we're using the F2 key. The added & 0x8000 you probably have seen before refers to the key being held, as far as I know, but it's really just useless in this example, you just want it to be pressed.

    Code:
    UINT_PTR FByteAddress= 0x01182A74;
    float FloatAddress = 0x011A5B90;
    int ValueForReading = NULL;
    double DoubleAddress = 0x00FDB0F0;
    It's not very common that I see people use UINT_PTR, but it's basically a replacement for stuff including DWORD and is made especially for the 64 bit addressing and also able to hold more information. We also declared the integer 'ValueForReading' to hold the value for ReadProcessMemory (what's below)

    Code:
    ReadProcessMemory(ProcessHandle, reinterpret_cast<void*>(FByteAddress), &ValueForReading, sizeof(ValueForReading ), nullptr)
    We are basically reading 4ByteAddress' or 0x01182A74's value and storing it in the ValueForReading integer. You may also be un-familiar with nullptr which can also be overloaded, which you can use NULL (which is an integer with the value 0), but sadly if you use an old compiler, you may actually need to use NULL.

    Code:
    std::cout << "Value of 4Byte: " << ValueForReading << ".\n";
    Here we actually print ValueForReading's value just to check. Also, the "\n" is an alternative to std::endl or endl.

    Code:
    UINT_PTR Offsets[] = {0x4c, 0x3b};
    Here we're defining the offsets of our address (let's pretend we have offsets) and remember to write them in reverse of how they are in cheat engine (bottom to top).

    Code:
    WriteProcessMemory(ProcessHandle, reinterpret_cast<void*>(FByteAddress), &Offsets, 2, nullptr);
    Here we wrote the value '2' to that address basically, but let's move onto something like writing bytes.

    Code:
    WriteProcessMemory(ProcessHandle, reinterpret_cast<void*>(FByteAddress), "/0x90/, 1, nullptr);
    Here we wrote a nop which translates into 90 bytes (This shows into the Memory Viewer in Cheat Engine).



    That is where you will get your bytes from. I won't go too much into detail on Assembly as it's not what I wanted to focus on. A full code can be found down below.

    Code:
    #include <iostream>
    #include <windows.h>
    
    int main(){
    	SetConsoleTitle(L"djihjninjinjmu");
    	HWND Window = FindWindow(NULL, L"csgo");
    	if (!Window){
    		return 0;
    	}
    	else{
    		DWORD pID;
    		GetWindowThreadProcessId(Window, &pID);
    		HANDLE Hproc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pID);
    		if(!Hproc){
    			return 0;
    		}
    		else{
    			std::cout << "Press F3 to activate.\n";
    			for(;;){
    				if(GetAsyncKeyState(VK_F3)){
    					float Crosshair;
    					UINT_PTR CrosshairAddress = 0x44ABC04;
    					UINT_PTR Shoot = 0x5C4BB;
    					ReadProcessMemory(Hproc, reinterpret_cast<void*>(CrosshairAddress), &Crosshair, sizeof(Crosshair), nullptr);
    					if(Crosshair == 0){
    						WriteProcessMemory(Hproc, reinterpret_cast<void*>(Shoot), "0x32/0x8B/0x90/0x20/0x01/", 5, nullptr);
    						//This writes a special asm code that makes it shoot (it's just like changing its value from 0 to 1 but I preffer using this)
    					}
    					else if(Crosshair == 1){
    						WriteProcessMemory(Hproc, reinterpret_cast<void*>(Shoot), "0x32/0x8B/0x90/0x20/0x00/", 5, nullptr);
    						//It doesn't shoot from here
    					}
    				}
    				
    			}
    		}
    	}
    }
    Attached Thumbnails Attached Thumbnails
    666.png  

    Last edited by Tightmarrow; 12-11-2016 at 04:48 AM.

  2. The Following 13 Users Say Thank You to Tightmarrow For This Useful Post:

    AdamoJ1337 (01-30-2017),BlxxdyyKate (12-14-2016),Brock Lee (01-03-2017),DaniielSanchez (12-11-2016),EL Surenzo dA KK Caponeiyl (12-18-2016),ETHerthethaethaetheh (12-14-2016),garupede (12-23-2016),gusem (02-23-2017),killingspree888 (12-12-2016),S3NT1MZ (12-30-2016),STARSTEAM (06-11-2017),tisauk (12-13-2016),VOSSWATER (01-26-2017)

  3. #2
    DaniielSanchez's Avatar
    Join Date
    Nov 2016
    Gender
    male
    Location
    Venezuela
    Posts
    71
    Reputation
    14
    Thanks
    11
    My Mood
    Bashful
    Quote Originally Posted by Tightmarrow View Post
    Basics of a C++ Cheat
    Note: Sorry if I have some mistakes, also you should read everything so you'll be able to fix stuff in case of errors.

    Code:
    #include <iostream>
    #include <windows.h>
    This is pretty much all we're going to need for a simple console program, even if you want to add some other stuff, it's probably already in one of these two. Also, you will need to also include "stdafx.h" if you're using visual studio.

    Code:
    int main(){
    We're using this because we will eventually have to return some integer values too, else we would just use void main.

    Code:
    SetConsoleTitle(L"Whatever_You_Like");
    This is used to set the title of our console program (that means the name you see at the top) to something else. The L before the string is there for compatibility reasons and as long as you don't use any numbers, everything should go well.

    Code:
    HWND Window = FindWindow(NULL, L"Game");
    With this code, we are getting the handle of a specific window, which is "Game" (you can of course change it with whatever your game's window name is) and remember, it's not case-sensitive (If your window says "Battlefield" you can use "battlefield" too).

    Code:
    	if (!Window){
    		return 0;
    	}
    If the window (the one used above) has not been found (that's why the '!' is there), it closes the console (return 0);

    Code:
    else{
                    DWORD Pid;
    		GetWindowThreadProcessId(Window, &Pid);
    		HANDLE ProcessHandle= OpenProcess(PROCESS_ALL_ACCESS, FALSE, Pid);
    Pretty understandable from the code itself, we are getting a handle on the process itself to be able to edit its memory, of course.

    Code:
    		if(!ProcessHandle){
    			return 0;
    		}
    Again, if the program can't attach to it or maybe the process is stopping this from happening it will close your program.

    Code:
    else{
    This is where the actual hack begins, if all goes well.

    Code:
    for(;;){
    This is a not-so-very popular way to create a loop, while(0){ can be used too. A loop basically means it will keep running trough the code and see if anything change or actually change something. Basically think it as freezing an address in cheat engine (though that's not the only thing we'll use it for.

    Code:
    if(GetAsyncKeyState(VK_F2)){
    This check if a key has been pressed, in this example we're using the F2 key. The added & 0x8000 you probably have seen before refers to the key being held, as far as I know, but it's really just useless in this example, you just want it to be pressed.

    Code:
    UINT_PTR FByteAddress= 0x01182A74;
    float FloatAddress = 0x011A5B90;
    int ValueForReading = NULL;
    double DoubleAddress = 0x00FDB0F0;
    It's not very common that I see people use UINT_PTR, but it's basically a replacement for stuff including DWORD and is made especially for the 64 bit addressing and also able to hold more information. We also declared the integer 'ValueForReading' to hold the value for ReadProcessMemory (what's below)

    Code:
    ReadProcessMemory(ProcessHandle, reinterpret_cast<void*>(FByteAddress), &ValueForReading, sizeof(ValueForReading ), nullptr)
    We are basically reading 4ByteAddress' or 0x01182A74's value and storing it in the ValueForReading integer. You may also be un-familiar with nullptr which can also be overloaded, which you can use NULL (which is an integer with the value 0), but sadly if you use an old compiler, you may actually need to use NULL.

    Code:
    std::cout << "Value of 4Byte: " << ValueForReading << ".\n";
    Here we actually print ValueForReading's value just to check. Also, the "\n" is an alternative to std::endl or endl.

    Code:
    UINT_PTR Offsets[] = {0x4c, 0x3b};
    Here we're defining the offsets of our address (let's pretend we have offsets) and remember to write them in reverse of how they are in cheat engine (bottom to top).

    Code:
    WriteProcessMemory(ProcessHandle, reinterpret_cast<void*>(FByteAddress), &Offsets, 2, nullptr);
    Here we wrote the value '2' to that address basically, but let's move onto something like writing bytes.

    Code:
    WriteProcessMemory(ProcessHandle, reinterpret_cast<void*>(FByteAddress), "/0x90/, 1, nullptr);
    Here we wrote a nop which translates into 90 bytes (This shows into the Memory Viewer in Cheat Engine).



    That is where you will get your bytes from. I won't go too much into detail on Assembly as it's not what I wanted to focus on. A full code can be found down below.

    Code:
    #include <iostream>
    #include <windows.h>
    
    int main(){
    	SetConsoleTitle(L"djihjninjinjmu");
    	HWND Window = FindWindow(NULL, L"csgo");
    	if (!Window){
    		return 0;
    	}
    	else{
    		DWORD pID;
    		GetWindowThreadProcessId(Window, &pID);
    		HANDLE Hproc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pID);
    		if(!Hproc){
    			return 0;
    		}
    		else{
    			std::cout << "Press F3 to activate.\n";
    			for(;;){
    				if(GetAsyncKeyState(VK_F3)){
    					float Crosshair;
    					UINT_PTR CrosshairAddress = 0x44ABC04;
    					UINT_PTR Shoot = 0x5C4BB;
    					ReadProcessMemory(Hproc, reinterpret_cast<void*>(CrosshairAddress), &Crosshair, sizeof(Crosshair), nullptr);
    					if(Crosshair == 0){
    						WriteProcessMemory(Hproc, reinterpret_cast<void*>(Shoot), "0x32/0x8B/0x90/0x20/0x01/", 5, nullptr);
    						//This writes a special asm code that makes it shoot (it's just like changing its value from 0 to 1 but I preffer using this)
    					}
    					else if(Crosshair == 1){
    						WriteProcessMemory(Hproc, reinterpret_cast<void*>(Shoot), "0x32/0x8B/0x90/0x20/0x00/", 5, nullptr);
    						//It doesn't shoot from here
    					}
    				}
    				
    			}
    		}
    	}
    }
    Could you help me in creating a hack?
    Is an online game without much security and the hack is something simple.

  4. #3
    Creative!'s Avatar
    Join Date
    Oct 2015
    Gender
    male
    Location
    United States
    Posts
    783
    Reputation
    35
    Thanks
    147
    This is quite helpful for a beginner like myself. Thanks!

  5. #4
    Tightmarrow's Avatar
    Join Date
    Dec 2016
    Gender
    male
    Posts
    40
    Reputation
    31
    Thanks
    21
    Quote Originally Posted by DaniielSanchez View Post
    Could you help me in creating a hack?
    Is an online game without much security and the hack is something simple.
    Sure, tell me the game's name.

    Quote Originally Posted by Creative! View Post
    This is quite helpful for a beginner like myself. Thanks!
    I'm glad

  6. #5
    xmarkwilliam's Avatar
    Join Date
    Aug 2014
    Gender
    male
    Location
    Philippines
    Posts
    14
    Reputation
    10
    Thanks
    1
    My Mood
    Confused
    Quote Originally Posted by Tightmarrow View Post
    Sure, tell me the game's name.



    I'm glad
    can you make a hack in RF Omni Server?

  7. #6
    killingspree888's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Posts
    428
    Reputation
    137
    Thanks
    49
    My Mood
    Angelic
    This is very informative and gives beginners a good starting point. This is well-structured and detailed.

  8. #7
    DaniielSanchez's Avatar
    Join Date
    Nov 2016
    Gender
    male
    Location
    Venezuela
    Posts
    71
    Reputation
    14
    Thanks
    11
    My Mood
    Bashful
    Quote Originally Posted by Tightmarrow View Post
    Sure, tell me the game's name.



    I'm glad


    The game is called gunz

    And the hack I want to do is this. (This dll no longer works, and I have searched for many dlls of this same but no longer come out)
    https://www.mpgh.net/forum/showthread...butterfly-hack



    The video explains better what I want to do. (I am looking forward to your response)
    Last edited by DaniielSanchez; 12-12-2016 at 11:19 AM.

  9. #8
    Tightmarrow's Avatar
    Join Date
    Dec 2016
    Gender
    male
    Posts
    40
    Reputation
    31
    Thanks
    21
    Quote Originally Posted by DaniielSanchez View Post
    The game is called gunz

    And the hack I want to do is this. (This dll no longer works, and I have searched for many dlls of this same but no longer come out)



    The video explains better what I want to do. (I am looking forward to your response)
    It's pretty hard to tell how to do something just from a video, but you may need assembly for that.

    Quote Originally Posted by killingspree888 View Post
    This is very informative and gives beginners a good starting point. This is well-structured and detailed.
    Thanks, I actually though it was kind of messy, I'm not the best at writing tutorials

  10. The Following User Says Thank You to Tightmarrow For This Useful Post:

    DaniielSanchez (12-12-2016)

  11. #9
    DaniielSanchez's Avatar
    Join Date
    Nov 2016
    Gender
    male
    Location
    Venezuela
    Posts
    71
    Reputation
    14
    Thanks
    11
    My Mood
    Bashful
    Quote Originally Posted by Tightmarrow View Post
    It's pretty hard to tell how to do something just from a video, but you may need assembly for that.



    Thanks, I actually though it was kind of messy, I'm not the best at writing tutorials
    you have *****? To explain myself better?

  12. #10
    tylerbradley2016's Avatar
    Join Date
    Jan 2016
    Gender
    male
    Posts
    1
    Reputation
    10
    Thanks
    0
    Yo im interested in making a undetectable esp hack for csgo. I have really no experience in coding and i didnt know if you could show me the basics. I just want to be able to make a working esp and dont know if that would be possible. If anyone can provide any help PLEASE message me

  13. #11
    rockran's Avatar
    Join Date
    Mar 2012
    Gender
    male
    Location
    austraya
    Posts
    70
    Reputation
    10
    Thanks
    15
    My Mood
    Breezy
    You should add compiling & injecting.
    Otherwise awesome tutorial!

  14. #12
    Timbojh21's Avatar
    Join Date
    Dec 2016
    Gender
    male
    Posts
    8
    Reputation
    10
    Thanks
    2
    How do i get my code to read my games health and mana bars? i want to be able to keypress at a certain percent of hp/ mana point. Im assuming i create a math equation that converts it to percentages but i really dont know how to code any of this. I am very new but basically i am learning to create a key pressing trainer for an rpg game, buffs on timers, potions at certain percentages and, keypresses to attack. Any help would be greatly appreciated!! i am new, and have no friends that can code.

  15. #13
    Tightmarrow's Avatar
    Join Date
    Dec 2016
    Gender
    male
    Posts
    40
    Reputation
    31
    Thanks
    21
    Quote Originally Posted by Timbojh21 View Post
    How do i get my code to read my games health and mana bars? i want to be able to keypress at a certain percent of hp/ mana point. Im assuming i create a math equation that converts it to percentages but i really dont know how to code any of this. I am very new but basically i am learning to create a key pressing trainer for an rpg game, buffs on timers, potions at certain percentages and, keypresses to attack. Any help would be greatly appreciated!! i am new, and have no friends that can code.
    You should open cheat engine and:
    - Search in 4Byte for an Unknown Initial Value
    - Lose HP
    - Scan for Changed value
    - Don't lose any more HP
    - Search for Unchanged Value like 10 times
    - Lose HP
    - Search for Changed value
    And so on, until you get the right address. Then, you can follow this tutorial and do.

    for(;{
    UINT_PTR HPAddress = 0xaddress;
    int HPValue;
    if(GetAsyncKeyState(VK_F3)){ // if you pressed f3
    ReadProcessMemory(hProc, reinterpret_cast<void*>(HPAddress), &HPValue, sizeof(HPValue), nullptr);
    }
    }

    or something like that

  16. The Following 2 Users Say Thank You to Tightmarrow For This Useful Post:

    ETHerthethaethaetheh (12-14-2016),Timbojh21 (12-14-2016)

  17. #14
    Timbojh21's Avatar
    Join Date
    Dec 2016
    Gender
    male
    Posts
    8
    Reputation
    10
    Thanks
    2
    Quote Originally Posted by Tightmarrow View Post
    You should open cheat engine and:
    - Search in 4Byte for an Unknown Initial Value
    - Lose HP
    - Scan for Changed value
    - Don't lose any more HP
    - Search for Unchanged Value like 10 times
    - Lose HP
    - Search for Changed value
    And so on, until you get the right address. Then, you can follow this tutorial and do.

    for(;{
    UINT_PTR HPAddress = 0xaddress;
    int HPValue;
    if(GetAsyncKeyState(VK_F3)){ // if you pressed f3
    ReadProcessMemory(hProc, reinterpret_cast<void*>(HPAddress), &HPValue, sizeof(HPValue), nullptr);
    }
    }

    or something like that
    so i get the address of my health, how do i then convert my health to a percentage?

    i would like to have it press a key when my health reaches a certain percentage, or even create a gui that allows me to do it at different percentages. Very helpful though!!!!

  18. #15
    Tightmarrow's Avatar
    Join Date
    Dec 2016
    Gender
    male
    Posts
    40
    Reputation
    31
    Thanks
    21
    Quote Originally Posted by Timbojh21 View Post
    so i get the address of my health, how do i then convert my health to a percentage?

    i would like to have it press a key when my health reaches a certain percentage, or even create a gui that allows me to do it at different percentages. Very helpful though!!!!
    Considering that you already got the right address, you should:

    - Right click the address
    - Select "Find What Writes to this address"
    - Lose HP
    - Get the first address you find there and write

    WriteProcessMemory(hProc, reinterpret_cast<void*>(HPAddress), "/0x90/, nullptr, nullptr);

    I can't tell how that game works and it's really done but putting a nop instruction (0x90 or 90) to the address could stop it from going down.

Page 1 of 2 12 LastLast

Similar Threads

  1. How can i make a hack for WarRock?
    By tomva in forum General Game Hacking
    Replies: 4
    Last Post: 06-09-2007, 04:13 PM
  2. I wanna make weapon hack but need help
    By allard123 in forum WarRock - International Hacks
    Replies: 13
    Last Post: 02-19-2007, 09:19 PM
  3. All Noobs Read> Making Lvl Hacks.
    By quin123 in forum General
    Replies: 19
    Last Post: 06-15-2006, 09:43 AM
  4. how can i make game hack?!!!!
    By UnknownID in forum General Game Hacking
    Replies: 2
    Last Post: 02-07-2006, 08:21 PM
  5. Plz I Want Maple Global Hacks And Where Do I Get Game Engine 2 Make The Hacks Work???
    By mattinthehat in forum MapleStory Hacks, Cheats & Trainers
    Replies: 3
    Last Post: 01-15-2006, 07:12 PM