Navigation X
ALERT
Click here to register with a few steps and explore all our cool stuff we have to offer!

cracked.io | Best Forum Around | Free Premium Accounts




 2064

C++ - How do i start game hacking

by stcg - 12 August, 2018 - 02:04 PM
This post is by a banned member (stcg) - Unhide
stcg  
Contributor
82
Posts
14
Threads
5 Years of service
#1
Okay imo i am alright with c++.
Couple months ago i built my own cs cheat with aimbot, bhop, no recoil and some other shit features. 

However, i havent been doing any game hacking since then and completely forgot most of the stuff.

Any tutorials? How do i begin?

P.S : I already know RPM/WPM and how to open a handle
This post is by a banned member (Pshyotic) - Unhide
Pshyotic  
Registered
1.017
Posts
290
Threads
5 Years of service
#2
(This post was last modified: 12 August, 2018 - 06:36 PM by Pshyotic.)
This is one of the old codes, so I hope it will help you get back to the game at least halfway from what you were, anyways you made mistake when you didn't sometimes read or write some codes. You know how they say, repetition is the mother of knowledge. 
If nothing is clear of this, then I suggest. Start learning from the beginning. :fuck:


Code:
#include <windows.h>
#include <conio.h>
#include <dos.h>
#include <tlhelp32.h>
#include <stdio.h>


int stamina;    // will store the stamina value

bool dostamina = false;        // determines if user activated stamina freezing

LPVOID stamina_addr =    (void*) 0x007F1110;        // memory address of the stamina value in the WarRock process

void screen()    // output
{
    system("cls");    // clear the screen
    printf("Hello World! This is my first WarRock trainer!  \n\n");
    
    if(dostamina) printf("[1] - freeze stamina [ENABLED]\n");    // if user enabled stamina freeze, let him know!
    else printf("[1] - freeze stamina [disabled]\n");            // same if it's disabled
}

int main(int argc, char* argv[])
{    
    HANDLE hProcessSnap;    // will store a snapshot of all processes
    HANDLE hProcess = NULL;    // we will use this one for the WarRock process
    PROCESSENTRY32 pe32;    // stores basic info of a process, using this one to read the ProcessID from
    
    hProcessSnap = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );    // make process snapshot

    pe32.dwSize = sizeof( PROCESSENTRY32 );        // correct size

    Process32First(hProcessSnap, &pe32);    // read info about the first process into pe32

    do    // loop to find the WarRock process
    {        
        if(strcmp(pe32.szExeFile, "WarRock.exe") == 0)    // if WarRock was found
        {
            hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pe32.th32ProcessID);    // open it, assigning to the hProcess handle
            break;    // break the loop
        }
    }
    while(Process32Next(hProcessSnap, &pe32));    // loop continued until Process32Next deliver NULL or its interrupted with the "break" above

    CloseHandle( hProcessSnap );    // close the handle (just fuckin do it)

    if(hProcess == NULL)    // self explanatory tbh
    {
        printf("WarRock not found\n\n");
        getch();    // wait for a key press. otherwise the app will just close so fast when the process is not found, you wont know wtf happened.
    }
    else
    {
        screen();    // print the display
        
        char key = ' ';    // make a key variable to store pressed keys
        
        while(key != VK_ESCAPE)    // loop until user presses Escape
        {
            
            if(kbhit())        // if a key was pressed
            {
                key = getch();    // it is saved into "key"

                switch(key)        // here the commands are handled depending on the key that was pressed
                {                // case '1': ... break;  case '2': ... break; and so on
                case '1':
                    dostamina = !dostamina;        // flip the dostamina value true<->false to enable/disable it
                    ReadProcessMemory(hProcess, stamina_addr, &stamina, 4, NULL);    // read the stamina value from the memory into the "stamina" variable
                    break;            
                }

                screen();    // print the display after each key press

            }

            if(dostamina)    // if stamina freeze is activated
                WriteProcessMemory(hProcess, stamina_addr, &stamina, 4, NULL);    // write the stamina value that was saved before with the key press into memory
        }

        CloseHandle(hProcess);    // close the handle
        
    }

    return 0;    // THE END
}
 
P S H Y O T I C

☻♥
[Image: Czwhvkg.png]
This post is by a banned member (Edward) - Unhide
Edward  
Registered
344
Posts
162
Threads
6 Years of service
#3
Read tutorials online.
[Image: DARKHOST_2.gif]

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
or
Sign in
Already have an account? Sign in here.


Forum Jump:


Users browsing this thread: 1 Guest(s)