Results 1 to 6 of 6
  1. #1
    Gam3r007's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Posts
    17
    Reputation
    10
    Thanks
    0

    Need Help Making my first Hack!!

    Hello MPGH,
    I watched a tutorial on Youtube about memory hacking using c++ . I tried making a hack for MW3, but get alot of errors in cout, cerr, clog and some other stuff, Please help me @Jorndel @master131 and anyone who can help. Thanks Im waiting for your reply ppl.


     
    Code:
    #include <iostream>
    #include "stdafx.h"
    #include <windows.h>
    #include <stdio.h>
    
     
    
    // FindWindow();
    // GetWindowThreadProcessId();
    // OpenProcess();
    // WriteProcessMemory();
    // CloseHandle();
    
     
    
    using namespace std;
    
     
    
    int main()
    
    {
    
        int Score;
    	cout<<"Welcome to oTrainer v1 @MPGH.net \n";
    	cout<<"Features: \n";
    	cout<<"Score Hack \n";
    	cout<<"Enter the Score you want:   ";
    
    	cin>> Score;
    	cin.ignore();
    
        HWND hWnd = FindWindow(0, "Call of Duty®: Modern Warfare® 3 Multiplayer");
    	
     
    
        if (hWnd == 0) {
    
            cerr << "Cannot find window." << endl;
    
        } else {
    
            DWORD pId;
    
            GetWindowThreadProcessId(hWnd, &pId);
    
            HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pId);
    
     
    
            if (!hProc) {
    
                cerr << "Cannot open process." << endl;
    
            } else {
    
                int isSuccessful = WriteProcessMemory(hProc, (LPVOID)0x000AFCC4, &Score, (DWORD)sizeof(Score), NULL);
    
     
    
                if (isSuccessful > 0) {
    
                    clog << "Process memory written." << endl;
    
                } else {
    
                    cerr << "Cannot write process memory." << endl;
    
                }
    
     
    
                CloseHandle(hProc);
    
            }
    
        }
    
    
    
        return 0;
    
    }


     
    Code:
    1>------ Build started: Project: Mw3, Configuration: Release Win32 ------
    1>  Mw3.cpp
    1>Mw3.cpp(1): warning C4627: '#include <iostream>': skipped when looking for precompiled header use
    1>          Add directive to 'StdAfx.h' or rebuild precompiled header
    1>Mw3.cpp(25): error C2065: 'cout' : undeclared identifier
    1>Mw3.cpp(27): error C2065: 'cout' : undeclared identifier
    1>Mw3.cpp(28): error C2065: 'cout' : undeclared identifier
    1>Mw3.cpp(29): error C2065: 'cout' : undeclared identifier
    1>Mw3.cpp(30): error C2065: 'cout' : undeclared identifier
    1>Mw3.cpp(32): error C2065: 'cin' : undeclared identifier
    1>Mw3.cpp(33): error C2065: 'cin' : undeclared identifier
    1>Mw3.cpp(33): error C2228: left of '.ignore' must have class/struct/union
    1>          type is ''unknown-type''
    1>Mw3.cpp(35): error C2664: 'FindWindowW' : cannot convert parameter 2 from 'const char [45]' to 'LPCWSTR'
    1>          Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    1>Mw3.cpp(41): error C2065: 'cerr' : undeclared identifier
    1>Mw3.cpp(41): error C2065: 'endl' : undeclared identifier
    1>Mw3.cpp(55): error C2065: 'cerr' : undeclared identifier
    1>Mw3.cpp(55): error C2065: 'endl' : undeclared identifier
    1>Mw3.cpp(65): error C2065: 'clog' : undeclared identifier
    1>Mw3.cpp(65): error C2065: 'endl' : undeclared identifier
    1>Mw3.cpp(69): error C2065: 'cerr' : undeclared identifier
    1>Mw3.cpp(69): error C2065: 'endl' : undeclared identifier
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

  2. #2
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,674
    Reputation
    905
    Thanks
    18,541
    My Mood
    Angelic
    Quote Originally Posted by Gam3r007 View Post
    Hello MPGH,
    I watched a tutorial on Youtube about memory hacking using c++ . I tried making a hack for MW3, but get alot of errors in cout, cerr, clog and some other stuff, Please help me @Jorndel @master131 and anyone who can help. Thanks Im waiting for your reply ppl.


     
    Code:
    #include <iostream>
    #include "stdafx.h"
    #include <windows.h>
    #include <stdio.h>
    
     
    
    // FindWindow();
    // GetWindowThreadProcessId();
    // OpenProcess();
    // WriteProcessMemory();
    // CloseHandle();
    
     
    
    using namespace std;
    
     
    
    int main()
    
    {
    
        int Score;
    	cout<<"Welcome to oTrainer v1 @MPGH.net \n";
    	cout<<"Features: \n";
    	cout<<"Score Hack \n";
    	cout<<"Enter the Score you want:   ";
    
    	cin>> Score;
    	cin.ignore();
    
        HWND hWnd = FindWindow(0, "Call of Duty®: Modern Warfare® 3 Multiplayer");
    	
     
    
        if (hWnd == 0) {
    
            cerr << "Cannot find window." << endl;
    
        } else {
    
            DWORD pId;
    
            GetWindowThreadProcessId(hWnd, &pId);
    
            HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pId);
    
     
    
            if (!hProc) {
    
                cerr << "Cannot open process." << endl;
    
            } else {
    
                int isSuccessful = WriteProcessMemory(hProc, (LPVOID)0x000AFCC4, &Score, (DWORD)sizeof(Score), NULL);
    
     
    
                if (isSuccessful > 0) {
    
                    clog << "Process memory written." << endl;
    
                } else {
    
                    cerr << "Cannot write process memory." << endl;
    
                }
    
     
    
                CloseHandle(hProc);
    
            }
    
        }
    
    
    
        return 0;
    
    }


     
    Code:
    1>------ Build started: Project: Mw3, Configuration: Release Win32 ------
    1>  Mw3.cpp
    1>Mw3.cpp(1): warning C4627: '#include <iostream>': skipped when looking for precompiled header use
    1>          Add directive to 'StdAfx.h' or rebuild precompiled header
    1>Mw3.cpp(25): error C2065: 'cout' : undeclared identifier
    1>Mw3.cpp(27): error C2065: 'cout' : undeclared identifier
    1>Mw3.cpp(28): error C2065: 'cout' : undeclared identifier
    1>Mw3.cpp(29): error C2065: 'cout' : undeclared identifier
    1>Mw3.cpp(30): error C2065: 'cout' : undeclared identifier
    1>Mw3.cpp(32): error C2065: 'cin' : undeclared identifier
    1>Mw3.cpp(33): error C2065: 'cin' : undeclared identifier
    1>Mw3.cpp(33): error C2228: left of '.ignore' must have class/struct/union
    1>          type is ''unknown-type''
    1>Mw3.cpp(35): error C2664: 'FindWindowW' : cannot convert parameter 2 from 'const char [45]' to 'LPCWSTR'
    1>          Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    1>Mw3.cpp(41): error C2065: 'cerr' : undeclared identifier
    1>Mw3.cpp(41): error C2065: 'endl' : undeclared identifier
    1>Mw3.cpp(55): error C2065: 'cerr' : undeclared identifier
    1>Mw3.cpp(55): error C2065: 'endl' : undeclared identifier
    1>Mw3.cpp(65): error C2065: 'clog' : undeclared identifier
    1>Mw3.cpp(65): error C2065: 'endl' : undeclared identifier
    1>Mw3.cpp(69): error C2065: 'cerr' : undeclared identifier
    1>Mw3.cpp(69): error C2065: 'endl' : undeclared identifier
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    Erm, you sure you use right debugger ?
    (Not Visual Studio etc)

    I might look on it, when I'm done playing

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  3. #3
    Gam3r007's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Posts
    17
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by Jorndel View Post


    Erm, you sure you use right debugger ?
    (Not Visual Studio etc)

    I might look on it, when I'm done playing
    Im using Microsoft Visual C++ 2010 Express, Can I add you in game?

  4. #4
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,674
    Reputation
    905
    Thanks
    18,541
    My Mood
    Angelic
    Quote Originally Posted by Gam3r007 View Post
    Im using Microsoft Visual C++ 2010 Express, Can I add you in game?
    I used: Dec-C++
    Here is the code that I used based on yours: (Works)
    Code:
    #include <cstdlib>
    #include <iostream>
    #include <windows.h>
    #include <stdio.h>
    
    using namespace std;
    
    int main(int argc, char *argv[])
    {
        int Score = 3;
        HWND hWnd = FindWindow(0, "Call of Duty®: Modern Warfare® 3 Multiplayer");
        if (hWnd == 0) {
    
            cerr << "Cannot find window." << endl;
    
        } else {
    
            DWORD pId;
    
            GetWindowThreadProcessId(hWnd, &pId);
    
            HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pId);
    
     
    
            if (!hProc) {
    
                cerr << "Cannot open process." << endl;
    
            } else {
    
                cerr<<"Set your Score: ";
                cin>>Score;
                int isSuccessful = WriteProcessMemory(hProc,(LPVOID)0x1DB8BD0,&Score,sizeof(Score),NULL);
    
     
    
                if (isSuccessful > 0) {
    
                    clog << "Process memory written." << endl;
    
                } else {
    
                    cerr << "Cannot write process memory." << endl;
    
                }
    
     
    
                CloseHandle(hProc);
    
            }
    
        }
        system("PAUSE");
        return EXIT_SUCCESS;
    }


    Mostly like that |Microsoft Visual C++ 2010 Express| caused the problems here :|

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  5. #5
    Gam3r007's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Posts
    17
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by Jorndel View Post


    I used: Dec-C++
    Here is the code that I used based on yours: (Works)
    Code:
    #include <cstdlib>
    #include <iostream>
    #include <windows.h>
    #include <stdio.h>
    
    using namespace std;
    
    int main(int argc, char *argv[])
    {
        int Score = 3;
        HWND hWnd = FindWindow(0, "Call of Duty®: Modern Warfare® 3 Multiplayer");
        if (hWnd == 0) {
    
            cerr << "Cannot find window." << endl;
    
        } else {
    
            DWORD pId;
    
            GetWindowThreadProcessId(hWnd, &pId);
    
            HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pId);
    
     
    
            if (!hProc) {
    
                cerr << "Cannot open process." << endl;
    
            } else {
    
                cerr<<"Set your Score: ";
                cin>>Score;
                int isSuccessful = WriteProcessMemory(hProc,(LPVOID)0x1DB8BD0,&Score,sizeof(Score),NULL);
    
     
    
                if (isSuccessful > 0) {
    
                    clog << "Process memory written." << endl;
    
                } else {
    
                    cerr << "Cannot write process memory." << endl;
    
                }
    
     
    
                CloseHandle(hProc);
    
            }
    
        }
        system("PAUSE");
        return EXIT_SUCCESS;
    }


    Mostly like that |Microsoft Visual C++ 2010 Express| caused the problems here :|
    Thnx man, It worked, your amazing!!!

  6. #6
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,674
    Reputation
    905
    Thanks
    18,541
    My Mood
    Angelic
    Quote Originally Posted by Gam3r007 View Post
    Thnx man, It worked, your amazing!!!
    No Problem. ( I don't even code in C++ :|)

    /Solved

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

Similar Threads

  1. [Solved] i need help making a CFNA hack plz anyone help!
    By ahmedak997 in forum CrossFire Help
    Replies: 7
    Last Post: 01-22-2012, 05:48 PM
  2. [Help] Need Help Making a D3D Hack
    By johnnydicamillo in forum WarRock Hack Source Code
    Replies: 9
    Last Post: 02-01-2011, 11:03 AM
  3. [SOLVED] Need help for my first hack
    By prompen in forum Call of Duty Modern Warfare 2 Help
    Replies: 5
    Last Post: 10-24-2010, 05:32 PM
  4. i need help making CA hacks
    By kill_boy in forum Combat Arms Hacks & Cheats
    Replies: 1
    Last Post: 04-01-2009, 03:15 PM
  5. [Help how?]Need help making a WR hack please look.
    By mikelmao11 in forum WarRock - International Hacks
    Replies: 1
    Last Post: 07-18-2008, 01:43 PM