Skip to content

Repository files navigation

Cathook

Cathook is a Team Fortress 2 Linux internal DLC.

BETA WARNING

This project is currently in beta. Some features may be broken, unfinished, unstable, or may not work at all. Expect bugs, crashes, missing behavior, and issues. You need to downgrade steam before trying to host bots. ( /scripts )

SUPPORT DISCORD SERVER

Discord: https://discord.gg/VP8JRguD83.

Risk of Manual Ban

Doesnt matter what cheat you use, get ready for a gameban.

Overview

Cathook builds into a shared object that is injected into the TF2 process. It reads game state, calls Source Engine interfaces, hooks selected client/runtime functions, and renders or automates features from inside the game.

Useful project details:

  • The build uses a unity-style entry point in src/cathook.cpp.
  • Runtime files live under /opt/cathook by default.
  • Built libraries are installed to /opt/cathook/bin.
  • Runtime assets from assets/ are installed to /opt/cathook/assets.
  • Runtime configs are stored as .cat files under /opt/cathook/configs by default, including default.cat.
  • Logs are written under /opt/cathook/logs.

For Source Engine interface and structure references, see Valve's Source SDK 2013 Multiplayer.

Installing, Building, Attaching

Officially supported Linux distros are Debian, Ubuntu, Linux Mint, Debian-close distros, and Manjaro. Other distros may work if the dependency installer has a matching package script, but they are not officially supported.

Install build dependencies for your distro:

./install-deps

Install dependencies, build Cat, install runtime files, and prepare the bundled botpanel:

./setup.sh

Build Cat and choose the mode from the first-run terminal menu:

sudo ./build.sh

The saved mode is reused by build.sh, attach.sh, preload, debug.sh, and the Docker build wrappers. Remove ~/.config/cathook/mode or set CATHOOK_MODE_FILE to choose a different preference file.

Build an explicit mode:

sudo ./build.sh --default
sudo ./build.sh --textmode
sudo ./build.sh --both

For a local build without installing to /opt/cathook, use ./build.sh --no-install.

For local development, use dev mode to skip repository update checks and avoid reset paths:

sudo ./build.sh --dev
sudo ./attach.sh --dev
./setup.sh --dev

You can also set CATHOOK_DEV_MODE=1 for build.sh, attach.sh, setup.sh, or botpanel/update. --no-update is accepted as an alias for --dev.

Attach to a running TF2 process:

sudo ./attach.sh

Use the textmode binary when attaching, overriding the saved mode:

sudo CATHOOK_MODE=textmode ./attach.sh
sudo TEXTMODE=1 ./attach.sh

attach.sh refreshes /opt/cathook/assets and keeps cathook exceptions in the single /opt/cathook/logs/exception.log file. Ctrl+C performs a synchronous cleanup, waits for all cathook callbacks to leave, and only then calls dlclose. It stages the temporary dlopen copy through /proc/<pid>/root, checks that the target process can read it, and retries alternate runtime directories when Ubuntu/Steam Runtime path isolation hides a staged file. It also copies any bundled /opt/cathook/bin/libGLEW.so.* next to the temporary library.

Container Build

To build in the repo's Linux container:

./docker_build.sh

On PowerShell hosts:

./docker_build.ps1

Contributing

Do you want to submit code to Cathook? Open a pull request and keep changes focused.

Currently, pupnoodle is the only maintainer, so reviews and issue responses may take time.

Keep code simple, direct, and consistent with the existing style:

  • Use snake_case.
  • Prefer small focused functions and POD-style data where practical.
  • Keep platform-specific behavior isolated.

Credits

This project is based on TeamFortress2-Linux-Internal.
nullworks - original cathook creators
DrCoomer - cheat i based the "cathook" on
GatoPotato658 - Unibox. without him there would be nothing
Salmon - Salmonpaste.