Skip to main content

PluginCall

Struct PluginCall 

Source
pub struct PluginCall<'a> { /* private fields */ }
Expand description

A plugin DLL invocation (EW_REGISTERDLL, opcode 44).

This is the mechanism behind NSIS plugin calls. In NSIS script, a plugin call like System::Call "kernel32::VirtualAlloc(...)" compiles to an EW_REGISTERDLL instruction with:

  • param 0: DLL path (e.g., $PLUGINSDIR\System.dll)
  • param 1: function name (e.g., Call)
  • param 2: 0 for plugin calls, non-zero for COM DLL registration
  • param 3: /NOUNLOAD flag

Malware frequently abuses System::Call to invoke Win32 APIs directly: VirtualAlloc, VirtualProtect, CreateThread, NtCreateSection, etc. The actual API call string is typically pushed onto the NSIS stack before the CallInstDLL instruction.

Source: exec.c case EW_REGISTERDLL, 7-Zip NsisIn.cpp lines 4381-4412.

Implementations§

Source§

impl<'a> PluginCall<'a>

Source

pub fn dll(&self) -> Result<NsisString, Error>

Returns the DLL file path.

Typically $PLUGINSDIR\<name>.dll — the plugin is extracted to the temp plugins directory and loaded from there.

Source

pub fn function(&self) -> Result<NsisString, Error>

Returns the exported function name being called.

Common values:

  • "Call"System::Call (arbitrary Win32 API invocation)
  • "Create"nsDialogs::Create (UI dialog creation)
  • "DllRegisterServer" — standard COM registration
  • "DllUnregisterServer" — standard COM unregistration
Source

pub fn is_plugin_call(&self) -> bool

Returns true if this is a CallInstDLL (plugin call).

When false, this is a RegDLL or UnRegDLL COM registration operation instead.

Source

pub fn no_unload(&self) -> bool

Returns true if the /NOUNLOAD flag is set.

When set, the DLL remains loaded in memory after the call returns. This is used by plugins that maintain state across multiple calls.

Source

pub fn entry(&self) -> &Entry<'a>

Returns the underlying Entry.

Auto Trait Implementations§

§

impl<'a> Freeze for PluginCall<'a>

§

impl<'a> RefUnwindSafe for PluginCall<'a>

§

impl<'a> Send for PluginCall<'a>

§

impl<'a> Sync for PluginCall<'a>

§

impl<'a> Unpin for PluginCall<'a>

§

impl<'a> UnsafeUnpin for PluginCall<'a>

§

impl<'a> UnwindSafe for PluginCall<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.