← blog ·

Wardawg

#reversing

notes from a month of reading wardogs from the outside: where the documented layouts were wrong, how the terrain is stored, what 29 mortar shells taught me about fitting data, who really decides what a bullet hits, and rebuilding the maps in 3d.

wardogs is an unreal engine 5 game built with large world coordinates. everything here was done externally and read-only: no injection, nothing loaded into the process, just reads and a lot of checking. the offsets are from the september 2026 builds and have moved since, so treat them as a record of the method rather than something to paste.

the base address that pointed at nothing

every tool starts by asking where the main module is loaded. this one answers instantly with 0x21F00000000. page-aligned, userland, plausible. and unreadable: nothing is mapped there.

template <typename T>
bool read(uintptr_t address, T& out) {
    return mem.read(address, &out, sizeof(T));   // false on failure, never a guess
}

uintptr_t base = mem.module_base("WardogsClient-Win64-Shipping.exe");
uint16_t  mz   = 0;
if (!read(base, mz) || mz != 0x5A4D)
    base = read_ptr(peb + 0x10);                 // ImageBaseAddress - the real one

the real base is in the peb, and the header there carries the exact on-disk SizeOfImage (0xDF3D000 on that build). the module list returns the same bogus value, so it's not one api misbehaving.

the file on disk is no help either. every section measures entropy 8.00 and only the pe header is plaintext, so there is no offline signature scanning. the code only exists in the running process.

finding the globals without a file to scan

