lief::runtime

Function assemble

pub fn assemble(address: u64, asm: &str) -> Vec<u8>
Expand description

Assemble the provided assembly code at the specified (absolute) virtual address.

The generated assembly bytes are returned by the function.

use lief::runtime;

let code = runtime::assemble(0x7f0011223344, r#"
    xor rax, rbx;
    mov rcx, rax;
"#);