close
VTILVTIL

vtil::basic_block

A straight-line sequence of VTIL instructions with a single entry and one or more exits. Blocks are connected into a CFG via predecessor and successor edge lists.

Appending instructions

All emitters return *this, enabling chaining:

auto t0 = bb->tmp(64);
bb->mov(t0, 0x1337)
  ->add(t0, 0x42)
  ->vexit(0);
Temporaries and stack helpers
auto [lo, hi] = bb->tmp(64, 64);
bb->mul(lo, 2ull);   // lo = lo * 2

bb->push(REG_SP)
  ->pop(REG_SP)
  ->vmfence();
Native emission helpers

VTIL can embed native instructions directly in a block.

bb->vemit(0xCC);            // raw opcode byte
bb->vemits("mov rax, rbx"); // assemble text and emit bytes
CFG edges
for (auto* succ : bb->next)
    vtil::debug::dump(succ);

for (auto* pred : bb->prev)
    vtil::debug::dump(pred);
Iterating instructions
for (auto& ins : *bb)
    vtil::logger::log("%s\n", ins.to_string().c_str());

Header Files