dtx_ref.pyDecodes a LithTech DTX texture — 32-bit BGRA or DXT1/3/5 — and writes a 24-bit BMP you can open anywhere.
Verified · observer_C4.DTX → the exact 32×32 C4 HUD icon
New OpenedCF is out: TeamVanilla’s free Windows viewer that opens CrossFire’s maps, weapons and characters in 3D, straight from your own install. See OpenedCF
CFireSDK and the CrossFire Encyclopedia document how CrossFire’s own files and client are built — its formats, its recovered class model, and how the game draws, loads and talks over the network. It exists for learning, preservation and security research.
TeamVanilla does not make, endorse or teach cheats, and none of this is meant for use against other players or any live service. By continuing you acknowledge you are here to study how the game works, on your own installed copy.
For developers · from TeamVanilla
A C++ library for reading CrossFire’s own files — archives, textures, models, maps and the data tables the game runs on — plus the class model and runtime facts recovered from the game itself. It is what OpenedCF and this site are built on.
The files on disk. Header-only readers for CrossFire’s own formats — archives, textures, models, worlds and the content tables — plus the class model and table schema recovered by static analysis of the game’s binaries. This half works entirely offline, on your own install.
The game as it runs. A layer of constants recovered from a live client: the Direct3D 9 draw path, the vertex formats, the network protocol, the module map and the timing windows, together with what was learned about which hooks are safe and which crash the game. These are observed facts, published as data. They came from hooking and instrumenting a running client during our own diagnostics — work written up in full in the CrossFire Encyclopedia. The headers carry what that work found; what you do with it is your own.
| Header | What it reads | Status |
|---|---|---|
core.hpp | Result and error types, and a bounds-checked little-endian byte reader every other part is built on | Stable |
geometry.hpp | Vectors, quaternions, 4×4 matrices and bounding boxes, with the camera and 3×4 bind-matrix helpers the model and world code use | Stable |
formats.hpp | The on-disk format constants and the helpers that identify a file from its first bytes | Stable |
rez.hpp | REZ archives: open one, list it, pull a file out — including the directory cipher that unlocks the packed RF archives | Works |
dtx.hpp · image.hpp | DTX textures (DXT1, DXT3, DXT5 or 32-bit) to plain RGBA, and a BMP writer so you can see the result | Works |
ltb.hpp | LithTech models: meshes, the bind-pose skeleton and animation names (LZMA decode built in with liblzma) | Meshes work |
world.hpp | LithTech worlds (.DAT): the container, its sections, and the objects placed in it — spawns, weapon-spots, flags, doors, lights | Objects work |
content.hpp | The scripts (.ENC/.nut) and content tables (.CFT) the game is driven by, decrypted into records: weapons, skills, modes, AI | Works |
cf_generated.hpp | The recovered class model, the 139 content-table names and the symbol catalogue, generated from the SDK’s data files | Generated |
runtime.hpp | Constants recovered from a live client: D3D9 vtable slots, FVF codes, texture formats, the network protocol, the module map and hook timing | Constants |
One include brings in all of it: #include <cfsdk/cfsdk.hpp>. Every call returns a checked result and never throws — a truncated file is an error, not a crash. The one piece still being worked out is the baked render mesh inside a world file; its container and placed objects already read.
#include <cfsdk/cfsdk.hpp> // one include brings in everything
// Decode a texture you have on disk and write it out as a picture.
cfsdk::Image img;
if (cfsdk::dtx_load("observer_C4.DTX", img))
img.write_bmp("c4.bmp"); // img.w x img.h
// Read a map's placed objects straight from the world file.
for (auto& o : cfsdk::world_read_objects("EM_ALASKA.DAT"))
if (o.name.find("weaponspot") != std::string::npos)
/* o.x, o.y, o.z */;
// The recovered model is plain constants, checked when you compile.
static_assert(cfsdk::kContentTableCount == 139);
auto weapons = cfsdk::ContentTable::ADDWEAPON;cmake -S . -B build
cmake --build build
build/dtx2bmp observer_C4.DTX c4.bmp # a texture as a picture
build/datinfo EM_ALASKA.DAT # a map's sections
build/ltb2obj model.ltb model.obj # a model for any 3D program
build/rezls engine.rez # what an archive holdsNames in the sample follow the SDK’s headers. The function guide that ships with it lists every call.
Every reader has a small Python twin in tools/ that needs no compiler. Each was run against real game files and its result checked by eye before the C++ was written — so what the SDK claims to read, it has read. They are handy on their own, too.
dtx_ref.pyDecodes a LithTech DTX texture — 32-bit BGRA or DXT1/3/5 — and writes a 24-bit BMP you can open anywhere.
Verified · observer_C4.DTX → the exact 32×32 C4 HUD icon
ltb_ref.pyDecompresses an .ltb (LZMA) to the LithTech Model v9 binary and lists its name table: pieces, nodes and sockets like “l_body”.
Verified · container + skeleton names confirmed
ltb_to_obj.pyFinds each mesh’s vertex and index buffers by their 32-byte signature and writes a Wavefront OBJ any 3D program opens.
Verified · “Box004” → 28 verts, 12 tris, a closed box
dat_ref.pyReads a world .DAT (version 85) and dumps its six-section map, every offset in-bounds and in order.
Verified · verified across all 194 maps
dat_points.pyPulls the WorldModel points out of the leading region and writes the vertices as an OBJ cloud.
dat_geometry.pyMaps the world’s collision/PVS BSP — the plane and point arrays and the topology laid out between them.
Verified · first planes and points match the map’s bounding box, every map
cf_cft.pyDecodes a .CFT table — LZMA, then XOR, then fixed-width columns — to text or CSV, header row and all.
cf_msz.pyResolves the message tables the UI points at by id, turning MSG numbers back into the strings players read.
Verified · id 1 = “%s - Select Channel”
clientfx_ref.pyParses the ClientFX index into every client effect — muzzle flashes, tracers, explosions, buff auras — and its group tree.
rez_ref.pyLists an unencrypted RezMgr .rez archive — the reference reader the C++ mirrors.
Verified · engine.rez → CONSOLE_FONT and the rest
cf_rez_index.pyDecrypts the encrypted RF archive directories with the recovered cipher and lists every packed file by name.
cf_rez_inventory.pyLabels every numbered RF archive by its contents, so “RF016” reads as “weapon and character models”.
gen_sdk.pyTurns the recovered catalogues in data/ into the generated header, baking the counts in as compile-time checks.
The class model and table schema are shipped as plain files in data/, so you can search, diff and build against them without the headers. gen_sdk.py turns these into the generated header; re-run the static pass on a new build, regenerate, and the compile-time counts catch anything that drifted.
classes.csv · classes.json705 recovered RTTI classes, with the binary each came fromclass_catalogue.jsonThe same classes grouped: engine, game tables, bindingscontent_tables.csv · content_tables.json139 content tables, categorized, with what references eachcf_symbols.jsonThe recovered function and symbol cataloguemessages_us.jsonThe game’s message table: every on-screen string by idCrossFire is table-driven: weapons, characters, maps and modes are rows in 139 content tables, read by 705 classes in the engine and game code. The SDK carries the names of all of them, and where each class keeps its fields — 2,392 offsets across 541 classes. When a new game build comes out, the data is read again and the headers are regenerated; if anything moved, the build stops and says so.
The same model is written up in plain words in the Encyclopedia, starting at Game files.
These are compile-time constants in runtime.hpp, recovered from a single live client session. They describe how the game draws, talks and loads. Nothing here runs anything.
Eleven device vtable slots were confirmed in use. The catch worth knowing: CrossFire streams all its geometry through the user-pointer draw calls — DrawPrimitiveUP (slot 83) and DrawIndexedPrimitiveUP (slot 84). The plain DrawPrimitive (81) and DrawIndexedPrimitive (82) exist but are never called, so anything that watches only those sees zero draws. Steady state in the lobby runs ~86 draw calls and ~172 primitives a frame at ~240 FPS.
BeginScene41EndScene42DrawPrimitive81DrawIndexedPrimitive82DrawPrimitiveUP83DrawIndexedPrimitiveUP84SetTexture65SetRenderState57CreateTexture23CreateVertexBuffer26CreateIndexBuffer27fvf::kBasic | XYZ + Normal + 1 tex — terrain and static props | stride 16 |
fvf::kDiffuse | + diffuse colour — vertex-coloured geometry | stride 20 |
fvf::kSpecular | + specular — character and weapon meshes | stride 24 |
fvf::kFull | + diffuse + specular — environment and map geometry | stride 40 |
texfmt | DXT1 (opaque), DXT5 (alpha), X8R8G8B8 and R5G6B5 render targets, INDEX16 | — |
mem | ~227 MB executable, ~49 MB writable at launch | — |
| Auth / world ports | Login on 13008, game world on 10009; three NA endpoints | — |
| Packet framing | Start byte 0xF1, end byte 0xF2 | — |
| Opcodes | Login 0x01F4, heartbeat 0x0009, world state 0x4C3C | — |
| CEF / lobby | Lobby origin crossfire.z8games.com, with the full connect-src allowlist; blob Workers are blocked by CSP | — |
The module map (nine key modules with their observed bases) notes that the proxy dinput8.dll, not the system one, is the vtable to hook, and that BugTrap-x64.dll sits at a fixed base to watch for collisions.
We recovered the constants above by hooking a running client ourselves, and in doing so learned which hooks hold and which bring the game down. This is that record — the methodology, for study and for anyone researching how the engine behaves. It is knowledge, not a cheat: it points at no one else’s game and ships no injector of its own.
| Target | Hook type | Result |
|---|---|---|
| D3D9 device vtable | VTable | Safe (11/11) — one COM object, no system-wide effect |
| ws2_32 Winsock calls | Trampoline | Safe (8/8) — leaf API: send/recv/connect/closesocket… |
| System observation | None — scanning | Safe — read-only Win32 queries (EnumProcessModules, VirtualQuery) |
| kernel32 functions | Trampoline | Crashes — patches the loader/CRT, game fails at startup |
| IAT without a module name | IAT | Silent fail — installs without error, detour never called |
| Window | Deadline | What fires |
|---|---|---|
| Winsock | T+1.3s | Winsock hooks must be live before the first connect() to the auth server |
| D3D9 vtable | T+33s | The D3D9 device is created lazily, after login — install vtable hooks here |
| Geometry burst | T+35s | The vertex/index buffer allocation storm begins |
| Login | T+57s | The first login packet is sent |
| World | T+117s | The game world connection is established |
CFireSDK is read-only and header-only: the file readers run on your own installed copy of CrossFire and ship none of the game’s content. The runtime layer is observed data — recovered by capturing a live client and written up in full in the CrossFire Encyclopedia. That research reaches into how the game draws, loads and communicates, and it shows the client can be hooked and instrumented; the constants and findings here are what came out of it.
We publish all of it for one reason: to understand and preserve how CrossFire is built. TeamVanilla does not make, endorse or teach cheats, and nothing here is for use against other players or any live service. What you do with this knowledge is yours, and yours to be responsible for. If you build something in that spirit, we would like to see it: show us on Discord.