Esempio n. 1
0
        private RemoteModule FetchModule(string moduleName)
        {
            if (!Path.HasExtension(moduleName))
            {
                moduleName += ".dll";
            }
            var nativeMod = NativeModules.FirstOrDefault(m => m.ModuleName.Equals(moduleName, StringComparison.OrdinalIgnoreCase));

            return(nativeMod == null ? null : new RemoteModule(m_Process, nativeMod));
        }
Esempio n. 2
0
        private InjectedModule InternalInject(string module, bool mustBeDisposed)
        {
            var thread = m_Process.Threads.CreateAndJoin(this["kernel32"]["LoadLibraryA"].BaseAddress, module);

            if (thread.GetExitCode <IntPtr>() == IntPtr.Zero)
            {
                return(null);
            }
            var native = NativeModules.FirstOrDefault(m => m.ModuleName.Equals(Path.GetFileName(module), StringComparison.OrdinalIgnoreCase));

            return(native == null ? null : new InjectedModule(m_Process, native, mustBeDisposed));
        }