pub struct DllInjection<D: DllApp> { /* private fields */ }Available on crate feature
inject-dll only.Expand description
Represents an injected DLL with its syringe, payload, and remote apply function.
Implementations§
Source§impl<D: DllApp> DllInjection<D>
impl<D: DllApp> DllInjection<D>
pub fn pid(&self) -> Pid
Sourcepub fn maybe_apply(
&self,
input: Option<&D::Input>,
) -> Result<D::Output, PayloadRpcError>
pub fn maybe_apply( &self, input: Option<&D::Input>, ) -> Result<D::Output, PayloadRpcError>
Call DllApp::APPLY with the given input.
Sourcepub fn apply(&self, input: &D::Input) -> Result<D::Output, PayloadRpcError>
pub fn apply(&self, input: &D::Input) -> Result<D::Output, PayloadRpcError>
Call DllApp::APPLY with the given input.
§Implementation
ⓘ
let args = (input,);
let config = bincode::config::standard();
let mut size_writer = bincode::enc::write::SizeWriter::default();
bincode::serde::encode_into_writer(&args, &mut size_writer, config)?;
let arg_bytes = size_writer.bytes_written;
let mut local_arg_buf = Vec::with_capacity(arg_bytes);
bincode::serde::encode_into_std_write(&args, &mut local_arg_buf, config)?;
unsafe { local_arg_buf.set_len(arg_bytes) };
// println!("{:02X?}", local_arg_buf);
/*
let buf = &local_arg_buf[..arg_bytes].to_owned();
println!("decode_from_slice {:02X?}", buf);
let args: Result<((Option<Input>,), usize), bincode::error::DecodeError> =
bincode::serde::decode_from_slice::<(Option<Input>,), _>(buf, config);
println!("{:?}", args);
*/
...pub fn unapply(&self) -> Result<D::Output, PayloadRpcError>
Sourcepub fn eject(&mut self) -> Result<(), InjectError>
pub fn eject(&mut self) -> Result<(), InjectError>
Eject the DLL from the target process.
This will first unapply if it was applied before.
Sourcepub fn inject<'f1, 'f2>(
process: OwnedProcess,
) -> DllInjectionInjectBuilder<'f1, 'f2, D>
pub fn inject<'f1, 'f2>( process: OwnedProcess, ) -> DllInjectionInjectBuilder<'f1, 'f2, D>
Inject the DLL into the given process and optionally appliy it (call APPLY()).
Trait Implementations§
Source§impl<D: DllApp> Drop for DllInjection<D>
impl<D: DllApp> Drop for DllInjection<D>
impl<D: DllApp> Send for DllInjection<D>
Auto Trait Implementations§
impl<D> !Freeze for DllInjection<D>
impl<D> !RefUnwindSafe for DllInjection<D>
impl<D> !Sync for DllInjection<D>
impl<D> Unpin for DllInjection<D>
impl<D> UnsafeUnpin for DllInjection<D>
impl<D> !UnwindSafe for DllInjection<D>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more