Struct lde::X64 [] [src]

pub struct X64;

Length disassembler for the x86_64 instruction set architecture.

Methods

impl X64
[src]

[src]

Returns the length of the first opcode in the given byte slice.

When length disassembling fails, eg. the byte slice does not contain a complete and valid instruction, the return value is 0.

Examples

let code = b"\x40\x55\x48\x83\xEC*\x00\x80";
assert_eq!(lde::X64.ld(code), 2);
let invalid = b"";
assert_eq!(lde::X64.ld(invalid), 0);

[src]

Returns the first opcode in the byte slice if successful.

Examples

let code = b"\x40\x55\x48\x83\xEC*\x00\x80";
assert_eq!(lde::X64.peek(code), Some(b"\x40\x55".into()));

[src]

Returns the first opcode mutably in the byte slice if successful.

Important traits for Iter<'a, X>
[src]

Returns an iterator over the opcodes contained in the byte slice.

Given a virtual address to keep track of the instruction pointer.

Examples

let code = b"\x40\x55\x48\x83\xEC*\x00\x80";

for (opcode, va) in lde::X64.iter(code, 0x1000) {
    println!("{:x}: {}", va, opcode);
}

Prints the following result

1000: 4055
1002: 4883EC2A

Important traits for IterMut<'a, X>
[src]

Returns an iterator over the opcodes contained in the byte slice.

Given a virtual address to keep track of the instruction pointer.

Examples

let mut code = *b"\x40\x55\x48\x83\xEC*\x00\x80";

for (opcode, va) in lde::X64.iter_mut(&mut code, 0x1000) {
    opcode.write(0, 0xff_u8);
}

assert_eq!(&code, b"\xff\x55\xff\x83\xEC*\x00\x80");

Trait Implementations

impl Isa for X64
[src]

Virtual address type.

[src]

Returns the length of the first opcode in the given byte slice. Read more

[src]

Returns the first opcode in the byte slice if successful.

[src]

Returns the first opcode mutably in the byte slice if successful.

Important traits for Iter<'a, X>
[src]

Returns an iterator over the opcodes contained in the byte slice. Read more

Important traits for IterMut<'a, X>
[src]

Returns an iterator over the opcodes contained in the byte slice. Read more

Auto Trait Implementations

impl Send for X64

impl Sync for X64