Struct dynasmrt::x64::AssemblyModifier
[−]
[src]
pub struct AssemblyModifier<'a: 'b, 'b> { /* fields omitted */ }
This struct is a wrapper around an Assembler
normally created using the
Assembler.alter
method. Instead of writing to a temporary assembling buffer,
this struct assembles directly into an executable buffer. The goto
method can
be used to set the assembling offset in the ExecutableBuffer
of the assembler
(this offset is initialized to 0) after which the data at this location can be
overwritten by assembling into this struct.
Methods
impl<'a, 'b> AssemblyModifier<'a, 'b>
[src]
fn goto(&mut self, offset: AssemblyOffset)
Sets the current modification offset to the given value
fn check(&mut self, offset: AssemblyOffset)
Checks that the current modification offset is not larger than the specified offset. If this is violated, it panics.
fn check_exact(&mut self, offset: AssemblyOffset)
Checks that the current modification offset is exactly the specified offset. If this is violated, it panics.
Trait Implementations
impl<'a, 'b, 'c> DynasmApi<'c> for AssemblyModifier<'a, 'b>
[src]
fn offset(&self) -> AssemblyOffset
Report the current offset into the assembling target
fn push(&mut self, value: u8)
Push a byte into the assembling target
fn push_i8(&mut self, value: i8)
Push a signed byte into the assembling target
fn push_i16(&mut self, value: i16)
Push a signed word into the assembling target
fn push_i32(&mut self, value: i32)
Push a signed doubleword into the assembling target
fn push_i64(&mut self, value: i64)
Push a signed quadword into the assembling target
fn runtime_error(&self, msg: &'static str) -> !
This function is called in when a runtime error has to be generated. It panics.
impl<'a, 'b, 'c> DynasmLabelApi<'c> for AssemblyModifier<'a, 'b>
[src]
fn align(&mut self, alignment: usize)
Push nops until the assembling target end is aligned to the given alignment
fn global_label(&mut self, name: &'static str)
Record the definition of a global label
fn global_reloc(&mut self, name: &'static str, size: u8)
Record a relocation spot for a reference to a global label
fn dynamic_label(&mut self, id: DynamicLabel)
Record the definition of a dynamic label
fn dynamic_reloc(&mut self, id: DynamicLabel, size: u8)
Record a relocation spot for a reference to a dynamic label
fn local_label(&mut self, name: &'static str)
Record the definition of a local label
fn forward_reloc(&mut self, name: &'static str, size: u8)
Record a relocation spot for a forward reference to a local label
fn backward_reloc(&mut self, name: &'static str, size: u8)
Record a relocation spot for a backward reference to a local label
impl<'a, 'b> Extend<u8> for AssemblyModifier<'a, 'b>
[src]
fn extend<T>(&mut self, iter: T) where
T: IntoIterator<Item = u8>,
T: IntoIterator<Item = u8>,
Extends a collection with the contents of an iterator. Read more
impl<'a, 'b, 'c> Extend<&'c u8> for AssemblyModifier<'a, 'b>
[src]
fn extend<T>(&mut self, iter: T) where
T: IntoIterator<Item = &'c u8>,
T: IntoIterator<Item = &'c u8>,
Extends a collection with the contents of an iterator. Read more