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:
/NOUNLOADflag
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>
impl<'a> PluginCall<'a>
Sourcepub fn dll(&self) -> Result<NsisString, Error>
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.
Sourcepub fn function(&self) -> Result<NsisString, Error>
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
Sourcepub fn is_plugin_call(&self) -> bool
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.