Results 1 to 7 of 7
  1. #1
    solidpants's Avatar
    Join Date
    May 2013
    Gender
    male
    Location
    Texas
    Posts
    102
    Reputation
    10
    Thanks
    29
    My Mood
    Yeehaw

    Question Still kind of new to C++ and have question about static addresses

    Hi, i recently coded my first hack(in c++) for a game called AssaultCube and i had to go through a process of finding the static address using cheat engine, i was wondering if i have to do the same for combat arms or can i find the static addresses on this site or online somewhere else? Also will i #include the same things as i did in my hack

    I am still kind of new to C++ so don't make fun of me if this is a ridiculously stupid question, I'm just trying to join this world of programming.


    here is my hack for AssaultCube:

    #include <iostream>
    #include <Windows.h>
    #include <string>
    #include <ctime>

    DWORD FindDmaAddy (int PointerLevel, HANDLE hProcHandle, DWORD Offsets[], DWORD BaseAddress);
    void WriteToMemory(HANDLE hProcHandle);

    std::string GameName = "AssaultCube";
    LPCSTR LGameWindow = "AssaultCube";
    std::string GameStatus;

    bool IsGameAvail;
    bool UpdateOnNextRun;

    //AMMO VARS
    bool AmmoStatus;
    BYTE AmmoValue[] = {0xA3, 0x1C, 0x0, 0x0};
    DWORD AmmoBaseAddress = {0x004DF73C};
    DWORD AmmoOffsets[] = {0x378, 0x14, 0x0};

    //HEALTH VARS
    bool HealthStatus;
    BYTE HealthValue[] = {0x39, 0x5, 0x0, 0x0};
    DWORD HealthBaseAddress = {0x004DF73C};
    DWORD HealthOffsets[] = {0xF4};


    int main()
    {
    HWND hGameWindow = NULL;
    int timeSinceLastUpdate = clock();
    int GameAvailTMR = clock();
    int onePressTMR = clock();
    DWORD dwProcID = NULL;
    HANDLE hProcHandle = NULL;
    UpdateOnNextRun = true;
    std::string sAmmoStatus = "OFF";
    std::string sHealthStatus = "OFF";

    while (!GetAsyncKeyState(VK_INSERT))
    {
    if(clock() - GameAvailTMR > 100)
    {
    GameAvailTMR = clock();
    IsGameAvail = false;

    hGameWindow = FindWindow(NULL, LGameWindow);
    if(hGameWindow)
    {
    GetWindowThreadProcessId( hGameWindow, &dwProcID);
    if (dwProcID != 0)
    {
    hProcHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, dwProcID );
    if(hProcHandle == INVALID_HANDLE_VALUE || hProcHandle == NULL)
    {
    GameStatus = "Failed to open process for valid handle";
    }

    else
    {
    GameStatus = "AssaultCube ready to hack";
    IsGameAvail = true;
    }
    }
    else
    {
    GameStatus = "failed to get process ID";
    }
    }
    else
    {
    GameStatus = "Assaultcube NOT FOUND";
    }

    if(UpdateOnNextRun || clock() - timeSinceLastUpdate > 5000)
    {
    system ("cls");
    std::cout << "--------------------------------------" << std::endl ;
    std::cout << " AssaultCube Ammo and Health Hacker\n";
    std::cout << "--------------------------------------" << std::endl << std::endl;
    std::cout << "GameStatus:" << GameStatus <<std::endl << std::endl;
    std::cout << "[F1] Unlimited Ammo ->" <<sAmmoStatus << "<-\n\n";
    std::cout << "[F2] Unlimited Health ->" <<sHealthStatus << "<-\n\n";
    std::cout << "[INSERT] Exit" << std::endl;
    UpdateOnNextRun = false;
    timeSinceLastUpdate = clock();

    }
    if(IsGameAvail)
    {
    WriteToMemory(hProcHandle);
    }

    }

    if(clock() - onePressTMR > 400)
    {
    if(IsGameAvail)
    {
    //Ammo
    if(GetAsyncKeyState(VK_F1))
    {
    onePressTMR = clock();
    AmmoStatus = !AmmoStatus;
    UpdateOnNextRun = true;
    if(AmmoStatus)sAmmoStatus = "ON";
    else sAmmoStatus = "OFF";
    }
    //Health
    else if(GetAsyncKeyState(VK_F2))
    {
    onePressTMR = clock();
    HealthStatus = !HealthStatus;
    UpdateOnNextRun = true;
    if(HealthStatus)sHealthStatus = "ON";
    else sHealthStatus = "OFF";
    }
    }
    }

    }

    return ERROR_SUCCESS;


    }

    DWORD FindDmaAddy(int PointerLevel, HANDLE hProcHandle, DWORD Offsets[], DWORD BaseAddress)
    {
    DWORD pointer = BaseAddress;
    DWORD pTemp;

    DWORD pointerAddr;
    for(int c = 0; c < PointerLevel; c++)
    {
    if(c == 0)
    {
    ReadProcessMemory(hProcHandle, (LPCVOID)pointer, &pTemp, sizeof(pTemp), NULL);
    }

    pointerAddr = pTemp + Offsets[c];
    ReadProcessMemory(hProcHandle, (LPCVOID)pointerAddr, &pTemp, sizeof(pTemp), NULL);
    }
    return pointerAddr;
    }

    void WriteToMemory(HANDLE hProcHandle)
    {
    DWORD AddressToWrite;
    if(AmmoStatus)
    {
    AddressToWrite = FindDmaAddy(3, hProcHandle, AmmoOffsets, AmmoBaseAddress);
    WriteProcessMemory(hProcHandle, (BYTE*)AddressToWrite, &AmmoValue, sizeof (AmmoValue), NULL);
    }
    if(HealthStatus)
    {
    AddressToWrite = FindDmaAddy(1, hProcHandle, HealthOffsets, HealthBaseAddress);
    WriteProcessMemory(hProcHandle, (BYTE*)AddressToWrite, &HealthValue, sizeof (HealthValue), NULL);
    }

    }
    Last edited by solidpants; 06-25-2013 at 07:24 PM. Reason: didn't copy the whole hack

  2. #2
    Skaterforeva1's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Up your ass
    Posts
    917
    Reputation
    32
    Thanks
    476
    My Mood
    Psychedelic
    @solidpants Your assault cube hack has nothing to do with this... If you used CheatEngine to get a "static address" you are truly a genius due to that fact the last time I used cheat engine you couldn't find an IP address with it... And asking if you need to "#include" the same things shows me you have no knowledge off c++.

    ^Suck it!


  3. #3
    Timboy67678's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    82
    Reputation
    25
    Thanks
    80
    My Mood
    Aggressive
    Quote Originally Posted by Skaterforeva1 View Post
    @solidpants Your assault cube hack has nothing to do with this... If you used CheatEngine to get a "static address" you are truly a genius due to that fact the last time I used cheat engine you couldn't find an IP address with it... And asking if you need to "#include" the same things shows me you have no knowledge off c++.
    ignore what i said...
    Last edited by Timboy67678; 07-28-2013 at 05:27 AM.

  4. #4
    Skaterforeva1's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Up your ass
    Posts
    917
    Reputation
    32
    Thanks
    476
    My Mood
    Psychedelic
    Quote Originally Posted by Timboy67678 View Post
    ignore what i said...
    What did you say?

    ^Suck it!


  5. #5
    Acea's Avatar
    Join Date
    Oct 2012
    Gender
    female
    Location
    Home of the elks
    Posts
    346
    Reputation
    80
    Thanks
    2,204
    My Mood
    Stressed
    Quote Originally Posted by Skaterforeva1 View Post
    @solidpants Your assault cube hack has nothing to do with this... If you used CheatEngine to get a "static address" you are truly a genius due to that fact the last time I used cheat engine you couldn't find an IP address with it... And asking if you need to "#include" the same things shows me you have no knowledge off c++.



    Take that! <3
    lulz, just gotta be l33t

  6. #6
    Skaterforeva1's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Up your ass
    Posts
    917
    Reputation
    32
    Thanks
    476
    My Mood
    Psychedelic
    Quote Originally Posted by Acea View Post



    Take that! <3
    lulz, just gotta be l33t
    Now show me where you can use and ip address to make a hack for combat arms and supercarz full rez bypass doesnt count

    ^Suck it!


  7. #7
    Acea's Avatar
    Join Date
    Oct 2012
    Gender
    female
    Location
    Home of the elks
    Posts
    346
    Reputation
    80
    Thanks
    2,204
    My Mood
    Stressed
    Quote Originally Posted by Skaterforeva1 View Post
    Now show me where you can use and ip address to make a hack for combat arms and supercarz full rez bypass doesnt count
    using googles_l33t_power;

    if(isl33t)
    {
    fuxt3hgame;
    }

    bam roasted. :3
    May need his bypass though....

  8. The Following User Says Thank You to Acea For This Useful Post:

    Skaterforeva1 (07-29-2013)

Similar Threads

  1. [Solved] have question about No flash hack
    By phillyfunguy in forum CrossFire Help
    Replies: 8
    Last Post: 01-16-2012, 07:53 PM
  2. G-Force have questions about CA hacks
    By NoJustice in forum Combat Arms Discussions
    Replies: 15
    Last Post: 07-05-2011, 03:13 PM
  3. I'm new to c++ and have a question about pointers
    By I.P in forum C++/C Programming
    Replies: 2
    Last Post: 05-26-2011, 11:31 PM
  4. New to the Forum. Some questions about MW2 Hacks
    By techmando in forum Call of Duty Modern Warfare 2 Discussions
    Replies: 8
    Last Post: 04-27-2010, 04:42 PM
  5. have question about some hacks
    By rino1992 in forum WarRock - International Hacks
    Replies: 5
    Last Post: 12-31-2007, 09:51 AM