TeamVanilla logo

Code and documentation from TeamVanilla

Three libraries we build everything on, the tools we make with them, what we have made for eight games, the encyclopedias we write for them, and games of our own. Each game has a page that lists everything for it, finished or in development. The company site, teamvanilla.org, covers how we work and what we won't do, and about us tells how we started and who we are.

Libraries

VanHooks: function hooking

A C++23 library for hooking functions on Windows, Linux and macOS, on x86, x64 and ARM64. It has 17 kinds of hook, from trampolines, import tables, PLT entries and vtables to hardware breakpoints and TLS callbacks, with std::expected errors, RAII lifetime, groups, chaining, introspection and a batch queue. Read about VanHooks, or see the source on GitHub.

#include <vh/vh.hpp>

static decltype(&MessageBoxW) orig_mbw = nullptr;

int WINAPI hk_mbw(HWND h, LPCWSTR text, LPCWSTR cap, UINT type) {
    return orig_mbw(h, L"[Intercepted]", cap, type);
}

auto r = vh::api_hook("user32", "MessageBoxW", &hk_mbw, &orig_mbw);
if (!r) return log(vh::error_to_string(r.error()));

// unhooked when `hook` is destroyed
vh::Hook hook = std::move(*r);

VanGUI: immediate-mode UI

An immediate-mode UI library with 40 optional modules of our own: animation, stylesheet theming, dialogs, signals and slots, a command palette, a node graph, and tooling widgets such as a hex editor, a data grid and a timeline. A module you leave switched off compiles to nothing. Read about VanGUI, or see the source on GitHub.

#include <vangui/van.h>
using namespace van;

if (auto w = window("Settings", { .size = {420, 300}, .p_open = &open })) {
    checkbox("V-Sync", cfg.vsync);
    slider("Volume", cfg.volume, 0.f, 100.f, "%.0f%%");
    button("Save", { .primary = true }).on_click(save);
}

VanGFX: Direct3D interception

One C++20 API over Direct3D 9, 11 and 12. It reports every draw, state change, resource and present, lets you replace or add to shaders, captures the G-buffer, and reads buffers back from the GPU, all without a proxy DLL. Read about VanGFX, or see the source on GitHub.

auto ctx = vangfx::ContextBuilder{}
    .backend(vangfx::BackendKind::D3D11)
    .d3d11_device(device)
    .d3d11_swap_chain(swapChain)
    .build()
    .value();

ctx->on_draw([](vangfx::FrameContext&, vangfx::DrawEvent& ev) {
    if (ev.vertex_count > 10'000) { /* a big mesh */ }
});

Tools

NiToolsStatic analysis of any file in your browser at teamvanilla.dev/nitools/; the file is never uploaded.
VanSuiteA desktop reverse-engineering app: disassembly, graphs, a decompiler and vtable recovery, with live instrumentation through VanHooks.
VanToolsA Windows maintenance suite: cleaning, startup control, drivers, an uninstaller and a download manager, with no ads and no telemetry.
Py2EXEA desktop app over PyInstaller: point it at a script or a project and build a Windows executable.
DiscordChatExporterSaves a Discord channel's history to plain text or JSON.
GameFunctionsToolsChecks claimed C++ class layouts against an executable's own RTTI and code, and says which offsets hold.

Games

Every game page splits its work into what is finished and what is in development.

Need for Speed: Most WantedOur longest-running work: a reference book, an SDK, two renderers, an editor suite, a world editor, a mod loader and mods.
Grand Theft Auto: San AndreasA reference book and an SDK for version 1.0 US, and our modpack, Vanilla Remastered.
The Simpsons: Hit & RunA reference book, an SDK generated from the executable's own type information, and mods.
Soldier FrontOpenSF, the game reconstructed with its own server; a map editor; and a launcher, frame-rate and controller mods for the Legacy client.
Drift CityA reference book, an SDK, a mod loader, a graphics mod and a menu mod for the Gamebryo racing game, and a rebuild in development.
CrossFireOpenCF, a site and app for players' profiles, weapons and items, and an asset viewer and engine reference in development.
GunZ: The DuelA graphics overlay for GunZ Legacy.
Gearhead GarageThe 1999 car-repair game, rebuilt for Windows and Android.
Original gamesGames of our own, on engines of our own.

Encyclopedias

Reference books written from each game's own files and executable. Four are finished; two are being written chapter by chapter, and those link to their row on the game's page.

MWEncyclopediaNeed for Speed: Most Wanted. 78 chapters on the game's formats, data, runtime classes and systems, from a chunk header to the running game.
SAEncyclopediaGrand Theft Auto: San Andreas. 55 chapters, with 297 verified struct schemas and 2,003 fields recovered by disassembly.
HnREncyclopediaThe Simpsons: Hit & Run. 51 chapters on Hit & Run's file formats, data, classes and systems, with the raw data as JSON.
DC-EncyclopediaDrift City. 46 chapters on Drift City's Gamebryo formats, data tables, class model and systems.
SFEncyclopediaSoldier Front, in development. A byte-level and runtime-level reference for Soldier Front 1, written chapter by chapter as evidence lands, every claim tagged verified or reasoned.
CFEncyclopediaCrossFire, in development. An engine-level reference for CrossFire on LithTech Jupiter EX: the archive and asset formats, the content catalogue down to individual rows, and the 45,089-message string table. Rolling out chapter by chapter.

For the web

Sites a community can run on its own server, in PHP with no framework.

PrismA self-hosted community watchdog platform: a searchable public record, a social layer and a help desk.
VanillaTicketsA standalone help desk: knowledge base, ticket form, public ticket lookup and an admin queue.
VanTrackerA self-hosted bug tracker with tags, attachments, votes, roles, Discord sign-in and a JSON API.

House rules

These apply to every repository, so someone who has worked on one project already knows how the next is built.