Giter Site home page Giter Site logo

jones-hm / gtlibcpp Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 6.22 MB

GTLIbCpp is library to make game trainer in C++ it provide all the necessary methods to make simple game trainer with Cheat-Engine support

License: MIT License

C++ 99.36% Batchfile 0.64%
cheat-engine cheat-engine-tables game-development game-hacking game-modding game-trainer windows-api game-trainer-lib

gtlibcpp's Introduction

cover_logo

GTLibCpp - Game Trainer Library

GTLibc is a library designed to facilitate the creation of game trainers in C++ with latest C++17 features. It offers a comprehensive set of methods that enable developers to develop simple game trainers for the Windows operating system using the Win32 API with ease.
Notably, GTLibc exclusively employs Win32 API methods and eschews CRT methods as its primary aim is to operate exclusively on Windows systems and not to be portable to other operating systems such as Linux or Mac OS.
It provides all the requisite methods necessary for game trainer development from the inception of the project to its completion. It streamlines the development process, making it less cumbersome for developers.

ONLINE_USAGE

This library is intended to be used only for offline games. You agree not to use the Library for any online games. for more information, see ONLINE_USAGE.md

Demo and Usages

  • Generic Trainer - [GTLibc-Generator] used to generate the trainer example GenericTrainer.cpp file is generated from Cheat Engine table file.
  • Simple Trainer - [SimpleTrainer] is a simple trainer example using GTLibc library. Example IGITrainer.cpp

Usage and Installation

  • To use GTLibc just include the GTLibc.h header file in your project.
  • To use the [GTLibc-Generator], you need to install [Cheat Engine] and include the GTLibc.h header file in your project.
    1. Read the Cheat Engine table file using this gtlibc.ReadCheatTable("CheatTableFile.ct"); method.
    2. Activate the Cheat Entries you want to use in the trainer using this gtlibc.ActivateCheatTableEntries({0, 1, 2}); method.
    3. Execute and Generate the trainer using this gtlibc.ExecuteCheatTable(); method.
  • To compile and run the file use CppRunner.bat file_name.cpp.
  • Or to run manually use this command g++ -std=c++17 -w -DGT_USE_CE_PARSER -o GenericTrainer.exe GenericTrainer.cpp GTLibc.cpp CEParser.cpp note the flag GT_USE_CE_PARSER is important to use if compiling for CheatEngine. You need to have C++ 17 Compiler installed on your machine.

Features and Usages

  • Game Process and Window Detection.
  • Memory Reading and Writing with advanced pointer support.
  • Hotkey Detection with advanced support for multiple hotkeys.
  • Using latest C++ 17 features for ease of use and readability.
  • No external dependencies - only the Win32 API and Standard C++ Library.
  • Generate Generic trainer using the [GTLibc-Generator].
  • Advanced support for famous Cheat Engine.

Methods information and usages