with no file to disassemble, the globals are resolved in three steps, cheapest first:

  • a stored offset from the last session, proven before use (the world's class has to decode to the name World)
  • signatures run against the live image
  • a search of .data for a pointer to an object whose class is named World

the last one took 43 seconds through a relay, so it's a fallback, not a plan. two things made this easier than expected:

  • after a patch, every .data global moved by the same constant. +0x30680 one week, +0x6180 the next. find one and you have them all
  • the reflected field offsets didn't move at all across those patches. only the globals and the hand-found fields needed re-checking

an address that looks plausible is worse than one that crashes. a crash tells you immediately.

the layout everyone agrees on

the global object array is one of the most documented structures in the engine. chunked array, 64k items per chunk, and each item starts with the object pointer.

not here. the item is 24 bytes with an 8-byte field in front of the pointer, so reading the documented offset returns values like 0x4000000000000000. not null, not a pointer, and nothing crashes.

offset field note
0x00 (unknown, 8 bytes) not in stock ue5
0x08 UObject* stock puts this at 0x00
0x10 flags / serial

with that fixed, a full census was 551,000 objects, each with its class and name.

the same build has UStruct shifted 0x10 past what the public sdk dump says: Children at 0x48, ChildProperties at 0x50, the script bytes at 0x60. the dump was generated against stock headers and nobody had walked a struct by hand to check.

the camera was the third one. posted layouts for the cached view put rotation at 0x0C and fov at 0x18. those are for a float build. with large world coordinates the vectors are doubles:

offset field type
0x00 location 3 x double
0x18 rotation 3 x double
0x30 fov float

where the ground is

this was the part i expected to be impossible externally, and it turned out to be the most satisfying.

the map uses world partition, so the landscape isn't one object. each cell is an ALandscapeStreamingProxy in its own level. my first probe read the first 64 levels and found a handful of far-away cells. the world had about 1,200.

each proxy holds a collision component, and behind that is a chaos heightfield. none of it is reflected, so it was found by reading memory next to things that were:

offset field value seen
0x20 heights TArray<uint16>, rows x cols
0x50 scale (200, 200, 7.03125)
0x80 min value float
0x90 / 0x92 rows / cols 511 / 511
0xA0 height per unit float
def ground_z(hf, comp_z, row, col):
    h = hf.heights[row * hf.cols + col]          # col runs along X
    return (hf.min_value + h * hf.height_per_unit) * hf.scale_z + comp_z

checked against structures standing on the ground, it was within 0.4 m. two things bit me afterwards:

  • on the second map a proxy holds four collision components (256 x 256 quarter-cells, different z scale). reading only the first gave a quarter of the ground
  • freed proxies linger in the level arrays with garbage row counts. sanity-check the dimensions before trusting the pointer

29 shells

the mortar has no fixed muzzle velocity. the weapon stats say TypicalSpeed = -1 and the game solves the speed per shot, so you can't integrate a trajectory. what it does have is a range table on a data asset: a key, an impact distance and a flight time per row.

the question was how the tube's pitch maps to that key. three recorded landings suggested key = 18 x pitch - 36, good to about 3 m on those three. then i recorded 29.

model rms error
18 x pitch - 36, symmetric descent 11.6 m
17 x pitch - 36, descent 16 degrees steeper than launch 3.0 m

the slope was slightly off, but most of the error was the landing-height correction: i'd assumed the shell comes down at the angle it went up. with drag it comes down much steeper. three points can't show you that. the fit only looked right because there was nothing to disagree with it.

the self-propelled howitzer was worse: its range table isn't monotonic. range climbs from 600 m to 2,600 m and back down to 700 m across the keys, low arc and high arc in one curve. any reader that assumes "bigger key, shorter range" silently picks the wrong row.

who decides what a bullet hits

this is the finding i'd actually call a security result rather than a layout curiosity.

bullets in wardogs are simulated on the shooter's client. a world subsystem keeps every live round in an array (position, velocity, spawn point, flight time), the client steps them, decides what they hit, and then tells the server. i watched 33 rounds in the firing range to confirm it: each one appears in the array the tick it's fired and its fields advance exactly as a local integrator would.

that puts the trust boundary in the wrong place. the server is told about a hit instead of computing one, so everything upstream of that message is the client's word. i'm not publishing the layout of the round or anything about what the server does and doesn't re-check, because that part is the exploit. the general lesson stands on its own: if the client owns the simulation, validation has to re-derive the shot, not sanity-check the result.

the part worth writing down is the math, because predicting where a round goes is the same problem whether you're building an aim trainer, a ballistics overlay or a server-side validator.

for a target at p moving at v, a muzzle at o and a round of speed s, the flight time t satisfies

| p + v*t - o | = s * t

which is a quadratic in t. take the smallest positive root, then aim at where the target will be, raised by however far the round falls in that time:

def solve_aim(o, p, v, s, g=981.0):               # cm, cm/s, cm/s^2
    d = p - o
    a = dot(v, v) - s * s
    b = 2.0 * dot(d, v)
    c = dot(d, d)
    disc = b * b - 4.0 * a * c
    if disc < 0.0:
        return None                               # target outruns the round
    t = min(x for x in ((-b - sqrt(disc)) / (2 * a),
                        (-b + sqrt(disc)) / (2 * a)) if x > 0.0)
    aim = p + v * t                               # lead
    aim.z += 0.5 * g * t * t                      # drop, added back
    return normalize(aim - o), t

that's exact in a vacuum. for rifle rounds over a few hundred metres it's close enough. for artillery it isn't, and that's where the measurements came in. the howitzer's shell is an actor the camera follows, so its whole path can be recorded. fitting that path gave:

quantity value
gravity 981 cm/s²
drag k(v) = 3.71e-6 + 6.0e-11 * v per cm, quadratic in speed
muzzle speed at 33° ~297 m/s (solved per shot, varies with elevation)
descent angle at 2.5 km ~55°

with drag there's no closed form, so the solve becomes: guess t from the vacuum answer, integrate the round forward with the drag model, measure the miss, correct, repeat. three or four passes converge.

the defibrillator

same class of problem, smaller scale. the defibrillator revives a downed teammate or shocks an enemy in front of you. reading the item's blueprint showed the whole decision is made in a chain of client-side functions:

  • gather the characters inside a box in front of the player
  • filter that list down to one
  • check line of sight to that one
  • revive it if it's a downed teammate, damage it otherwise

the box size, the reach and the charge time all come from a shared data asset, and the line of sight test is blueprint bytecode. the client then asks the server to act on the actor it picked. whether the server re-checks reach and line of sight for itself is the one thing i haven't established, and it's the only thing that matters. again, no offsets here on purpose.

the interesting part was a bug in my own understanding. i assumed the filter picked the character nearest the crosshair. it doesn't. with a wider gather box, the game's filter chose a standing teammate near the line over the downed one being looked at, and shocked him. the selection rule isn't "what you're aiming at", it's "first acceptable entry in the gathered list". the only way i found that out was by being wrong about it in a match.

reading the function list tells you what a system can do. it doesn't tell you which of two valid targets it prefers.

rebuilding the map in 3d

the last piece was a 3d view of each map for a browser radar, built from the game's own pak files rather than from memory.

the pipeline: export a world's actors and their static meshes from the paks, then write four binary files per map (terrain, unique meshes, instance transforms, trees) plus a ground texture, and draw them with three.js.

things that weren't obvious:

  • trees have trunk-only collision. export the collision mesh and you get a forest of poles. the canopy size is in the mesh name (..._10mCanopy_...), so trees are drawn as instanced cones and blobs sized from the name
  • the ground texture is tiles. the highest-detail tiles are stitched into one 4096 px image per map. where two separate tile textures meet you get a visible seam, and the cause isn't the mapping (i checked, it's correct): bilinear filtering clamps at each texture's own edge. the fix is to export each tile with a 1-2 px border copied from its neighbours
  • instancing is everything. a map is a few thousand unique meshes placed tens of thousands of times. storing each mesh once plus a transform per placement is the difference between ~40 mb and unusable
  • the engine's "last rendered" time is per bounding box. it's fine for buildings and useless for crates, which is why occlusion ended up as a bvh of small props only. a building's box is a solid brick with no doors; feed it to the bvh and everyone behind a window reads as hidden

brave KpnNQL3nif one map rebuilt from the pak files: terrain, instanced buildings, and trees drawn from their names

the object that came back from the dead

to stay fast i keep a table of addresses already classified. then a structure finished building mid-match and never appeared.

the placement stage and the finished structure are two objects. the game freed the first and allocated the second at the same address, and my table said "seen it" for 60 seconds.

// before: identity = where it is
if (seen.contains(addr)) return;

// after: where it is AND what is there now
uint64_t id = hash(addr, read_ptr(addr + 0x10), read_u32(addr + 0x18));   // class, name number
if (seen.contains(id)) return;

and the one where i lied to myself

structures never worked. across every version, the class-name test never matched once, and i spent days suspecting the layout.

the bug was my own lowercase helper. it decoded a plain byte string as wide text, so every substring test downstream compared against garbage.

// wrong: ascii bytes read as utf-16
std::string s = wide_to_string(bytes);

// right: one byte, one character
std::string s;
for (uint8_t b : bytes) s += static_cast<char>(std::tolower(b));

a few things i learned:

  • verify an address by reading through it, never by how it looks
  • a public dump is a hypothesis. three of the layouts above were "known" and wrong for this build
  • cache identity, not location
  • three data points will agree with almost any model. record until something disagrees
  • when a feature has never worked, suspect your own helpers before the target

that's it for now. next time: getting occlusion right when the engine's own "last rendered" time only works per bounding box.