# DataDome plv3: reverse engineering the VM behind the token

> DataDome's plv3 runs a VM whose opcode table does not exist until the bytecode is already running. Here is the disassembler, and what it measures about you.

- Author: glizzykingdreko
- Published: 2026-07-28
- Tags: datadome, plv3, virtual-machine, disassembler, reverse-engineering, bytecode, anti-bot
- URL: https://takionapi.tech/blog/datadome-plv3-vm-disassembler

---

Let's walk through the virtual machine behind DataDome's **plv3 token**, the one running on both the interstitial and the captcha, and build a disassembler for it. The interesting part is not that they wrote a VM, everybody writes a VM. It is that their opcode table does not exist until the bytecode has already started running.
  
Everything here is reproducible with [the tool in this repo](https://github.com/glizzykingdreko/datadome-plv3-vm-disassembler), verified against 6 different bundles across both challenge types.

- [Check the source](https://github.com/glizzykingdreko/datadome-plv3-vm-disassembler)
- [Start bypassing DataDome](https://takionapi.tech/trial)

## What a VM is, and why they use one

### First, what a VM actually is

You can skip this if you already know VMs. If you have only ever seen "the code is obfuscated" and not "the code is a VM", this part makes everything below make sense.

Normal JavaScript is executed by your browser's engine. You write `a + b`, V8 compiles it, the CPU runs it. If I want to know what your script does, I read the script.

A **virtual machine** inserts a layer. Instead of shipping the logic as JavaScript, you ship:

1. **An interpreter**, a small piece of real JavaScript that knows how to execute a made-up instruction set
2. **Bytecode**, a blob of bytes that means nothing on its own, encoding the actual logic in that made-up instruction set

The interpreter loops: read a byte, decide what it means, do it, move to the next byte. That loop is the **dispatch loop**, and the byte it reads is an **opcode**.

<figure>
<svg viewBox="0 0 580 245" role="img" aria-label="The dispatch loop: the interpreter reads an opcode byte, looks up a handler, runs it against the stack and registers, then advances the program counter and repeats." style="max-width:100%;height:auto;color:inherit">
  <defs><marker id="a1" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse"><path d="M0,0 L10,5 L0,10 z" fill="currentColor"/></marker></defs>
  <text x="0" y="14" font-size="12" fill="currentColor" opacity="0.7">bytecode</text>
  <g stroke="currentColor" fill="none" stroke-width="1">
    <rect x="0" y="24" width="46" height="30"/><rect x="46" y="24" width="46" height="30"/>
    <rect x="92" y="24" width="46" height="30"/><rect x="138" y="24" width="46" height="30"/>
    <rect x="184" y="24" width="46" height="30"/><rect x="230" y="24" width="46" height="30"/>
  </g>
  <g font-size="12" fill="currentColor" text-anchor="middle" font-family="monospace">
    <text x="23" y="44">57</text><text x="69" y="44">86</text><text x="115" y="44">00</text>
    <text x="161" y="44">54</text><text x="207" y="44">2f</text><text x="253" y="44">c1</text>
  </g>
  <polyline points="69,60 69,80" stroke="#f59e0b" stroke-width="2" fill="none" marker-end="url(#a1)"/>
  <text x="80" y="76" font-size="11" fill="#f59e0b">pc</text>
  <g stroke="currentColor" fill="none" stroke-width="1.2">
    <rect x="20" y="88" width="120" height="38" rx="4"/>
    <rect x="190" y="88" width="140" height="38" rx="4"/>
    <rect x="380" y="88" width="140" height="38" rx="4"/>
  </g>
  <g font-size="12" fill="currentColor" text-anchor="middle">
    <text x="80" y="112">fetch opcode</text>
    <text x="260" y="112">look up handler</text>
    <text x="450" y="112">run it</text>
  </g>
  <g stroke="currentColor" fill="none" stroke-width="1.2" marker-end="url(#a1)">
    <line x1="140" y1="107" x2="186" y2="107"/>
    <line x1="330" y1="107" x2="376" y2="107"/>
  </g>
  <polyline points="520,107 560,107 560,160 80,160 80,130" stroke="currentColor" stroke-width="1.2"
            fill="none" marker-end="url(#a1)" stroke-dasharray="4 3"/>
  <text x="300" y="176" font-size="11" fill="currentColor" text-anchor="middle" opacity="0.75">advance pc, repeat</text>
  <g stroke="currentColor" fill="none" stroke-width="1" opacity="0.75">
    <rect x="380" y="196" width="140" height="34" rx="4"/>
  </g>
  <text x="450" y="217" font-size="12" fill="currentColor" text-anchor="middle" opacity="0.85">stack + registers</text>
  <line x1="450" y1="130" x2="450" y2="192" stroke="currentColor" stroke-width="1.2" fill="none"
        marker-end="url(#a1)" opacity="0.75"/>
  <text x="462" y="148" font-size="11" fill="currentColor" opacity="0.75">reads / writes</text>
</svg>
<figcaption>One opcode byte per turn. The handler does the work, the loop advances, and nothing about the guest program is visible in the interpreter itself.</figcaption>
</figure>

Here is a toy version in 20 lines:

```js
function run(bytecode) {
  const stack = [];
  let pc = 0;                                     // program counter
  while (pc < bytecode.length) {
    const op = bytecode[pc++];                    // fetch
    switch (op) {                                 // decode
      case 1: stack.push(bytecode[pc++]); break;  // PUSH <imm>
      case 2: stack.push(stack.pop() + stack.pop()); break;  // ADD
      case 3: console.log(stack.pop()); break;    // PRINT
      case 4: return;                             // HALT
    }
  }
}

run([1, 2, 1, 3, 2, 3, 4]);   // push 2, push 3, add, print -> 5
```

`[1, 2, 1, 3, 2, 3, 4]` is the whole program. You cannot read it. There is no `+` anywhere, no `console.log` call you can breakpoint, no function names, no control flow you can follow in a debugger. The logic is *data* now, and data does not show up in a stack trace.

That is the entire point. The interpreter is visible and boring, the interesting part is in a byte array, and to understand the byte array you first have to understand the interpreter well enough to decode it. That work is called **writing a disassembler**: recovering, for each opcode byte, what it does and how many operand bytes follow it, so a blob of numbers turns back into a listing you can read.

The vocabulary that comes up below, in one place:

| term | meaning |
|---|---|
| bytecode | the byte array holding the program |
| opcode | one byte that selects an operation |
| operand | bytes following an opcode that parametrise it, like the `2` in `PUSH 2` |
| program counter (PC) | index of the next byte to read |
| stack | where values live between operations |
| accumulator | a single scratch register, often where results land |
| dispatch loop | the fetch, decode, execute cycle |
| handler | the code implementing one opcode |
| disassembler | tool that turns bytecode back into readable instructions |

Every one of those exists in DataDome's VM. The twist is where the handlers come from.

### Why anti-bot vendors like them

Three reasons, and they are good ones.

**Reading is expensive.** Deobfuscating a bundle doesn't get you the logic, just the interpreter. You have done maybe 10% of the work at the point where normally you would be done.

**Debuggers stop helping.** Every operation runs through the same lines. A breakpoint in the dispatch loop hits millions of times and tells you nothing about which *guest* operation you are in.

**The instruction set is a knob they own.** They can shuffle opcode numbers, change operand widths, add instructions, and it costs them a rebuild while it costs you a rewrite of your tooling.

The counterweight is that a VM has to be able to build itself before it can run. Follow that construction path and it hands you the pieces in order, which is exactly what the rest of this article does.

## How this VM is put together

### The file that got smaller

The `vm-obf.js` module inside a DataDome challenge used to be a standard obfuscated VM. Around 614 lines after running it through [my deobfuscator](https://github.com/glizzykingdreko/new-datadome-deobfuscator), with a big dispatch switch and an opcode table you could read straight out of the JavaScript. Annoying, but a known quantity.

Then it shrank. Same job, 163 lines. Sorting my bundle collection by date makes the switch obvious:

| bundles | lines | `new Function` | dispatch |
|---|---|---|---|
| older | 613, 614, 734 | no | static opcode table in the JS |
| current | 162, 163, 206 | yes | thread-of-code, table built at runtime |

A file getting **four times smaller** while doing the same work is usually good news for whoever has to read it. Not this time. The old bundle was bigger because it *contained* its instruction set. The new one is small because it moved that instruction set into the payload, and it is a different instruction set in every build.

So the opcode table you carefully document on Monday is worth nothing on Tuesday. That is the actual upgrade, and it is a smart one.

### Anatomy of the loader

Deobfuscated, the whole thing is six pieces:

| piece | lines | job |
|---|---|---|
| const block | 1 to 9 | register offsets and buffer geometry |
| `o()` | 10 to 16 | xorshift LCG byte generator |
| `s(A)` | 17 to 57 | tagged-value reader, 9 tags plus a small-int fast path |
| `c(A,g,C)` | 58 to 87 | string cipher |
| `M(A,B)` | 88 to 139 | initializer, fills the primitive table, installs MAKE_FUNC |
| entry | 140 to 163 | base64 blob to flat buffer, then the dispatch loop |

The entry is where a disassembler gets its footing:

```js
const Q = function (A) {
  const g = o();
  return Array.from({ length: 209725 }, (Q, D) =>
    D >= C && D < C + B ? A.charCodeAt(D - C) : g());
}(atob(A));
```

Three important things there: the flat buffer is **209725 bytes**, the bytecode sits at offset `C`, and it is `B` bytes long. Everything outside that window is LCG filler.

Every concrete number in this walkthrough comes from one bundle, `interstitial-e813eb1`. They all rotate per build, so the sample bundle in the repo prints its own set. [The rotation surface](#the-rotation-surface) at the end has the table.

<figure>
<svg viewBox="0 0 700 220" role="img" aria-label="The flat buffer: LCG filler below the bytecode holds the registers, the bytecode window sits between offsets C and C plus B, and the filler above it is the entropy the handlers read." style="max-width:100%;height:auto;color:inherit">
  <defs><marker id="a2" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse"><path d="M0,0 L10,5 L0,10 z" fill="currentColor"/></marker></defs>
  <rect x="0" y="60" width="150" height="46" fill="none" stroke="currentColor" stroke-width="1"/>
  <rect x="150" y="60" width="330" height="46" fill="none" stroke="#f59e0b" stroke-width="2"/>
  <rect x="480" y="60" width="220" height="46" fill="none" stroke="currentColor" stroke-width="1"/>
  <g font-size="12" fill="currentColor" text-anchor="middle">
    <text x="75" y="88">LCG filler</text>
    <text x="590" y="88">LCG filler</text>
  </g>
  <text x="315" y="88" font-size="12" fill="#f59e0b" text-anchor="middle" font-family="monospace">bytecode, B bytes</text>
  <g font-size="11" fill="currentColor" font-family="monospace" opacity="0.8">
    <text x="0" y="52">0</text>
    <text x="150" y="52" text-anchor="middle">C = 4624</text>
    <text x="480" y="52" text-anchor="middle">C+B = 203734</text>
    <text x="700" y="52" text-anchor="end">209725</text>
  </g>
  <line x1="75" y1="130" x2="75" y2="110" stroke="currentColor" stroke-width="1.2" marker-end="url(#a2)"/>
  <text x="75" y="148" font-size="12" fill="currentColor" text-anchor="middle">registers live here</text>
  <line x1="590" y1="130" x2="590" y2="110" stroke="currentColor" stroke-width="1.2" marker-end="url(#a2)"/>
  <text x="590" y="148" font-size="12" fill="currentColor" text-anchor="middle">handlers read entropy here</text>
  <line x1="243" y1="34" x2="243" y2="56" stroke="#f59e0b" stroke-width="2" marker-end="url(#a2)"/>
  <text x="243" y="24" font-size="11" fill="#f59e0b" text-anchor="middle" font-family="monospace">entry 11405</text>
  <text x="350" y="184" font-size="12" fill="currentColor" text-anchor="middle" opacity="0.85">
    Zero the filler instead of generating it and the VM still runs, with the wrong answer.
  </text>
</svg>
<figcaption>The bytecode is a window inside a much larger buffer. Both sides of it are load-bearing, which is why the LCG has to be reproduced rather than padded.</figcaption>
</figure>

That filler is not padding. The registers live *below* the bytecode and handlers read entropy from *above* it, so if you rebuild the buffer with zeros instead you get a VM that runs and produces the wrong answer, which is the worst possible failure mode. The generator is 6 lines:

```js
function o() {
  let A = 2078235825, g = 0;
  return function () {
    return 3 & g++ || (A ^= A << 13, A ^= A >> 17, A ^= A << 5),
      (A >> ((3 & g) << 3)) % 256;
  };
}
```

Seed, xorshift 13/17/5, and a rotation through the four bytes of the state so one state advance yields four output bytes. Port it exactly, including the counter increment happening before the shift, or your buffer diverges a few thousand bytes in.

Because that `charCodeAt` is the only one in the file, it makes a perfect anchor. My loader finds it, reads the window guard next to it, resolves the identifiers through the const block, and never once looks up a name it was told to expect.

The const block deserves a note. The interstitial declares one block of plain integers. The captcha declares **three**, and computes half of them off each other:

```js
var c = 790629505, D = 3492, w = 10600, B = D + 114, Q = B + 348,
    I = D - 1, J = 194136, Y = Q + J, M = D + 16, ...;
var s = 116, a = 111, P = 67, z = 53, y = 62, ...;          // value tags
var l = 31, H = 11, X = 34, k = 24, j = 0, ..., AA = 182;   // primitive slots
```

So the evaluator has to be a tiny expression system with multiple passes, not a regex for integer literals. Fun detail: the captcha names its tag bytes and primitive slot IDs as constants while the interstitial inlines them. Two different compiler settings for the same VM.

### There is no switch

Here is the entire dispatch loop:

```js
const s = Q[C + Q[D]++], c = g + s;
for (Q[I] = Q[c], Q[4222] = s; !Q[w] && P++ < 1e8;) Q[I]();
```

Compare that to the toy loop earlier. Same fetch, decode, execute, except decode is not a `switch`, it is an array index. Read a byte, index a table of closures with it, keep calling whatever is in `Q[I]`. Every handler ends by calling `NEXT`, which reads the following byte and swaps in the next closure. That structure has a name, **thread-of-code**, and it means there is no jump table you can point at.

Registers are just offsets in the same flat buffer:

| offset | role |
|---|---|
| 4221 | program counter |
| 4158 | stack pointer |
| 4182 | accumulator |
| 4190 | current handler |
| 4196 | halt flag |
| 4322 | base of the 256-entry function slot table |
| 4624 | first byte of bytecode |
| -1 | reported separately, see [the tripwires](#the-two-tripwires) |

Yes, `-1`. In JavaScript that is just a property named `"-1"` on the array. Keep this in mind.

Note `P++ < 1e8` in the loop condition. `P` counts iterations, and it does not stay inside the VM. That matters later.

### MAKE_FUNC, or how the opcodes arrive

Walking the bytecode from byte 0 with the naive assumption that instructions start there gives you this:

```
57 86 00 00 54 "const n=arguments[0];n[34](86);const s=n[43](),t=n[32][n[36]];n[32][t-1]^=s,n[17]();"
```

That is not an instruction. That is a record:

```
[ 1B opcode 57 ][ 1B slot 86 ][ 3B length 0x000054 = 84 ][ 84 bytes of JavaScript ]
```

<figure>
<svg viewBox="0 0 700 260" role="img" aria-label="MAKE_FUNC records at the start of the bytecode each carry an opcode, a slot number, a length and a JavaScript body, which the VM compiles into the handler table before the real program begins." style="max-width:100%;height:auto;color:inherit">
  <defs><marker id="a3" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse"><path d="M0,0 L10,5 L0,10 z" fill="currentColor"/></marker></defs>
  <g stroke="currentColor" fill="none" stroke-width="1">
    <rect x="0" y="30" width="60" height="32"/><rect x="60" y="30" width="60" height="32"/>
    <rect x="120" y="30" width="80" height="32"/><rect x="200" y="30" width="230" height="32"/>
  </g>
  <g font-size="11" fill="currentColor" text-anchor="middle" font-family="monospace">
    <text x="30" y="50">op 57</text><text x="90" y="50">slot 86</text>
    <text x="160" y="50">len 84</text><text x="315" y="50">84 bytes of JavaScript</text>
  </g>
  <text x="0" y="20" font-size="12" fill="currentColor" opacity="0.7">one MAKE_FUNC record</text>
  <line x1="315" y1="66" x2="315" y2="96" stroke="#f59e0b" stroke-width="2" marker-end="url(#a3)"/>
  <text x="325" y="88" font-size="11" fill="#f59e0b" font-family="monospace">new Function(body)</text>
  <rect x="470" y="96" width="230" height="120" fill="none" stroke="currentColor" stroke-width="1.2" rx="4"/>
  <text x="585" y="90" font-size="12" fill="currentColor" text-anchor="middle">handler table</text>
  <g stroke="currentColor" fill="none" stroke-width="1" opacity="0.6">
    <line x1="470" y1="126" x2="700" y2="126"/><line x1="470" y1="156" x2="700" y2="156"/>
    <line x1="470" y1="186" x2="700" y2="186"/>
  </g>
  <g font-size="11" fill="currentColor" font-family="monospace" opacity="0.85">
    <text x="482" y="118">slot 0</text><text x="482" y="148">...</text>
    <text x="482" y="178">slot 86</text><text x="482" y="208">slot 165 = HALT</text>
  </g>
  <line x1="430" y1="110" x2="466" y2="172" stroke="#f59e0b" stroke-width="2" marker-end="url(#a3)"/>
  <text x="0" y="150" font-size="12" fill="currentColor">103 records,</text>
  <text x="0" y="168" font-size="12" fill="currentColor">back to back</text>
  <polyline points="0,182 0,206 430,206" stroke="currentColor" stroke-width="1.2" fill="none"
            stroke-dasharray="4 3" marker-end="url(#a3)"/>
  <text x="215" y="228" font-size="12" fill="currentColor" text-anchor="middle" opacity="0.85">
    chain ends at 11405, the real program starts
  </text>
</svg>
<figcaption>The opcode semantics ship inside the payload. Every bundle installs its own 103 handlers before executing a single instruction, so no hardcoded opcode table survives a rotation.</figcaption>
</figure>

And the handler installed at slot 57 does exactly what you would expect:

```js
A[4379] = function () {
  const B = M(),                                    // u8, target slot
    Q = o(),                                        // u24, source length
    P = String.fromCharCode.apply(null, /* slice Q bytes */),
    E = new Function(P);
  A[g + B] = E.bind(null, d), n();                  // install, bound to primitives
};
```

There are **103 of these records back to back**, occupying the first ~11 KB of every bundle I have looked at. Interstitial or captcha, every rotation, always 103. Then the chain stops and the real program begins.

The `.bind(null, d)` is the piece that makes the rest tractable. Every compiled handler receives the primitive table as `arguments[0]`, which is why they all open the same way:

```js
const n = arguments[0];
```

A handler cannot touch the DOM, cannot call a global, cannot do anything except index into `n`. That is a hard sandbox, and it means the vocabulary of the entire VM is about two dozen entries wide. Recover them and every one of the 103 bodies becomes readable.

Which, to be clear, they already are. This is the trade DataDome made: the opcode semantics are now **plaintext JavaScript** sitting in the payload, in exchange for the table being different every build. Anyone reading one bundle has an easier time than before. Anyone trying to write a static tool that survives the next push has a much harder time. Given how these things are usually attacked, that is the right call.

## Writing the disassembler

### Recovering the primitive table

The initializer is the only function containing `new Function`, so it is easy to locate, and the table it fills is named by the `.bind(null, X)` call. Then it is a matter of classifying two dozen or so assignments by shape:

```js
d[32] = A;                                            // the flat buffer
d[41] = B;                                            // the OUTPUT object, remember this one
d[14] = M;                                            // read u8 at PC
d[45] = function () { ... return A[D] = g + 2, B << 8 | Q; };    // read u16
d[49] = o;                                            // read u24
d[43] = function () { return s(() => A[C + A[D]++]); };          // tagged value
d[17] = n;                                            // NEXT
d[15] = function () { A[E] = A[--A[P]]; };            // pop to accumulator
d[44] = function (g) { A[A[P]++] = A[Q + g]; };       // push register
d[7]  = function (g) { A[Q + g] = A[A[P] - 1]; };     // store register
d[3]  = function () { ... A[A[P] - 1] = C[g]; };      // property get
d[50] = function () { ... A[--A[P]][g] = A[A[P] - 1]; };         // property set
d[23] = c;                                            // string cipher
d[34] = function (A) {};                              // telemetry no-op
```

Two traps in here, both of which cost me a debugging cycle.

**One:** several entries are references to named inner functions (`d[49] = o`), so you have to resolve the name to its body before classifying, otherwise you classify the string `"o"`.

**Two:** the string cipher reads a 4-byte header key, which means its body contains `<< 16` and `<< 8`, which means a naive "widest shift wins" classifier labels the cipher as the u24 reader. Check for the cipher first. Everything downstream depends on those five reader slots being right, since they are where operand widths come from.

The reward for getting it right is that the numbers below are all recovered, never assumed:

| bundle | u8 | u16 | u24 | typed | NEXT | mem | cipher |
|---|---|---|---|---|---|---|---|
| `interstitial-e813eb1` | 14 | 45 | 49 | 43 | 17 | 32 | 23 |
| `interstitial-fa96b7a` | 32 | 18 | 7 | 36 | 0 | 11 | 35 |
| `captcha-3f9a12d` | 22 | 49 | 35 | 38 | 12 | 31 | 36 |
| `captcha-d7aa843` | 24 | 0 | 15 | 7 | 5 | 33 | 12 |

### The value tags

Plenty of opcodes take an immediate that is not fixed width. One tag byte, then 0 to 8 payload bytes:

```js
function s(A) {
  let g = A();
  if (128 & g) return 127 & g;              // 7-bit small int, 1 byte total
  let C = 0, B = 24;
  switch (g) {
    case 55:  return !0;
    case 72:  return !1;
    case 34:  return null;
    case 64:  return;
    case 114: return <f64 decoder>(A);      // 8 payload bytes
    case 103: C |= A() << 24, B -= 8;       // i32, falls through
    case 94:  C |= A() << 16, B -= 8;       // i24, falls through
    case 62:  C |= A() << 8,  B -= 8;       // i16, falls through
    case 108: return C |= A(), C << B >> B; // i8, terminal
  }
}
```

The tag bytes rotate per bundle, so hardcoding `114 = float` is pointless. What does not rotate is the **fall-through chain**: the terminal integer arm reads one payload byte, the arm above it reads two, and so on up. Count the chain arms in source order and the widths fall out without knowing a single tag value. The boolean and null arms are 1 byte, the arm building an 8-element array is the float.

Nine tags in every bundle, plus the small-int fast path. By getting one width wrong the walker desyncs on the first immediate it meets, which is a nice property: you notice immediately.

### Building an opcode table that does not exist yet

Now the useful part. For each of the 103 handlers, two things are needed.

**The operand signature.** A handler consumes bytecode only by calling a reader primitive, so the ordered list of reader calls in the body *is* the operand list. This one is exact, no heuristics:

```js
const n = arguments[0];
n[34](140);
const s = n[43](),                 // one tagged value
  t = n[32][n[36]];
n[32][t - 1] >>= s, n[17]();
```

Signature: one tagged value. Semantics: shift the top of the stack right by an immediate. In listing terms, `SHR_IMM`.

**A mnemonic.** This one is pattern matching, and the trick that made it work is stripping every `bind[N]` reference out of the body first. What is left is the guest-level expression:

```
n[32][n[32][n[36]]++] = s     ->     @[@[@]++] = s      // a push
t[s] = c                      ->     t[s] = c           // property store
t(s)                          ->     t(s)               // a call
```

Suddenly the shapes are obvious and 85 of 103 opcodes get real names: `JMP`, `JMP_IF_FALSE`, `PUSH_STR`, `GET_PROP`, `SET_PROP`, `CALL`, `CALL_APPLY`, `MAKE_CLOSURE`, `HALT`, `XOR`, `MUL`, `CMP_GT`, `KEYS`, `NEW_ARRAY`, and so on. The remaining 18 keep an `OP_<slot>` name and print their source, which is honest and still perfectly usable, since their operand signatures are exact regardless.

### Walking the program

Handlers jump by adding to the PC slot at runtime:

```js
const n = arguments[0], s = n[49]();
n[32][n[21]] += s, n[17]();                                   // JMP
```

```js
const n = arguments[0], s = n[49]();
n[32][--n[32][n[36]]] || (n[32][n[21]] += s), n[17]();        // JMP_IF_FALSE
```

Which means a linear sweep is wrong. Sooner or later it walks into a jump's padding, decodes an operand as an opcode, and everything after that is fiction that still looks plausible.

So the walker is a worklist: start at the entry, decode until the block ends, queue branch targets, decode every address at most once. Unconditional jumps end a block. Regions nothing reaches are printed as gaps instead of being swept over, because a wrong instruction is worse than a missing one.

This also hands us a free correctness check. If any operand width is off by even one byte, jump targets stop landing on instruction boundaries. Across all 6 bundles:

```
captcha-3f9a12d       jmp=1119/1119      interstitial-161af37  jmp=1020/1020
captcha-d18541a       jmp=1014/1014      interstitial-e813eb1  jmp=1135/1135
captcha-d7aa843       jmp=1010/1010      interstitial-fa96b7a  jmp=976/976
```

Every branch, every bundle, dead on a boundary. That is about as much confidence as you get without running the thing.

Coverage lands around 90%. The missing tenth sits behind computed dispatch that only a live VM resolves, and I would rather report it as a gap than invent instructions for it.

### The instruction that hides 4 KB

First instruction of the program, and the first thing that broke my walker:

```js
const r = arguments[0];
for (var n = r[49](), a = new Uint8Array(n), t = 0; t < n; t++)
  a[t] = r[14]();
r[32][r[32][r[36]]++] = a, r[17]();
```

Read a u24, then read *that many* bytes one at a time. Counting reader calls naively gives "u24 plus one u8", four bytes of operands. The real answer is `3 + 4262`, because the u8 read is inside a loop.

By failing here you land 4258 bytes early, in the middle of a data blob, where the bytes decode into perfectly reasonable looking instructions that mean nothing at all.

So the analyzer tracks for-loop spans and marks reads inside them as repeating, with the count taken from the operand read just before. Same shape shows up with tagged values:

```js
const t = arguments[0], e = t[14]();
for (let n = 0; n < e; n++) t[32][t[32][t[36]]++] = t[43]();
```

That one is "read a count, then read that many tagged values", each of which is 1 to 9 bytes depending on its own tag. Two nested variable lengths in a single instruction.

And a third variant that looks identical from the operand side but is not a data blob at all:

```js
const o = arguments[0], t = o[14](), n = [], s = o[14]();
for (let t = 0; t < s; t++) { const t = o[14](), s = o[32][o[32][o[35]] + t]; n.push(s) }
const c = o[32][o[21]] + o[19], e = function (s) { /* new frame */ };
o[32][o[32][o[36]]++] = e, o[17]();
```

Arity, capture count, then that many capture slots, and it pushes a closure. That is the VM's function constructor, so it gets `MAKE_CLOSURE` rather than being lumped in with the byte pushers.

### Strings, and the byte that was not missing

The cipher is short and has no S-box:

```
header    bytes 0..3, little-endian u32, the base key
table     starts at byte 4, six bytes per entry:
          [ u24 LE offset ][ u16 LE length ][ u8 flags ]
keystream k[i] = (baseKey ^ ctx ^ (i + 1)) & 0xff
plaintext text[i] = image[offset + i] ^ k[i]
```

Two problems. The `ctx` byte is not stored anywhere, and the table is not where you would expect it.

The usual answer to a missing key byte is to sweep all 256 values and keep whatever looks readable. I did that first, and it is really useless: XOR against a wrong key lands in printable ASCII most of the time, so you get thousands of candidates like `"tsohr}qy"` and `"MIYNEoYPY_HSN"` sitting right next to `"pathname"` with the same score. You can eyeball the real ones. You cannot automate it.

<figure>
<svg viewBox="0 0 700 250" role="img" aria-label="Sweeping all 256 key values yields thousands of printable but meaningless candidates, while reading the ctx byte as an operand of the decode instruction yields the exact string." style="max-width:100%;height:auto;color:inherit">
  <defs><marker id="a4" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse"><path d="M0,0 L10,5 L0,10 z" fill="currentColor"/></marker></defs>
  <text x="0" y="16" font-size="12" fill="currentColor" opacity="0.7">sweep all 256 keys</text>
  <rect x="0" y="26" width="130" height="34" fill="none" stroke="currentColor" stroke-width="1" rx="4"/>
  <text x="65" y="48" font-size="12" fill="currentColor" text-anchor="middle" font-family="monospace">ctx = 0..255</text>
  <line x1="130" y1="43" x2="196" y2="43" stroke="currentColor" stroke-width="1.2" marker-end="url(#a4)"/>
  <g font-size="11" fill="currentColor" font-family="monospace" opacity="0.9">
    <text x="206" y="32">"tsohr}qy"</text>
    <text x="206" y="50">"pathname"</text>
    <text x="206" y="68">"MIYNEoYPY_HSN"</text>
  </g>
  <text x="360" y="50" font-size="12" fill="currentColor" opacity="0.85">all printable, all same score</text>
  <text x="206" y="92" font-size="12" fill="currentColor" opacity="0.85">thousands of candidates, not automatable</text>
  <line x1="0" y1="112" x2="700" y2="112" stroke="currentColor" stroke-width="1" opacity="0.3"/>
  <text x="0" y="140" font-size="12" fill="#f59e0b">read ctx as an operand</text>
  <g stroke="currentColor" fill="none" stroke-width="1">
    <rect x="0" y="152" width="90" height="32"/><rect x="90" y="152" width="80" height="32"/>
  </g>
  <rect x="170" y="152" width="70" height="32" fill="none" stroke="#f59e0b" stroke-width="2"/>
  <g font-size="11" fill="currentColor" text-anchor="middle" font-family="monospace">
    <text x="45" y="172">DECODE</text><text x="130" y="172">index</text>
  </g>
  <text x="205" y="172" font-size="11" fill="#f59e0b" text-anchor="middle" font-family="monospace">ctx</text>
  <text x="0" y="204" font-size="11" fill="currentColor" opacity="0.7">the call site carries it</text>
  <line x1="240" y1="168" x2="300" y2="168" stroke="#f59e0b" stroke-width="2" marker-end="url(#a4)"/>
  <rect x="310" y="152" width="150" height="32" fill="none" stroke="#f59e0b" stroke-width="2" rx="4"/>
  <text x="385" y="172" font-size="12" fill="#f59e0b" text-anchor="middle" font-family="monospace">"pathname"</text>
  <text x="480" y="172" font-size="12" fill="currentColor" opacity="0.85">exact, every time</text>
  <text x="310" y="204" font-size="11" fill="currentColor" opacity="0.7">217 to 231 strings per bundle</text>
</svg>
<figcaption>The key byte was never missing. It is an operand of the instruction that calls the decoder, so the disassembly hands it over and the guessing disappears.</figcaption>
</figure>

Then look at the handler that actually decodes strings:

```js
const a = arguments[0];
var n = a[45](), r = a[45](), s = a[14](), t = a[32][a[11] + n];
a[32][a[32][a[36]]++] = a[23](t, r, s), a[17]();
```

`ctx` is not missing. **It is an operand.** Every string decode site reads a register index, a table id and a ctx byte right out of the instruction stream, then hands all three to the cipher. Once the program is disassembled, every `PUSH_STR` instruction carries the exact table id and the exact ctx for that call site.

So the sweep goes in the bin and string recovery becomes exact. My resolver maps the cipher call's argument names back to the order the operands were read in, so it keeps working when a rotation reshuffles them, then decodes each site directly.

The second problem sorts itself out along the way. The string image is not at bytecode offset 4, because the cipher is handed a buffer read out of a *register*. That buffer is the 4262-byte blob the prologue pushes as its very first instruction. So the strings cannot be found until the program has been disassembled, and the disassembly is far more readable once the strings are attached. Chicken, egg, and the egg wins if you do the passes in the right order.

Result on a current interstitial: **224 unique strings from 1198 call sites**, all exact.

## What comes out, and what it reports

### How the token gets out

<figure>
<svg viewBox="0 0 700 210" role="img" aria-label="The HALT handler copies the accumulator into out.r, which becomes the plv3 field of the POST body, while the loader attaches the step count and timing as separate telemetry signals." style="max-width:100%;height:auto;color:inherit">
  <defs><marker id="a5" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse"><path d="M0,0 L10,5 L0,10 z" fill="currentColor"/></marker></defs>
  <rect x="0" y="40" width="150" height="40" fill="none" stroke="currentColor" stroke-width="1.2" rx="4"/>
  <text x="75" y="65" font-size="12" fill="currentColor" text-anchor="middle">accumulator</text>
  <line x1="150" y1="60" x2="206" y2="60" stroke="#f59e0b" stroke-width="2" marker-end="url(#a5)"/>
  <rect x="210" y="40" width="150" height="40" fill="none" stroke="#f59e0b" stroke-width="2" rx="4"/>
  <text x="285" y="65" font-size="12" fill="#f59e0b" text-anchor="middle" font-family="monospace">HALT, slot 165</text>
  <text x="285" y="98" font-size="11" fill="currentColor" text-anchor="middle" opacity="0.75">the only handler that does not chain</text>
  <line x1="360" y1="60" x2="416" y2="60" stroke="#f59e0b" stroke-width="2" marker-end="url(#a5)"/>
  <rect x="420" y="40" width="130" height="40" fill="none" stroke="#f59e0b" stroke-width="2" rx="4"/>
  <text x="485" y="65" font-size="12" fill="#f59e0b" text-anchor="middle" font-family="monospace">out.r</text>
  <line x1="550" y1="60" x2="606" y2="60" stroke="currentColor" stroke-width="1.2" marker-end="url(#a5)"/>
  <text x="700" y="65" font-size="12" fill="currentColor" text-anchor="end" font-family="monospace">plv3=</text>
  <rect x="0" y="140" width="150" height="40" fill="none" stroke="currentColor" stroke-width="1" rx="4"/>
  <text x="75" y="165" font-size="12" fill="currentColor" text-anchor="middle">loader</text>
  <line x1="150" y1="160" x2="416" y2="160" stroke="currentColor" stroke-width="1.2" marker-end="url(#a5)" stroke-dasharray="4 3"/>
  <text x="283" y="152" font-size="11" fill="currentColor" text-anchor="middle" opacity="0.8">attaches afterwards</text>
  <rect x="420" y="140" width="130" height="40" fill="none" stroke="currentColor" stroke-width="1" rx="4"/>
  <text x="485" y="165" font-size="12" fill="currentColor" text-anchor="middle" font-family="monospace">i, t, u, e</text>
  <line x1="550" y1="160" x2="606" y2="160" stroke="currentColor" stroke-width="1.2" marker-end="url(#a5)"/>
  <text x="700" y="165" font-size="12" fill="currentColor" text-anchor="end">signals</text>
</svg>
<figcaption>One value on the wire, and a step count riding beside it. The token is what you reproduce, the telemetry is what catches you reproducing it wrong.</figcaption>
</figure>

Look again at the primitive table:

```js
d[41] = B;      // B is the initializer's second parameter
```

And at the loader:

```js
const E = {};                      // the output object
try {
  M(Q, E);                         // handed to the initializer -> lands in d[41]
  ...
  for (Q[I] = Q[c], ...) Q[I]();   // run
  E.u = Q[-1];
} catch (A) {
  E.e = A;
} finally {
  return E.i = P, E.t = performance.now() - Q | 0, E;
}
```

So the **guest program has a handle on the output object**. It can write properties on it directly, and exactly one handler in the entire VM does. My classifier now flags it as `HALT`:

```js
// interstitial e813eb1, slot 165
const n = arguments[0];
n[41].r = n[32][n[10]],    // out.r = MEM[accumulator]
n[32][n[22]] = 1;          // halt = 1
```

```js
// captcha 3f9a12d, slot 140
const n = arguments[0];
n[11].r = n[31][n[19]],
n[31][n[45]] = 1;
```

That value is the **plv3 token**, the thing that ends up in the `plv3` field of the POST body. It is not `Q[-1]`, and it is not returned by anything. The guest computes it, leaves it in the accumulator, and the last instruction it ever executes copies it onto the output object and raises the halt flag. Notice there is no `n[17]()` call at the end: `HALT` is the only handler that does not dispatch to the next one, because there is no next one.

One `HALT` per bundle, every time:

| bundle | HALT slot | guest writes | loader writes |
|---|---|---|---|
| `interstitial-e813eb1` | 165 | `r` | `i`, `t`, `u`, `e` |
| `interstitial-fa96b7a` | 32 | `r` | `i`, `t`, `u`, `e` |
| `interstitial-161af37` | 70 | `r` | `i`, `t`, `u`, `e` |
| `captcha-3f9a12d` | 140 | `r` | `i`, `t`, `u`, `e` |
| `captcha-d18541a` | 144 | `r` | `i`, `t`, `u`, `e` |
| `captcha-d7aa843` | 255 | `r` | `i`, `t`, `u`, `e` |

So the VM's return value is a five-field object. Note the internal field is called `r`, but nothing outside the bundle ever sees that name: `main.js` reads it straight into the `plv3` field of the request, which is what everyone actually calls it.

| field | written by | meaning |
|---|---|---|
| `r` | guest `HALT` instruction | **the plv3 token**, copied verbatim into the `plv3` wire field |
| `i` | loader | how many dispatch iterations the loop ran |
| `t` | loader | wall-clock milliseconds the run took |
| `u` | loader | whatever sits at `Q[-1]` |
| `e` | loader | the exception, if it threw |

Four of those five have nothing to do with the token. They are telemetry about *how the VM ran*, and that is where this gets interesting.

### The orchestrator, and where every signal comes from

`main.js` in the same bundle is 60 lines and it is the Rosetta stone. It schedules the challenge across five steps paced by `window.ddm.durationMs`, and step 2 is the VM:

```js
case 2:
  D("W285lp", s(window.ddm.seed));
  var N = Date.now();
  try {
    var J = C(872)();                                    // run the VM
    D("CUu1rJ", J.i),                                    // iterations   -> signal
    D("V3s4H9", J.u),                                    // Q[-1]        -> signal
    J.e && D("Uznj9t", "i:" + String(J.e).slice(0, 150)); // error       -> signal
    E = J.r;                                             // token, kept for the wire
  } catch (A) {
    D("Uznj9t", "e:" + String(A).slice(0, 150));
  }
  var i = Date.now();
  D("RfE0EQ", i - N);                                    // elapsed      -> signal
  break;
```

and step 4 assembles the request:

```js
case 4:
  D("k63MOw", K), D("5E2YI5", K), (0, B[1])(), Q = {
    plv2: P(window.ddm.cid),
    plv3: E
  };
```

`D(key, value)` is the signal setter. So every field the VM returns goes somewhere, and only one of them is the token.

Cross-referencing those obfuscated keys against the signal mapping in the same bundle turns it into plain English.

### Signal by signal

| signal | obf key (e813eb1) | fed from | what it is really measuring |
|---|---|---|---|
| `vm_challenge_interactions` | `CUu1rJ` | `J.i` | how many times the dispatch loop iterated, around 467k on a real run |
| `vm_challenge_elapsed` | `RfE0EQ` | `Date.now()` around the call | wall-clock cost of the VM run |
| `vm_challenge_undef` | `V3s4H9` | `J.u`, that is `Q[-1]` | the negative-index slot, see below |
| `vm_challenge_errors` | `Uznj9t` | `J.e`, truncated to 150 chars | the exception message if the VM threw |
| `plv3` (wire field, not a signal) | n/a | `J.r` | the token itself |
| `tts` / `tts2` | `k63MOw` / `5E2YI5` | cumulative `Date.now()` across all 5 steps | total challenge time |
| `response` | `W285lp` | `s(window.ddm.seed)` | ties this payload to this challenge's seed |
| `v` | `w1uNfL` | literal `"1.30.0"` | bundle version |
| `ctype` | `hKujgT` | `window.ddm.displayEnabled` | invisible vs display mode |
| `chksm` | `tCsQW2` | `M(s.toString() + B.toString() + D.toString() + P.toString())` | see below |
| `ddets1` / `ddets2` | `DYDW4M` / `tFB9Op` | `n()` helper | environment detection pair |

Two rows in that table are not fingerprints at all. They are traps.

### The two tripwires

**`vm_challenge_interactions` is a step counter.** The VM reports precisely how many dispatch iterations it took to produce the token. For a given bundle and a given input, that number is essentially deterministic. If you reimplement the VM, or hook the dispatch loop to trace it, or short-circuit a loop to make it faster, the count moves and the server can see it.

I know how sensitive this is because I have watched it: browser `467499` against `463596` from an offline run, a 0.8% gap, on a value that is meant to be reproducible. It is a cheap and very effective way to ask "did you actually execute my program, all of it, the way I wrote it".

**`chksm` hashes the interpreter's own source.** Look at what it feeds the hash:

```js
var l = s.toString() + B.toString() + D.toString() + P.toString(),
  z = M(l);
```

`Function.prototype.toString` on its own functions. Monkey-patch any of them to instrument the VM and the source text changes, so the checksum changes. Classic self-integrity check, and it pairs neatly with the step counter: one catches you rewriting the code, the other catches you rewriting the execution.

**And `vm_challenge_undef` is the third.** `E.u = Q[-1]` reads a slot that is *below* the buffer, which in JavaScript means a property that simply does not exist unless something explicitly wrote to it. The signal name DataDome's own code generates for it is literally `vm_challenge_undef`, which reads a lot like "this is expected to be undefined". Nothing in the disassembly writes there in a clean run. As I understood it, it is a canary for a tampered or instrumented buffer rather than a payload field, though unlike the other two I cannot prove intent from static analysis alone.

Note: none of these three cost DataDome anything. They are free by-products of running a VM you control, and they punish exactly the shortcuts people take.

## Captcha versus interstitial

The two challenge types feel like different products. One is the silent "verifying your browser" page, the other is the puzzle. I assumed the VMs would differ in interesting ways, and went looking for it. Same tool, three interstitial rotations against three captcha rotations.

They do not differ. At all, structurally:

| property | interstitial | captcha |
|---|---|---|
| handlers installed | 103 / 103 / 103 | 103 / 103 / 103 |
| primitive slots | 23 / 23 / 23 | 23 / 23 / 23 |
| value tags | 9 | 9 |
| named opcodes present in one family only | none | none |
| program size | 37k to 43k instructions | 37k to 42k instructions |
| entry point | ~11.3 KB in | ~11.2 KB in |
| exit | one `HALT`, writes `out.r` | one `HALT`, writes `out.r` |

Not "similar". Identical counts, and every mnemonic my classifier produces for one family shows up in the other.

The instruction *mix* says the same thing. Sharing of named instructions across the two families, aggregated over three bundles each:

| opcode | interstitial | captcha | delta |
|---|---|---|---|
| `GET_PROP_IMM` | 13.63% | 13.24% | -0.39 |
| `PUSH_CONST` | 12.26% | 12.10% | -0.17 |
| `PUSH_IMM` | 3.63% | 3.77% | +0.14 |
| `GET_PROP` | 6.35% | 6.48% | +0.13 |
| `PUSH_STR` | 3.31% | 3.43% | +0.12 |
| `ADD` | 2.10% | 2.00% | -0.10 |

Those are the six **largest** differences in the entire instruction set. The biggest gap anywhere is under half a percentage point, which is noise between two builds of the same source.

Strings tell the same story, as long as you are strict about what "only" means. Take the strings present in **all three** rotations of one family and absent from **every** bundle of the other. On that test 130 strings are common to all six, and the captcha-only set is two entries:

```
crypto
getRandomValues
```

That is the whole difference. The captcha pulls entropy from `crypto.getRandomValues` on top of `Math.random`, and everything else, the WebGL shader, the canvas compositing, the SVG probe, the CSS `calc()` measurement, the timing reads, is the same program. The interstitial-only set is empty.

That criterion is doing real work, so it is worth spelling out. Relax it to "in all of one family, not in all of the other" and the same six bundles report 26 captcha-only and 13 interstitial-only strings. Every one of the extras is a chain like `performance.memory.usedJSHeapSize` sitting at 3/3 in one family and 1/3 in the other, which is a build that happened to drop a probe, not a design decision. Pick the loose test and you will write up rotation noise as strategy.

### The part where I was wrong

My first pass compared one interstitial against one captcha and produced a much more exciting list: `maxTouchPoints`, `hardwareConcurrency`, `XMLDocument`, a pile of differing CSS custom property names. I nearly wrote it up as "same machine, different questionnaire".

It was rotation noise. Those CSS variable names (`--b4`, `--oj`, `--za`) are regenerated per build, so a single-bundle comparison shows dozens of "differences" that are really just two different Tuesdays. Intersecting three rotations per family before diffing collapses the list from dozens to two. If you take one thing from this section, take that: **against a target that rebuilds daily, never diff two files, diff two sets.**

The same discipline caught a bug in my own tool. The comparison initially reported 23 primitive slots for the interstitial and 22 for the captcha, which looked like a real structural difference and was in fact my const-block parser dropping `$ = 18`. The regex used `\b` before the identifier, and `\b` does not match before `$` because `$` is not a word character. After a double check, both families report 23. A "difference" that only shows up on one side of a comparison is worth suspecting before you publish it.

### So why two challenge types

Because the difference is not in the VM, it is around it. Same interpreter, same program, same collection surface, wrapped in a different orchestrator, submitted to a different endpoint, inside a completely different envelope:

| | interstitial | captcha |
|---|---|---|
| submit | `POST /interstitial/` | `GET /captcha/check` |
| carries the token as | `plv3` | `plv3` |
| signal blob field | `payload` | `ddCaptchaEncodedPayload` |
| other fields | `cid hash referer url s e env userEnv seed b dm ps` | `cid icid ccid userEnv dm ddCaptchaChallenge ddCaptchaEnv ddCaptchaAudioChallenge hash ua referer parent_url s ir` |

Only `plv3`, `cid`, `hash`, `userEnv` and `dm` appear on both sides.

Which is good news if you have already done the work for one of them. The plv3 half carries over completely.

## What the VM computes, proven from the listing

A string dump tells you a bundle *contains* the word `webdriver`. It does not tell you the program reads it. That gap matters, because a 4 KB blob of strings includes plenty the program never touches on a given path.

Thanks to the disassembly we can settle it. Property access in this VM is always the same two-instruction shape:

```
PUSH_STR "document"     ; push a decoded string
GET_PROP                ; pop key, pop object, push object[key]
PUSH_STR "timeline"
GET_PROP
PUSH_STR "currentTime"
GET_PROP
```

So a run of those pairs *is* a property chain, and joining the strings back together reconstructs `document.timeline.currentTime` with a byte offset attached. That is the difference between "this string exists somewhere" and "the program evaluates this expression, at pc 35310".

The tool does this with `--chains`. Two details make it correct rather than approximate:

- **Any non-string push closes the chain.** The `fn.apply(thisArg, ...)` idiom pushes the receiver and then re-resolves it to reach the method, so without this you reconstruct `Math.Math.random` instead of two separate reads.
- **A SCREAMING_CASE key closes the chain.** `gl.ARRAY_BUFFER` is a constant read off an object, never a container you walk into, so sibling reads stop gluing together.

### The stable core

Twenty-five chains appear in **all six bundles**, three interstitial rotations and three captcha rotations:

| what | chains |
|---|---|
| entropy | `Math.random`, `Math.round` |
| clock | `Date.now`, `performance.now`, `performance.timing`, `document.lastModified` |
| DOM construction | `document.createElement`, `document.createElementNS`, `document.body`, `document.body.appendChild`, `document.body.removeChild` |
| layout readback | `lastChild.offsetWidth`, `window.devicePixelRatio` |
| page context | `window.ddm`, `window.ddm.userEnv`, `location.pathname`, `document.hidden`, `window.isSecureContext` |
| encoding | `window.atob`, `String.fromCharCode` |
| automation checks | `navigator.webdriver`, `window._virtualConsole`, `window.Buffer`, `window._userAgent`, `window.atob.toString` |

Call frequency from a current interstitial, and the counts are worth a look on their own:

```
 32x () Math.random                          @pc 34130
 21x () Date.now                             @pc 34099
 10x () document.createElement               @pc 148413
  6x () document.createElementNS             @pc 142720
  5x () performance.now                      @pc 52322
  5x () document.body.appendChild            @pc 154486
  3x    document.timeline.currentTime        @pc 35310
  3x    window._virtualConsole               @pc 170307
  2x    performance.memory.usedJSHeapSize    @pc 52080
  2x () window.atob.toString                 @pc 173254
```

`Math.random` 32 times and `Date.now` 21 times is a way to salt and time itself through the run. The DOM constructors are the probe being built. Everything else is the measurement.

### The five checks that are looking for you specifically

This is the group that needs special attention, because four of these five are not fingerprinting, they are automation detection, and every one is confirmed present in all six bundles:

| chain | what it catches |
|---|---|
| `navigator.webdriver` | the standard WebDriver flag |
| `window._virtualConsole` | a **jsdom** internal, only exists if the page is running in jsdom |
| `window._userAgent` | also jsdom, which stores the UA on the window object |
| `window.Buffer` | a **Node** global, present if the DOM is faked inside Node |
| `window.atob.toString` | see below |

That last one is the sharpest. The VM stringifies the `atob`. And `[native code]` sits right there in the recovered string table. `Function.prototype.toString` on a real builtin returns `function atob() { [native code] }`, and on a hooked one returns your replacement source. So the VM is checking **whether the primitives it depends on have been monkey-patched**, which is exactly what an instrumentation harness does to observe it.

Put that next to the [two tripwires](#the-two-tripwires) from earlier, the step counter and the `chksm` self-hash, and the anti-tamper story is coherent: `chksm` catches you rewriting the interpreter's own functions, the step counter catches you changing how it executes, and `atob.toString` catches you rewriting the browser underneath it.

### Where the effort actually goes

Bucketing the resolved call sites by area, averaged per bundle:

| area | strings | call sites (interstitial) | call sites (captcha) |
|---|---|---|---|
| encoding | 17 | 348 | 360 |
| DOM | 16 | 169 | 192 |
| layout probe | 53 | 135 | 111 |
| entropy | 2 | 108 | 104 |
| timing | 9 | 105 | 84 |
| WebGL | 25 | 57 | 52 |
| canvas | 13 | 36 | 43 |
| SVG | 3 | 15 | 22 |
| navigator | 7 | 13 | 17 |

Two things stand out.

**The layout probe has the largest vocabulary by far.** 53 distinct strings, more than double WebGL's 25, because every rotation ships its own generated CSS custom property names (`--b4`, `--oj`, `--za`) plus the selectors and declarations to go with them. The VM writes a `<style>` block, nests divs, parks them at `position:absolute;left:-9999px`, and reads `offsetWidth` back out. The answer comes from the browser's own layout arithmetic over `calc()` expressions, which is precisely why it is hard to fake: you cannot patch a getter to return a plausible number, you would have to reimplement CSS length resolution and agree with the real engine.

**`navigator` is nearly the smallest.** Seven strings, thirteen call sites. The classic fingerprinting surface everyone patches first is the part this VM cares least about. It spends its time on rendered output and layout instead, which is a rational choice given how easy `navigator` is to spoof.

### WebGL, end to end

The full pipeline is recoverable, including the shader source, which is sitting in the string table as a literal:

```glsl
attribute vec2 p;void main(){gl_Position=vec4(p,0,1);}
```

and the chains show it being built and executed in order: `createShader`, `shaderSource`, `compileShader`, `attachShader`, `createProgram`, `linkProgram`, `useProgram`, `getAttribLocation`, `enableVertexAttribArray`, `bindBuffer` with `ARRAY_BUFFER`, `bufferData` with `STATIC_DRAW`, `vertexAttribPointer` with `FLOAT`, `drawArrays` with `TRIANGLES`, then `readPixels` with `RGBA` and `UNSIGNED_BYTE`.

That last call is the point of the whole exercise: it renders a triangle and reads the pixels back. The value that comes out depends on the GPU, the driver and the rasteriser, so it is a hardware fingerprint that no amount of JavaScript spoofing reproduces. The canvas path does the same trick with `globalCompositeOperation` set to `difference` and `getImageData`.

### The captcha delta, at chain level

Earlier I compared the two challenge types by their string tables and found two captcha-only strings. Repeating it at chain level, with the same discipline of requiring presence in all three rotations of a family:

| | count | chains |
|---|---|---|
| in 3/3 of both families | 25 | the stable core above |
| strictly captcha-only | 1 | `crypto.getRandomValues` |
| strictly interstitial-only | 0 | none |

One chain. The captcha pulls extra entropy from `crypto.getRandomValues` on top of `Math.random`, and that is the entire difference in what the two programs ask the browser.

Everything else that *looks* like a difference is per-rotation drift, and the counts make it obvious:

```
document.timeline.currentTime        int=3/3  cap=1/3
performance.memory.usedJSHeapSize    int=3/3  cap=1/3
window.outerWidth                    int=2/3  cap=3/3
performance.timeOrigin               int=3/3  cap=2/3
window.screen.height                 int=3/3  cap=1/3
location.href                        int=3/3  cap=1/3
```

Those are not challenge-type differences, they are build-to-build differences that happen to fall unevenly. Compare one interstitial against one captcha and you would write up half of that list as meaningful. Compare three against three and only `crypto.getRandomValues` survives.

### What this means if you are reproducing it

The chain list is a to-do list, in priority order. The reads are cheap to satisfy and the *renders* are not:

- `navigator.*`, `location.*`, `document.hidden`, `window.isSecureContext`: plain values, spoof freely
- the clock and entropy chains: plain values, but they feed the timing signals, so stay self-consistent
- `lastChild.offsetWidth` after a `calc()` style block: needs a real layout engine or an exact reimplementation
- `readPixels` and `getImageData`: need a real rasteriser, or a captured value from the machine you are claiming to be
- `navigator.webdriver`, `window._virtualConsole`, `window.Buffer`, `window._userAgent`, `atob.toString`: must be *absent* or *native*, and jsdom fails four of the five by existing

That last line is why headless-DOM approaches to this particular VM tend to die early, and it took a disassembler rather than a string dump to say so with a byte offset attached.

## The rotation surface

Every number in this table changes per build:

| bundle | buffer | code base | LCG seed | MAKE_FUNC | entry | instructions | strings |
|---|---|---|---|---|---|---|---|
| `interstitial-e813eb1` | 209725 | 4624 | 2078235825 | 57 | 11405 | 43215 | 224 |
| `interstitial-fa96b7a` | 183813 | 4878 | 1203021935 | 57 | 11295 | 37135 | 218 |
| `interstitial-161af37` | 188088 | 5485 | 1084808355 | 80 | 11276 | 38392 | 212 |
| `captcha-3f9a12d` | 204736 | 3954 | 790629505 | 182 | 11396 | 42003 | 227 |
| `captcha-d18541a` | 184300 | 4176 | 849279761 | 77 | 11015 | 36877 | 231 |
| `captcha-d7aa843` | 185755 | 4988 | 204181867 | 89 | 11157 | 37076 | 231 |

So do all identifier names, all register offsets, all value tag bytes, all primitive slot IDs, the `HALT` slot, and the opcode byte of every instruction in the program.

What does not change is the shape: a const block, an LCG closure, a tagged-value reader with a fall-through chain, a 6-byte string table entry, a MAKE_FUNC record layout, 23 primitives, exactly one `HALT`, and **exactly 103 handlers** in every bundle in my collection. By anchoring on shape you get a tool that survives rotations. By anchoring on values you get a tool that survives until the next deploy.

The 103 is the detail I keep coming back to. Identical across interstitial and captcha, identical across every rotation. That is not randomness, that is a compiler emitting a fixed instruction set with shuffled encodings.

## Conclusion

This was a case study, and a good one. Moving the opcode semantics into the payload is a real improvement over the old static switch: it kills every hardcoded opcode table in existence and makes each bundle its own dialect. That is a much better idea than renaming variables one more time. The step counter and the source checksum riding along for free are the kind of details that separate a VM someone built because it sounded cool from a VM someone built to catch people.

It also has a structural weakness, which is that a VM has to be able to build itself. The loader must tell you where the bytecode lives, the initializer must hand every handler the same primitive table, and the handlers must arrive as readable source before they can be compiled. Follow that construction path in the same order the VM does and it hands you the instruction set on the way past.

The `ctx` byte is still my favourite bit. Everyone treats it as a missing key and brute forces it into a pile of nonsense. It was sitting in the instruction stream the whole time, one operand over, waiting for someone to disassemble the program first.

[Tool is here](https://github.com/glizzykingdreko/datadome-plv3-vm-disassembler), MIT, zero dependencies. Point it at a bundle and it will tell you what changed since yesterday.

## Need DataDome bypass solutions?

[![TakionAPI, we handle the wall. You ship the rest.](https://takionapi.tech/og.webp)](https://takionapi.tech/bypass/datadome)

If you would rather skip all of this and just get a working cookie, [**TakionAPI**](https://takionapi.tech/bypass/datadome) handles DataDome interstitials, captchas and tags in production, plv3 included. One call returns the `datadome` cookie against a consistent fingerprint, no browser. We know what we are doing. [Start with a trial](https://takionapi.tech/trial).

## Connect with me

If you enjoyed this, follow me on GitHub and Medium to get a ping whenever I post or open-source something.

- [GitHub](https://github.com/glizzykingdreko)
- [Twitter](https://mobile.twitter.com/glizzykingdreko)
- [Medium](https://medium.com/@glizzykingdreko)
- [Email](mailto:glizzykingdreko@protonmail.com)
- [Buy me a coffee ❤️](https://www.buymeacoffee.com/glizzykingdreko)
- [TakionAPI](https://takionapi.tech)

## Sources

- [new-datadome-deobfuscator](https://github.com/glizzykingdreko/new-datadome-deobfuscator), run this first to get a readable `vm-obf.js`
- [datadome-wasm](https://github.com/glizzykingdreko/datadome-wasm), the embedded WASM module
- [datadome-encryption](https://github.com/glizzykingdreko/datadome-encryption), the request payload encryption
