InternalEject() static private method

Frees the loaded dynamic-link library (DLL) module and, if necessary, decrements its reference count.
static private InternalEject ( MemorySharp memorySharp, RemoteModule module ) : void
memorySharp MemorySharp The reference of the object.
module RemoteModule The module to eject.
return void
Example #1
0
        /// <summary>
        ///     Frees the loaded dynamic-link library (DLL) module and, if necessary, decrements its reference count.
        /// </summary>
        /// <param name="module">The module to eject.</param>
        public void Eject(RemoteModule module)
        {
            // If the module is valid
            if (!module.IsValid)
            {
                return;
            }

            // Find if the module is an injected one
            var injected = InternalInjectedModules.FirstOrDefault(m => m.Equals(module));

            if (injected != null)
            {
                InternalInjectedModules.Remove(injected);
            }

            // Eject the module
            RemoteModule.InternalEject(MemorySharp, module);
        }