-
Install git and make sure Git from the command line is enabled.
-
Clone this repo with submodules:
git clone --recurse-submodules -j8 https://github.com/mankool0/GTFOHax.git
If you have errors due to repo size, clone with depth 1:
git clone --depth=1 --recurse-submodules -j8 https://github.com/mankool0/GTFOHax.git
- CMake 3.31+
- MinGW-w64 cross-compiler
- MinGW-w64 FreeType library
- pkg-config
Fedora/RHEL:
sudo dnf install cmake mingw64-gcc-c++ mingw64-freetype-static mingw64-libpng-static mingw64-zlib-static mingw64-bzip2-staticDebian/Ubuntu:
Note: Debian/Ubuntu do not provide pre-built MinGW-w64 libraries for FreeType, libpng, or bzip2. You will need to either disable FreeType support or build the libraries manually from source.
# Install base toolchain (libraries need additional setup - see note above)
sudo apt install cmake g++-mingw-w64-x86-64 libz-mingw-w64-dev pkg-configArch Linux:
Note: MinGW-w64 library packages are in the AUR (Arch User Repository), not official repos. You'll need an AUR helper like
yayorparu.
# Install from official repos
sudo pacman -S cmake mingw-w64-gcc
# Install from AUR (requires AUR helper like yay)
yay -S mingw-w64-freetype2 mingw-w64-libpng mingw-w64-bzip2 mingw-w64-zlib# Configure (Debug)
cmake -B build -DCMAKE_BUILD_TYPE=Debug
# Configure (Release)
cmake -B build -DCMAKE_BUILD_TYPE=Release
# Build
cmake --build build -j$(nproc)Output locations:
- Debug:
build/GTFOHax.dll - Release:
build/GTFOHax-v{version}.dll
- Visual Studio 2026 with "Desktop development with C++" workload
- vcpkg - Follow steps 1-2 to clone and bootstrap, then run:
vcpkg integrate install
-
Open Visual Studio Developer Command Prompt:
%comspec% /k "C:\Program Files\Microsoft Visual Studio\18\Community\Common7\Tools\VsDevCmd.bat"
-
Build:
cd GTFOHax msbuild GTFOHax.sln /P:Configuration=Release -
Output:
x64\Release\GTFOHax.dll
- Open
GTFOHax.sln - Set configuration to Release
- Build -> Build Solution
- Output:
x64\Release\GTFOHax.dll
Note: If this is your first time building and you see "Error applying a patch" in PreBuildEvent or build output, try to manually apply the failed git patch. If it's already been applied this error can be ignored.
- GDB debugger
- protontricks (for Wine integration)
- Python 3
Fedora:
sudo dnf install gdb python3 protontricksDebian/Ubuntu:
sudo apt install gdb python3 protontricksArch Linux:
sudo pacman -S gdb python protontrickscmake -B build -DCMAKE_BUILD_TYPE=Debug
cmake --build build -j$(nproc)This builds both GTFOHax.dll and injector.exe with full debug information.
The injector tool loads your DLL into the running GTFO process:
# Launch GTFO first, then inject the DLL
cd build
protontricks-launch --no-bwrap --appid 493520 ./injector.exe GTFO.exe ./GTFOHax.dllDefault behavior (if no arguments provided):
- Process:
GTFO.exe - DLL:
GTFOHax.dllin the same directory as injector
This project includes VSCode tasks and launch configurations for streamlined debugging.
Available Tasks (Terminal -> Run Task):
Build All- Builds DLL and injectorBuild DLL Only- Builds just the DLLBuild Injector Only- Builds just the injectorWait for GTFO Process- Waits for GTFO to launchInject DLL- Automatically builds, waits for GTFO, and injects
Debugging Steps:
- Launch GTFO through Steam
- Run task:
Inject DLL(Ctrl+Shift+B or Terminal -> Run Task) - Use Debug panel:
Attach to GTFOconfiguration - Pick the
GTFO.exeprocess when prompted - GDB will automatically load DLL symbols via scripts/gdb_load_symbols.py
The symbol loader automatically:
- Finds GTFOHax.dll in process memory
- Calculates runtime addresses for all sections
- Loads symbols with correct relocation
- Enables source-level debugging with breakpoints
If GTFO crashes, analyze the crash log to map addresses to source code:
# Auto-detect latest crash log
python3 scripts/process_crash_stack.py
# Or specify a log file
python3 scripts/process_crash_stack.py /path/to/crash.log --dll build/GTFOHax.dllThe script will:
- Extract crash addresses from the log
- Map addresses to source files and line numbers
- Display source code context around the crash
- Show disassembly with the crash location highlighted
- Identify the nearest function symbol
For advanced debugging without VSCode:
# Attach to running process
gdb -p $(pgrep GTFO.exe)
# Load symbols manually
(gdb) source scripts/gdb_load_symbols.py
(gdb) load-symbols build/GTFOHax.dll
# Set breakpoints
(gdb) break hooks.cpp:123
(gdb) continue-
Build Il2CppInspector from mankool0/Il2CppInspector (includes necessary patches) or use the upstream version with these changes.
-
Generate C++ scaffolding projects for both compilers:
- Create a project targeting GCC and place files in
GTFOHax/appdata/gcc/ - Create a project targeting MSVC and place files in
GTFOHax/appdata/msvc/
The build system automatically selects the correct files based on the compiler being used.
- Create a project targeting GCC and place files in
-
Fix any errors that might show up if game functions changed.
Make a PR