{"id":27246272,"url":"https://github.com/jones-hm/gtlibcpp","last_synced_at":"2025-04-10T21:37:46.689Z","repository":{"id":155579314,"uuid":"627260410","full_name":"Jones-HM/gtlibcpp","owner":"Jones-HM","description":"GTLIbCpp is library to make game trainer in C++ it provide all the necessary methods to make simple game trainer with Cheat-Engine support","archived":false,"fork":false,"pushed_at":"2023-04-25T22:58:50.000Z","size":6369,"stargazers_count":11,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T08:59:51.700Z","etag":null,"topics":["cheat-engine","cheat-engine-tables","game-development","game-hacking","game-modding","game-trainer","game-trainer-lib","windows-api"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Jones-HM.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-04-13T05:27:24.000Z","updated_at":"2025-02-11T02:14:49.000Z","dependencies_parsed_at":"2024-02-11T16:47:39.932Z","dependency_job_id":null,"html_url":"https://github.com/Jones-HM/gtlibcpp","commit_stats":null,"previous_names":["jones-hm/gtlibcpp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jones-HM%2Fgtlibcpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jones-HM%2Fgtlibcpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jones-HM%2Fgtlibcpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jones-HM%2Fgtlibcpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jones-HM","download_url":"https://codeload.github.com/Jones-HM/gtlibcpp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248304940,"owners_count":21081551,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cheat-engine","cheat-engine-tables","game-development","game-hacking","game-modding","game-trainer","game-trainer-lib","windows-api"],"created_at":"2025-04-10T21:37:45.965Z","updated_at":"2025-04-10T21:37:46.681Z","avatar_url":"https://github.com/Jones-HM.png","language":"C++","readme":"![cover_logo](https://github.com/haseeb-heaven/GTLibCpp/blob/master/resources/gtlibc_logo.png?raw=true \"\")\n# GTLibCpp - Game Trainer Library\n\nGTLibc is a library designed to facilitate the creation of game trainers in C++ with **latest C++17 features**.\nIt 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.\u003c/br\u003e\n**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_.\u003c/br\u003e\nIt provides all the requisite methods necessary for game trainer development from the inception of the project to its completion.\nIt streamlines the development process, making it _less cumbersome for developers_.\u003c/br\u003e\n\n## ONLINE_USAGE\n\nThis library is intended to be used only for **offline** games. You agree not to use the Library for any online games.\nfor more information, see [ONLINE_USAGE.md](ONLINE_USAGE.md)\n\n## Demo and Usages\n\n- Generic Trainer - **[GTLibc-Generator]** used to generate the trainer example `GenericTrainer.cpp` file is generated from Cheat Engine table file.\u003c/br\u003e\n- Simple Trainer - **[SimpleTrainer]** is a simple trainer example using GTLibc library. Example `IGITrainer.cpp`\u003c/br\u003e\n\n## Usage and Installation\n\n- To use GTLibc just include the `GTLibc.h` header file in your project. \u003c/br\u003e\n- To use the **[GTLibc-Generator]**, you need to install **[Cheat Engine]** and include the `GTLibc.h` header file in your project.\u003c/br\u003e\n  1. **Read** the **Cheat Engine** table file using this `gtlibc.ReadCheatTable(\"CheatTableFile.ct\");` method.\u003c/br\u003e\n  2. **Activate** the **Cheat Entries** you want to use in the trainer using this `gtlibc.ActivateCheatTableEntries({0, 1, 2});` method.\u003c/br\u003e\n  3. **Execute** and **Generate** the trainer using this `gtlibc.ExecuteCheatTable();` method.\u003c/br\u003e\n- To **compile** and **run** the file use `CppRunner.bat file_name.cpp`.\u003c/br\u003e\n- 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**.\u003c/br\u003e\n\n## Features and Usages\n\n- Game **Process** and **Window** Detection.\n- Memory **Reading** and **Writing** with advanced **pointer support**.\n- Hotkey Detection with **advanced support** for **multiple hotkeys**.\n- Using latest **C++ 17 features** for ease of use and readability.\n- No external dependencies - only the **Win32 API** and **Standard C++ Library**.\n- Generate Generic trainer using the **[GTLibc-Generator]**.\n- Advanced support for famous **Cheat Engine**.\n\n## Methods information and usages\n\n\u003ctable\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003eMethod\u003c/th\u003e\n\u003cth\u003eDescription\u003c/th\u003e\n\u003cth\u003eExample\u003c/th\u003e\n\u003cth\u003eSignature\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003eFindGameProcess\u003c/td\u003e\n\u003ctd nowrap=\"\"\u003eFinds the game process by its name.\u003c/td\u003e\n\u003ctd\u003eHANDLE handle = FindGameProcess(\"GameName\");\u003c/td\u003e\n\u003ctd\u003eHANDLE FindGameProcess(const std::string \u0026amp;gameName);\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eFindGameWindow\u003c/td\u003e\n\u003ctd nowrap=\"\"\u003eFinds the game window by its name.\u003c/td\u003e\n\u003ctd\u003eHWND gameWindow = FindGameWindow(\"GameWindowName\");\u003c/td\u003e\n\u003ctd\u003eHWND FindGameWindow(const std::string \u0026amp;windowName);\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eReadAddress\u003c/td\u003e\n\u003ctd nowrap=\"\"\u003eReads the value at the address.\u003c/td\u003e\n\u003ctd\u003eInt value = ReadAddress\u0026lt;int\u0026gt;(0x12345678);\u003c/td\u003e\n\u003ctd\u003eT ReadAddress(DWORD address);\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eWriteAddress\u003c/td\u003e\n\u003ctd nowrap=\"\"\u003eWrites the value at the address.\u003c/td\u003e\n\u003ctd\u003eBool result = WriteAddress\u0026lt;int\u0026gt;(0x12345678, 100);\u003c/td\u003e\n\u003ctd\u003eBool WriteAddress(DWORD address, const T \u0026amp;value);\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eReadAddressOffset\u003c/td\u003e\n\u003ctd nowrap=\"\"\u003eReads the value at the address with the offset.\u003c/td\u003e\n\u003ctd\u003eInt value = ReadAddressOffset\u0026lt;int\u0026gt;(0x12345678, 0x10);\u003c/td\u003e\n\u003ctd\u003eT ReadAddressOffset(DWORD address, const DWORD offset);\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eWriteAddressOffset\u003c/td\u003e\n\u003ctd nowrap=\"\"\u003eWrites the value at the address with the offset.\u003c/td\u003e\n\u003ctd\u003eBool result = WriteAddressOffset\u0026lt;int\u0026gt;(0x12345678, 0x10, 100);\u003c/td\u003e\n\u003ctd\u003eBool WriteAddressOffset(DWORD address, DWORD offset, const T \u0026amp;value);\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eReadAddressOffsets\u003c/td\u003e\n\u003ctd nowrap=\"\"\u003eReads the value at the address with the offsets.\u003c/td\u003e\n\u003ctd\u003eInt value = ReadAddressOffsets\u0026lt;int\u0026gt;(0x12345678, {0x10, 0x20});\u003c/td\u003e\n\u003ctd\u003eT ReadAddressOffsets(DWORD address, const std::vector \u0026amp;offsets);\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eWriteAddressOffsets\u003c/td\u003e\n\u003ctd nowrap=\"\"\u003eWrites the value at the address with the offsets.\u003c/td\u003e\n\u003ctd\u003eBool result = WriteAddressOffsets\u0026lt;int\u0026gt;(0x12345678, {0x10, 0x20}, 100);\u003c/td\u003e\n\u003ctd\u003eBool WriteAddressOffsets(DWORD address, const std::vector \u0026amp;offsets, const T \u0026amp;value);\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eReadPointer\u003c/td\u003e\n\u003ctd nowrap=\"\"\u003eReads the value at the address.\u003c/td\u003e\n\u003ctd\u003eInt value = ReadPointer\u0026lt;int\u0026gt;(0x12345678);\u003c/td\u003e\n\u003ctd\u003eT ReadPointer(DWORD address);\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eWritePointer\u003c/td\u003e\n\u003ctd nowrap=\"\"\u003eWrites the value at the address with the pointer offset.\u003c/td\u003e\n\u003ctd\u003eBool result = WritePointer\u0026lt;int\u0026gt;(0x12345678, 0x10, 100);\u003c/td\u003e\n\u003ctd\u003eBool WritePointer(DWORD address, DWORD pointerOffset, const T \u0026amp;value);\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eReadPointerOffset\u003c/td\u003e\n\u003ctd nowrap=\"\"\u003eReads the value at the address with the pointer offset.\u003c/td\u003e\n\u003ctd\u003eInt value = ReadPointerOffset\u0026lt;int\u0026gt;(0x12345678, 0x10);\u003c/td\u003e\n\u003ctd\u003eT ReadPointerOffset(DWORD address, const DWORD offset);\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eWritePointerOffset\u003c/td\u003e\n\u003ctd nowrap=\"\"\u003eWrites the value at the address with the pointer and offset.\u003c/td\u003e\n\u003ctd\u003eBool result = WritePointerOffset\u0026lt;int\u0026gt;(0x12345678, 0x10, 0x20, 100);\u003c/td\u003e\n\u003ctd\u003eBool WritePointerOffset(DWORD address, DWORD pointerOffset, DWORD offset, const T \u0026amp;value);\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eReadPointerOffsets\u003c/td\u003e\n\u003ctd nowrap=\"\"\u003eReads the value at the address with the pointer offsets.\u003c/td\u003e\n\u003ctd\u003eInt value = ReadPointerOffsets\u0026lt;int\u0026gt;(0x12345678, {0x10, 0x20});\u003c/td\u003e\n\u003ctd\u003eT ReadPointerOffsets(DWORD address, const std::vector \u0026amp;offsets);\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eWritePointerOffsets\u003c/td\u003e\n\u003ctd nowrap=\"\"\u003eWrites the value at the address with the pointer and offsets.\u003c/td\u003e\n\u003ctd\u003eBool result = WritePointerOffsets\u0026lt;int\u0026gt;(0x12345678, 0x10, {0x20, 0x30}, 100);\u003c/td\u003e\n\u003ctd\u003eBool WritePointerOffsets(DWORD address, DWORD pointerOffset, const std::vector \u0026amp;offsets, const T \u0026amp;value);\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eReadString\u003c/td\u003e\n\u003ctd nowrap=\"\"\u003eReads the string at the address with the size.\u003c/td\u003e\n\u003ctd\u003eStd::string value = ReadString(0x12345678, 20);\u003c/td\u003e\n\u003ctd\u003eStd::string ReadString(DWORD address, size_t size);\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eWriteString\u003c/td\u003e\n\u003ctd nowrap=\"\"\u003eWrites the string at the address.\u003c/td\u003e\n\u003ctd\u003eBool result = WriteString(0x12345678, \"Hello World\");\u003c/td\u003e\n\u003ctd\u003eBool WriteString(DWORD address, const std::string \u0026amp;str);\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eHotKeysDown\u003c/td\u003e\n\u003ctd nowrap=\"\"\u003eChecks if all the keys are pressed.\u003c/td\u003e\n\u003ctd\u003eBool isPressed = HotKeysDown({VK_A, VK_B, VK_C});\u003c/td\u003e\n\u003ctd\u003eBool HotKeysDown(const std::vector \u0026amp;keys);\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eIsKeyPressed\u003c/td\u003e\n\u003ctd nowrap=\"\"\u003eChecks if the key is pressed.\u003c/td\u003e\n\u003ctd\u003eBool isPressed = IsKeyPressed(VK_A);\u003c/td\u003e\n\u003ctd\u003eBool IsKeyPressed(int keycode);\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eIsKeyToggled\u003c/td\u003e\n\u003ctd nowrap=\"\"\u003eChecks if the key is toggled.\u003c/td\u003e\n\u003ctd\u003eBool isToggled = IsKeyToggled(VK_CAPITAL);\u003c/td\u003e\n\u003ctd\u003eBool IsKeyToggled(int keycode);\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eGetGameName\u003c/td\u003e\n\u003ctd nowrap=\"\"\u003eReturns the name of the game.\u003c/td\u003e\n\u003ctd\u003eStd::string gameName = GetGameName();\u003c/td\u003e\n\u003ctd\u003eStd::string GetGameName();\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eGetProcessId\u003c/td\u003e\n\u003ctd nowrap=\"\"\u003eReturns the process id of the game.\u003c/td\u003e\n\u003ctd\u003eDWORD processId = GetProcessId();\u003c/td\u003e\n\u003ctd\u003eDWORD GetProcessId();\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eGetGameHandle4mHWND\u003c/td\u003e\n\u003ctd nowrap=\"\"\u003eReturns the game handle from the window handle.\u003c/td\u003e\n\u003ctd\u003eHANDLE gameHandle = GetGameHandle4mHWND(gameWindow);\u003c/td\u003e\n\u003ctd\u003eHANDLE GetGameHandle4mHWND(HWND hwnd);\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eGetProcessID4mHWND\u003c/td\u003e\n\u003ctd nowrap=\"\"\u003eReturns the process id from the window handle.\u003c/td\u003e\n\u003ctd\u003eDWORD processId = GetProcessID4mHWND(gameWindow);\u003c/td\u003e\n\u003ctd\u003eDWORD GetProcessID4mHWND(HWND hwnd);\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eGetGameHandle\u003c/td\u003e\n\u003ctd nowrap=\"\"\u003eReturns the game handle.\u003c/td\u003e\n\u003ctd\u003eHANDLE gameHandle = GetGameHandle();\u003c/td\u003e\n\u003ctd\u003eHANDLE GetGameHandle();\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eGetGameBaseAddress\u003c/td\u003e\n\u003ctd nowrap=\"\"\u003eReturns the base address of the game.\u003c/td\u003e\n\u003ctd\u003eDWORD baseAddress = GetGameBaseAddress();\u003c/td\u003e\n\u003ctd\u003eDWORD GetGameBaseAddress();\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eEnableLogs\u003c/td\u003e\n\u003ctd nowrap=\"\"\u003eEnables or disables the logs.\u003c/td\u003e\n\u003ctd\u003eEnableLogs(true);\u003c/td\u003e\n\u003ctd\u003eVoid EnableLogs(bool status);\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eReadCheatTable\u003c/td\u003e\n\u003ctd nowrap=\"\"\u003eReads the cheat table file and returns the cheat table.\u003c/td\u003e\n\u003ctd\u003eCheatTable ct = ReadCheatTable(\"cheatTableFile.ct\");\u003c/td\u003e\n\u003ctd\u003eCheatTable ReadCheatTable(const std::string \u0026amp;cheatTableFile, int entries = -1);\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eAddCheatTableEntry\u003c/td\u003e\n\u003ctd nowrap=\"\"\u003eAdds the cheat entry to the cheat table.\u003c/td\u003e\n\u003ctd\u003eAddCheatTableEntry(\"Armor\", CheatTypes.Integer, 0x07290BC8, {}, {VK_CONTROL, 'M'}, CheatActions.SetValue, \"150\");\u003c/td\u003e\n\u003ctd\u003eVoid AddCheatTableEntry(const std::string \u0026amp;description, const std::string \u0026amp;dataType, const DWORD address, const std::vector \u0026amp;offsets, const std::vector \u0026amp;hotkeys, const std::string \u0026amp;hotkeyAction, const std::string hotkeyValue);\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eDisplayCheatTable\u003c/td\u003e\n\u003ctd nowrap=\"\"\u003eDisplays the cheat table.\u003c/td\u003e\n\u003ctd\u003eDisplayCheatTable();\u003c/td\u003e\n\u003ctd\u003eVoid DisplayCheatTable(bool showMenuIndex = true, bool showMenuDescription = true, bool showMenuAction = false, bool showMenuHotkeys = true, bool showMenuValue = false);\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eReadCheatTableEntries\u003c/td\u003e\n\u003ctd nowrap=\"\"\u003eReads the cheat table entries and print their values.\u003c/td\u003e\n\u003ctd\u003eReadCheatTableEntries();\u003c/td\u003e\n\u003ctd\u003eVoid ReadCheatTableEntries();\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eActivateCheatTableEntries\u003c/td\u003e\n\u003ctd nowrap=\"\"\u003eActivates the cheat table entries.\u003c/td\u003e\n\u003ctd\u003eActivateCheatTableEntries({1, 2, 3});\u003c/td\u003e\n\u003ctd\u003eVoid ActivateCheatTableEntries(const std::vector \u0026amp;cheatEntryIndex);\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eExecuteCheatTable\u003c/td\u003e\n\u003ctd nowrap=\"\"\u003eExecutes the cheat table and generate trainer.\u003c/td\u003e\n\u003ctd\u003eExecuteCheatTable(true, VK_ESCAPE, true, true, false, true);\u003c/td\u003e\n\u003ctd\u003eVoid ExecuteCheatTable(bool showTrainerOutput = false, int exitTrainerKey = EXIT_TRAINER_KEY, bool showMenuIndex = true, bool showMenuDescription = true, bool showMenuAction = false, bool showMenuHotkeys = true);\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\nWritten and maintained by: **HeavenHM@2023.**\n![cover_logo](https://github.com/haseeb-heaven/GTLibCpp/blob/master/resources/heaven_hm.png?raw=true \"\")\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjones-hm%2Fgtlibcpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjones-hm%2Fgtlibcpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjones-hm%2Fgtlibcpp/lists"}