Method Description Example Signature
FindGameProcess Finds the game process by its name. HANDLE handle = FindGameProcess("GameName"); HANDLE FindGameProcess(const std::string &gameName);
FindGameWindow Finds the game window by its name. HWND gameWindow = FindGameWindow("GameWindowName"); HWND FindGameWindow(const std::string &windowName);
ReadAddress Reads the value at the address. Int value = ReadAddress<int>(0x12345678); T ReadAddress(DWORD address);
WriteAddress Writes the value at the address. Bool result = WriteAddress<int>(0x12345678, 100); Bool WriteAddress(DWORD address, const T &value);
ReadAddressOffset Reads the value at the address with the offset. Int value = ReadAddressOffset<int>(0x12345678, 0x10); T ReadAddressOffset(DWORD address, const DWORD offset);
WriteAddressOffset Writes the value at the address with the offset. Bool result = WriteAddressOffset<int>(0x12345678, 0x10, 100); Bool WriteAddressOffset(DWORD address, DWORD offset, const T &value);
ReadAddressOffsets Reads the value at the address with the offsets. Int value = ReadAddressOffsets<int>(0x12345678, {0x10, 0x20}); T ReadAddressOffsets(DWORD address, const std::vector &offsets);
WriteAddressOffsets Writes the value at the address with the offsets. Bool result = WriteAddressOffsets<int>(0x12345678, {0x10, 0x20}, 100); Bool WriteAddressOffsets(DWORD address, const std::vector &offsets, const T &value);
ReadPointer Reads the value at the address. Int value = ReadPointer<int>(0x12345678); T ReadPointer(DWORD address);
WritePointer Writes the value at the address with the pointer offset. Bool result = WritePointer<int>(0x12345678, 0x10, 100); Bool WritePointer(DWORD address, DWORD pointerOffset, const T &value);
ReadPointerOffset Reads the value at the address with the pointer offset. Int value = ReadPointerOffset<int>(0x12345678, 0x10); T ReadPointerOffset(DWORD address, const DWORD offset);
WritePointerOffset Writes the value at the address with the pointer and offset. Bool result = WritePointerOffset<int>(0x12345678, 0x10, 0x20, 100); Bool WritePointerOffset(DWORD address, DWORD pointerOffset, DWORD offset, const T &value);
ReadPointerOffsets Reads the value at the address with the pointer offsets. Int value = ReadPointerOffsets<int>(0x12345678, {0x10, 0x20}); T ReadPointerOffsets(DWORD address, const std::vector &offsets);
WritePointerOffsets Writes the value at the address with the pointer and offsets. Bool result = WritePointerOffsets<int>(0x12345678, 0x10, {0x20, 0x30}, 100); Bool WritePointerOffsets(DWORD address, DWORD pointerOffset, const std::vector &offsets, const T &value);
ReadString Reads the string at the address with the size. Std::string value = ReadString(0x12345678, 20); Std::string ReadString(DWORD address, size_t size);
WriteString Writes the string at the address. Bool result = WriteString(0x12345678, "Hello World"); Bool WriteString(DWORD address, const std::string &str);
HotKeysDown Checks if all the keys are pressed. Bool isPressed = HotKeysDown({VK_A, VK_B, VK_C}); Bool HotKeysDown(const std::vector &keys);
IsKeyPressed Checks if the key is pressed. Bool isPressed = IsKeyPressed(VK_A); Bool IsKeyPressed(int keycode);
IsKeyToggled Checks if the key is toggled. Bool isToggled = IsKeyToggled(VK_CAPITAL); Bool IsKeyToggled(int keycode);
GetGameName Returns the name of the game. Std::string gameName = GetGameName(); Std::string GetGameName();
GetProcessId Returns the process id of the game. DWORD processId = GetProcessId(); DWORD GetProcessId();
GetGameHandle4mHWND Returns the game handle from the window handle. HANDLE gameHandle = GetGameHandle4mHWND(gameWindow); HANDLE GetGameHandle4mHWND(HWND hwnd);
GetProcessID4mHWND Returns the process id from the window handle. DWORD processId = GetProcessID4mHWND(gameWindow); DWORD GetProcessID4mHWND(HWND hwnd);
GetGameHandle Returns the game handle. HANDLE gameHandle = GetGameHandle(); HANDLE GetGameHandle();
GetGameBaseAddress Returns the base address of the game. DWORD baseAddress = GetGameBaseAddress(); DWORD GetGameBaseAddress();
EnableLogs Enables or disables the logs. EnableLogs(true); Void EnableLogs(bool status);
ReadCheatTable Reads the cheat table file and returns the cheat table. CheatTable ct = ReadCheatTable("cheatTableFile.ct"); CheatTable ReadCheatTable(const std::string &cheatTableFile, int entries = -1);
AddCheatTableEntry Adds the cheat entry to the cheat table. AddCheatTableEntry("Armor", CheatTypes.Integer, 0x07290BC8, {}, {VK_CONTROL, 'M'}, CheatActions.SetValue, "150"); Void AddCheatTableEntry(const std::string &description, const std::string &dataType, const DWORD address, const std::vector &offsets, const std::vector &hotkeys, const std::string &hotkeyAction, const std::string hotkeyValue);
DisplayCheatTable Displays the cheat table. DisplayCheatTable(); Void DisplayCheatTable(bool showMenuIndex = true, bool showMenuDescription = true, bool showMenuAction = false, bool showMenuHotkeys = true, bool showMenuValue = false);
ReadCheatTableEntries Reads the cheat table entries and print their values. ReadCheatTableEntries(); Void ReadCheatTableEntries();
ActivateCheatTableEntries Activates the cheat table entries. ActivateCheatTableEntries({1, 2, 3}); Void ActivateCheatTableEntries(const std::vector &cheatEntryIndex);
ExecuteCheatTable Executes the cheat table and generate trainer. ExecuteCheatTable(true, VK_ESCAPE, true, true, false, true); Void ExecuteCheatTable(bool showTrainerOutput = false, int exitTrainerKey = EXIT_TRAINER_KEY, bool showMenuIndex = true, bool showMenuDescription = true, bool showMenuAction = false, bool showMenuHotkeys = true);

Written and maintained by: HeavenHM@2023. cover_logo

gtlibcpp's People

Contributors

haseeb-heaven avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.