Results 1 to 13 of 13
  1. #1
    Erinador's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Posts
    224
    Reputation
    14
    Thanks
    111
    My Mood
    Bored

    [Tutorial] Basic C++ Console hack

    Targeted program: programme test.exe (Comes with T-Searcher, also attached it)
    Knowledge: Easy to medium
    Needed:
    - C++ Compiler
    - Memory Scanning/Hacking software.
    - A brain

    Step 1)
    Find the addresses.
    I already did that for you, but you just do it yourself also.
    Address One : 0x0041D090 (Numbers)
    Address Two: 0x0041D094 (Stripes) (Starts at 365 not 0)
    Both are static so should work for you.


    Step 2)
    Start a new empty "Windows Console Application" project

    -------------------------------------------------
    Now I'll explain pieces of the code and at the end of the tutorial you'll get the full source code.

    Code:
    int ValueOne=25, ValueTwo=403;
    DWORD pid;
    ^declaring it for further use

    Code:
    HWND hWnd = FindWindow(NULL, "prog test");
    ^This searches for the window by the name of the window NOT by the name of the process!

    Code:
    GetWindowThreadProcessId(hWnd, &pid)
    ^Get the ProcessID of the window stored in hWnd and store it in pid

    Code:
    HANDLE phandle = OpenProcess(PROCESS_VM_OPERATION | PROCESS_VM_WRITE | PROCESS_VM_READ, 0, pid);
    ^ Create a handle for you process
    - PROCESS_VM_OPERATION -> always needed if you want to something
    - PROCESS_VM_WRITE -> needed if you want to write to the process
    - PROCESS_VM_READ -> needed if you want to read from the process

    Code:
    WriteProcessMemory(phandle, (LPVOID)addressone, &ValueOne, sizeof(ValueOne), 0);
    ^
    -1- phandle - needed
    -2- (LPVOID)addressone - The address you want to change
    -3- &ValueOne - The value you want to give it
    -4- sizeof(ValueOne) - The byte size of ValueOne (in this case 4)

    Code:
    system("pause");	// ask the user to press a key to end the program.	
    return 0; // end it
    Full source code:
    Code:
    #include <windows.h>
    #include <iostream>
    
    // Define them so we can use them in the rest of the program
    #define addressone 0x0041D090 
    #define addresstwo 0x0041d094
    
    
    int main()
    {
    	SetConsoleTitle("C++ Trainer by Erinador");															// Set your consoles title
    	int ValueOne=25, ValueTwo=403;																		// Declare these so we can use them
    	DWORD pid;																							// Declare this so we can use to store the ProcessID
    	int i = 1;																							// Declare this for the infinite loop
    	do {
       
    	/*----Find the window----*/
    	HWND hWnd = FindWindow(NULL, "prog test");															//find the window by name
    	if (!hWnd) //then
    		std::cout << "Window not found!\n";																// if it didn't find the windows name
    	else
    		std::cout << "Window found!\n";																	// if it found the windows name
    	//end if
        
    	/*----Get the processID of the window you found----*/
    	if(!GetWindowThreadProcessId(hWnd, &pid)) // Then 
    		std::cout << "Process ID not found!\n";															// not found
    	else
    		std::cout << "Process ID found!\n";																//found
    	//end if
    	
    	/*----Create a handle----*/
    	HANDLE phandle = OpenProcess(PROCESS_VM_OPERATION | PROCESS_VM_WRITE | PROCESS_VM_READ, 0, pid);	//Get the needed permissions and open the process for access
    	if(phandle==INVALID_HANDLE_VALUE) //then
    		std::cout << "I don't have permissions to open the process!\n";
    	else
    		std::cout << "I have persmissions to open the process!\n";
    
    	/*----Write to the addresses----*/
    	 WriteProcessMemory(phandle, (LPVOID)addressone, &ValueOne, sizeof(ValueOne), 0);					// Set the value of the first address
    	 WriteProcessMemory(phandle, (LPVOID)addresstwo, &ValueTwo, sizeof(ValueTwo), 0);					// Set the value of the second address
    
    	 Sleep(15);																							// We wouldn't want to lag now do we ;)
    	 system("cls");																						// Clear the screen
    	} while (i=1);
    
      system("pause");																						// ask the user to enter a key
      return 0;
    }
    Full source code: (by process name and not caption)
    Code:
    #include <windows.h>
    #include <tlhelp32.h>
    #include <iostream>
    
    using namespace std;
    
    // Define them so we can use them in the rest of the program
    #define addressone 0x0041D090 
    #define addresstwo 0x0041d094
    
    void GetProcId(char* ProcName);
    
    DWORD ProcId = 0; // THIS IS OUR GLOBAL VARIABLE FOR THE PROC ID;
    
    int main()
    {
    	char* ProcName="programme test.exe";
    
    
    
    
    	SetConsoleTitle("C++ Trainer by Erinador");															// Set your consoles title
    	int ValueOne=25, ValueTwo=403;	
    	int i = 1;
    	do {
    		GetProcId(ProcName); // get the proc id from the processes name
    		cout << "The Process ID of " << ProcName << " is " << ProcId <<endl; // display it to the user
    
    /*----Create a handle----*/
    	HANDLE phandle = OpenProcess(PROCESS_VM_OPERATION | PROCESS_VM_WRITE | PROCESS_VM_READ, 0, ProcId);	//Get the needed permissions and open the process for access
    	if(phandle==INVALID_HANDLE_VALUE) //then
    		std::cout << "I don't have permissions to open the process!\n";
    	else
    		std::cout << "I have persmissions to open the process!\n";
    
    /*----Write to the addresses----*/
    	 WriteProcessMemory(phandle, (LPVOID)addressone, &ValueOne, sizeof(ValueOne), 0);					// Set the value of the first address
    	 WriteProcessMemory(phandle, (LPVOID)addresstwo, &ValueTwo, sizeof(ValueTwo), 0);					// Set the value of the second address
    
    	 Sleep(500);																							// We wouldn't want to lag now do we ;)
    	 system("cls");																						
    	}while(i=1);
      cin.get(); // to keep console open till we press a key
      return 0;
    }
    
    void GetProcId(char* ProcName)
    {
        PROCESSENTRY32   pe32;
        HANDLE         hSnapshot = NULL;
    
        pe32.dwSize = sizeof( PROCESSENTRY32 );
        hSnapshot = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );
    
        if( Process32First( hSnapshot, &pe32 ) )
        {
            do{
                if( strcmp( pe32.szExeFile, ProcName ) == 0 )
                    break;
            }while( Process32Next( hSnapshot, &pe32 ) );
        }
    
        if( hSnapshot != INVALID_HANDLE_VALUE )
            CloseHandle( hSnapshot );
    
        ProcId = pe32.th32ProcessID;
    }
    I put checks on it
    I put it in a loop
    Last edited by Erinador; 02-20-2010 at 10:24 AM.

  2. The Following 23 Users Say Thank You to Erinador For This Useful Post:

    ac1d_buRn (02-22-2010),antonio007 (03-03-2010),brekkeb (11-27-2013),cmc5414 (01-04-2014),dragontaken (07-13-2013),ForceHacker (09-27-2015),GreenMonsterKhmer (10-01-2014),RuShi (05-29-2016),laracr0ft (07-01-2013),Maarf (01-27-2014),matdores157 (10-26-2013),NimerIB (11-08-2014),r-man (03-01-2015),saga172 (03-08-2013),Sk114 (06-27-2013),treeham (02-21-2010),TrueBlue (12-19-2013),unlegit123 (07-25-2015),why06 (02-26-2010),x9wmasx (02-15-2013),xoxokkkk (01-29-2015),XxTylerxX (08-06-2013),|-|3|_][({}PT3R12 (02-20-2010)

  3. #2
    |-|3|_][({}PT3R12's Avatar
    Join Date
    Nov 2008
    Gender
    male
    Location
    UnkwOwnS
    Posts
    449
    Reputation
    12
    Thanks
    472
    My Mood
    Twisted
    Nice tut.

    Ill download it and see what i can do

  4. #3
    SpaceMan's Avatar
    Join Date
    Nov 2009
    Gender
    male
    Location
    I forgot. :/
    Posts
    4,291
    Reputation
    162
    Thanks
    897
    My Mood
    Pensive
    Sorry, but what does it do/

  5. #4
    Void's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Inline.
    Posts
    3,198
    Reputation
    205
    Thanks
    1,445
    My Mood
    Mellow
    Nice, you should add how to get the process id of a program using it's executable name instead of the caption. Caption names could be really long and annoying sometimes.

  6. #5
    Erinador's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Posts
    224
    Reputation
    14
    Thanks
    111
    My Mood
    Bored
    Quote Originally Posted by Davidm44 View Post
    Nice, you should add how to get the process id of a program using it's executable name instead of the caption. Caption names could be really long and annoying sometimes.
    I'll add that right now

    EDIT:
    Added
    Last edited by Erinador; 02-20-2010 at 10:25 AM.

  7. #6
    treeham's Avatar
    Join Date
    Apr 2009
    Gender
    male
    Location
    heh. Turn around.
    Posts
    200
    Reputation
    10
    Thanks
    41
    My Mood
    Cynical
    Thanks man! I learned c++ a while back and tried hacking but all the tuts were way too advanced.
    In Choob Language:
    also for all your info.. i didnt copy and paste shit.. coz i dont think anyone has realeased any source code for the New update of CA.. so sdfu..
    In English:
    I didn't copy and paste because no one has released what I need copy and paste
    Oh Choobs...

  8. #7
    Kuro Tenshi's Avatar
    Join Date
    Jan 2009
    Gender
    male
    Location
    Where arth thou be
    Posts
    3,635
    Reputation
    70
    Thanks
    746
    My Mood
    Blah
    Quote Originally Posted by treeham View Post
    Thanks man! I learned c++ a while back and tried hacking but all the tuts were way too advanced.
    i tried most of them but those are 2-4 years old >.< i have made some hacks but gues what found. all i do need is detouring skills bacause finding addies is peace of cake. to bad that VB isnt working that nice for editing most mmofps games values. xD
    ah well youll never stop learning some new code. gona write my own maybe (just define some simple stuff makes it easier to hack i guess.)
    DigiDrawing|+ ( (Elfen Archer) )
    Link:
    https://www.mpgh.net/forum/148-showro...en-archer.html


    @ Anime Section,Otaku/weeabo (orz.) @Graphics Section, Novice DigiArtist


    neuest gift from Yura~Chan:
    https://bakyurayuu.deviantar*****m/#/d372taw
    2nd Place MOTM#9 Theme: CharMods - Combat Arms [No - Thanks] button
    come on you know that don't want to push that ordinary button

  9. #8
    hantuafiq's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    18
    Reputation
    10
    Thanks
    1
    My Mood
    Confused
    im just a noob and i dont know anything about visual c++ coz i only learn VB.net... can u upload the source pls...i really2 need it...thx

  10. #9
    XGelite's Avatar
    Join Date
    Mar 2009
    Gender
    male
    Location
    Enter text here
    Posts
    1,344
    Reputation
    12
    Thanks
    276
    Quote Originally Posted by hantuafiq View Post
    im just a noob and i dont know anything about visual c++ coz i only learn VB.net... can u upload the source pls...i really2 need it...thx
    haha/



    Nice tutorial btw.

  11. #10
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    Quote Originally Posted by hantuafiq View Post
    im just a noob and i dont know anything about visual c++ coz i only learn VB.net... can u upload the source pls...i really2 need it...thx
    Don't bump old posts. And he already posted the code up at the top. Thanks Erinador, wish I had seen this earlier, somehow I keep missing these things. =/

    EDIT: I added your tutorial to the C++ Tutorial List Erinador. Very nice

    actually on second thought I'll let this slide... I know I missed this tutorial perhaps some others did too...
    /unclosed
    Last edited by why06; 02-26-2010 at 12:36 PM.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  12. #11
    Matrix_NEO006's Avatar
    Join Date
    Feb 2008
    Gender
    male
    Posts
    240
    Reputation
    12
    Thanks
    33
    My Mood
    Lonely
    do u guys want me to make a tutorial to make hacks in a better application something like this

  13. #12
    KABLE's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    California
    Posts
    2,863
    Reputation
    192
    Thanks
    282
    My Mood
    Pensive
    Is this iin cpp?

    Quote Originally Posted by TOXIN
    Shit, now I have to enter this chapacha shit.
    my tumblr
    How To: Not Get Banned Botting

    "Had a dream I was king. I woke up, still king."
    .................................................-Eminem

  14. #13
    Matrix_NEO006's Avatar
    Join Date
    Feb 2008
    Gender
    male
    Posts
    240
    Reputation
    12
    Thanks
    33
    My Mood
    Lonely
    Quote Originally Posted by kAblE View Post
    Is this iin cpp?
    yes of course

Similar Threads

  1. [Tutorial] Basic C++ Game Hacking (Memory Editing)
    By Tukjedude in forum C++/C Programming
    Replies: 17
    Last Post: 06-05-2010, 08:23 AM
  2. Tutorial for canadianassasin v3 hack
    By sukhans in forum CrossFire Hacks & Cheats
    Replies: 5
    Last Post: 04-27-2009, 08:23 PM
  3. TUTORIAL FOR V4 wep hack by TYREALL101
    By mcjang in forum CrossFire Hacks & Cheats
    Replies: 8
    Last Post: 04-27-2009, 03:28 PM
  4. Replies: 28
    Last Post: 03-02-2009, 07:44 AM
  5. [Request]Tutorial on C++ Game Hacking
    By Propser in forum C++/C Programming
    Replies: 1
    Last Post: 10-30-2008, 02:55 AM