Crate vtil_parser[][src]

VTIL-RustParser

Read/write VTIL files in Rust.

You can learn more about VTIL here on the main GitHub page.

Examples

For a simple example of loading a VTIL file and reading out some basic data:

use vtil_parser::{VTILReader, ArchitectureIdentifier};

let routine = VTILReader::from_path("resources/big.vtil")?;
assert_eq!(routine.header.arch_id, ArchitectureIdentifier::Amd64);

For a more complex example, iterating over IL instructions:

use vtil_parser::{VTILReader, Op, Operand, Reg, Imm, RegisterFlags};

let routine = VTILReader::from_path("resources/big.vtil")?;

for basic_block in routine.explored_blocks.iter().take(1) {
    for instr in basic_block.instructions.iter().take(1) {
        match &instr.op {
            Op::Ldd(_, Operand::Reg(op2), Operand::Imm(op3)) => {
                assert!(op2.flags.contains(RegisterFlags::PHYSICAL));
                assert!(op3.i64() == 0);
            }
            _ => assert!(false)
        }

        assert_eq!(instr.vip.0, 0x9b833);
    }
}

Structs

BasicBlock

Basic block containing a linear sequence of VTIL instructions

Header

Header containing metadata regarding the VTIL container

Imm

Describes a VTIL immediate value in an operand

Instruction

VTIL instruction and associated metadata

Reg

Describes a VTIL register in an operand

RegisterFlags

Flags describing register properties

RoutineConvention

Routine calling convention information and associated metadata

VTIL

VTIL container

VTILReader

Reader for VTIL containers

Vip

VTIL instruction pointer

Enums

ArchitectureIdentifier

Architecture for IL inside of VTIL routines

Error

Custom Error for VTIL reading/writing

Op

VTIL operator and operands

Operand

VTIL instruction operand

Type Definitions

SubroutineConvention

Alias for RoutineConvention for consistent naming