ItsMods

Full Version: Trainer +5 Source Code
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've made a money trainer (called it monkey trainer) 2 years ago, now I've edited it a little, IDK I'm just bored.

Code:
#include <cstdlib>
#include <iostream>
#include <windows.h>

#define gProc hProc //lol ye examples and source codes sometimes confusing me
#define ALT VK_MENU
HWND GTASA;

using namespace std;

int money = 0xB7CE50;
int gravity = 0x863984;
int wep1 = 0x969130;
int wep2 = 0x969131;
int wep3 = 0x969132;


bool get_gta_window(HWND GTA)
{
    GTA = FindWindow(NULL, "GTA:SA");
    if(!GTA)
    {
        MessageBox(NULL, "GTA San Andreas not found.", "FAIL", MB_ICONERROR);
        MessageBox(NULL, "Exitig.", "FAIL", MB_ICONERROR);
        MessageBox(NULL, "trololo.", "FAIL", MB_ICONERROR);
        exit(0);
    }
}

void give_monkey(int amt)
{
    DWORD dwID;
    HANDLE hProc;

    HWND sa;
    get_gta_window(sa);
    GetWindowThreadProcessId(sa, &dwID);
    hProc = OpenProcess(PROCESS_ALL_ACCESS, 0, dwID);
    WriteProcessMemory(hProc, (LPVOID)money, (LPVOID)amt, sizeof(amt), NULL );

}

void change_gravity(int amt)
{
    DWORD dwID;
    HANDLE hProc;

    HWND sa;
    get_gta_window(sa);
    GetWindowThreadProcessId(sa, &dwID);
    hProc = OpenProcess(PROCESS_ALL_ACCESS, 0, dwID);
    WriteProcessMemory(hProc, (LPVOID)gravity, (LPVOID)amt, sizeof(amt), NULL );

}

void give_weapon_set(int which_one)
{
     DWORD dwID;
    HANDLE hProc;

    HWND sa;
    get_gta_window(sa);
    GetWindowThreadProcessId(sa, &dwID);
    hProc = OpenProcess(PROCESS_ALL_ACCESS, 0, dwID);
    
    switch(which_one)
    {
        case 1:
        WriteProcessMemory(hProc, (LPVOID)wep1, (LPVOID)1, sizeof(1), NULL );
        break;
        
        case 2:
        WriteProcessMemory(hProc, (LPVOID)wep2, (LPVOID)1, sizeof(1), NULL );
        break;
        
        case 3:
        WriteProcessMemory(hProc, (LPVOID)wep3, (LPVOID)1, sizeof(1), NULL );
        break;
   }
}


void get_hot_keys()
{
while(1)
            {
                if(GetAsyncKeyState(ALT) && GetAsyncKeyState(VK_F1))
                {
                        give_monkey(99999);
                }
                

                if(GetAsyncKeyState(ALT) && GetAsyncKeyState(VK_F2))
                {
                       change_gravity(200);
                }
                
                if(GetAsyncKeyState(ALT) && GetAsyncKeyState(VK_F3))
                {
                        give_weapon_set(1);
                }
                if(GetAsyncKeyState(ALT) && GetAsyncKeyState(VK_F4))
                {
                        give_weapon_set(2);
                }
                if(GetAsyncKeyState(ALT) && GetAsyncKeyState(VK_F5))
                {
                        give_weapon_set(3);
                }
            }
}


int main(int argc, char *argv[])
{
    printf("ALT + F1 for 999999 money\nALT + F2 low gravity\nALT + F3 weapon set 1\nALT + F4 weapon set 2\nALT + F5 weapon set 3");
    while(1)
    {
            if(get_gta_window(GTASA))
            {
            get_hot_keys();
             }
            
    }
}

Made with Dev-C++.

It's a trainer for GTA:SA, I got memory addresses from here.

This is just simple as it looks.
[Image: 99180919.png]
I love the FAIL error lol
LOLLLL GTA Trainer hahaaahahha made my day.
/hate c++
Lol, you use .NET. THAT'S A SCRIPTINGLANGUAGE. LOL!
I have no idea what that means lol
that one will leak a lot of handles