vtil::routine
vtil::routine is the top-level container for a translated function. It owns blocks, tracks calling conventions, and exposes CFG/path helpers used by optimization and analysis.
Creating a routine
#include <vtil/vtil>
vtil::basic_block* entry = vtil::basic_block::begin(0x401000);
vtil::routine* rtn = entry->owner;Key members
| Member | Type | Description |
|---|---|---|
entry_point | basic_block* | The first block to execute. |
explored_blocks | unordered_map<vip_t, unique_ptr<basic_block>> | Owned blocks indexed by virtual IP. |
routine_convention | call_convention | Calling convention for this routine. |
subroutine_convention | call_convention | Default convention for unspecialized VXCALL. |
arch_id | architecture_identifier | Target CPU architecture (amd64, x86, arm64, virtual). |
mutex | relaxed<std::recursive_mutex> | Recursive mutex for thread-safe access to the routine. |
spec_subroutine_conventions | unordered_map<vip_t, call_convention> | Per-VXCALL convention overrides; set via set_cconv(). |
Block creation and path checks
auto [src, created0] = rtn->create_block(0x401000);
auto [dst, created1] = rtn->create_block(0x401040, src);
if (rtn->has_path(src, dst)) {
vtil::logger::log("path exists
");
}Specialized VXCALL conventions
vtil::call_convention cc = rtn->subroutine_convention;
cc.purge_stack = false;
rtn->set_cconv(0x401050, cc);
auto resolved = rtn->get_cconv(0x401050);Serialization
vtil::save_routine(rtn, "output.vtil");
vtil::routine* loaded = vtil::load_routine("output.vtil");