Esempio n. 1
0
        internal InjectionContext(InjectionMethod injectionMethod, string processName, string dllPath)
        {
            _injectionWrapper = new InjectionWrapper(injectionMethod, processName, dllPath);

            // Ensure the architecture of the DLL is valid

            ValidationHandler.ValidateDllArchitecture(_injectionWrapper);
        }
Esempio n. 2
0
        internal InjectionContext(InjectionMethod injectionMethod, int processId, byte[] dllBytes)
        {
            _injectionWrapper = new InjectionWrapper(injectionMethod, processId, dllBytes);

            // Ensure the architecture of the DLL is valid

            ValidationHandler.ValidateDllArchitecture(_injectionWrapper);
        }
Esempio n. 3
0
        internal InjectionManager(string processName, string dllPath, InjectionMethod injectionMethod, InjectionFlags injectionFlags)
        {
            _injectionWrapper = new InjectionWrapper(GetProcess(processName), dllPath, injectionMethod, injectionFlags);

            ValidationHandler.ValidateDllArchitecture(_injectionWrapper);

            _ejectDll = new EjectDll(_injectionWrapper);

            _hideDllFromPeb = new HideDllFromPeb(_injectionWrapper);

            _injectionMethod = InitialiseInjectionMethod(injectionMethod);
        }
Esempio n. 4
0
        internal InjectionManager(int processId, byte[] dllBytes, InjectionMethod injectionMethod, InjectionFlags injectionFlags)
        {
            _injectionWrapper = new InjectionWrapper(GetProcess(processId), dllBytes, injectionMethod, injectionFlags);

            ValidationHandler.ValidateDllArchitecture(_injectionWrapper);

            _ejectDll = new EjectDll(_injectionWrapper);

            _hideDllFromPeb = new HideDllFromPeb(_injectionWrapper);

            _injectionMethod = InitialiseInjectionMethod(injectionMethod);
        }
        internal InjectionManager(InjectionMethod injectionMethod, string processName, string dllPath)
        {
            _injectionContext = new InjectionContext();

            _injectionWrapper = new InjectionWrapper(injectionMethod, processName, dllPath);

            _injectionExtensionCache = new Dictionary <string, IInjectionExtension>
            {
                { "EjectDll", new EjectDll(_injectionWrapper) },
                { "HideDllFromPeb", new HideDllFromPeb(_injectionWrapper) },
                { "RandomiseDllHeaders", new RandomiseDllHeaders(_injectionWrapper) }
            };

            var injectionMethodType = Type.GetType(string.Concat("Bleak.Injection.Methods.", injectionMethod.ToString()));

            _injectionMethod = (IInjectionMethod)Activator.CreateInstance(injectionMethodType, _injectionWrapper);

            // Ensure the architecture of the DLL is valid

            ValidationHandler.ValidateDllArchitecture(_injectionWrapper);
        }
Esempio n. 6
0
        internal InjectionManager(InjectionMethod injectionMethod, string processName, byte[] dllBytes)
        {
            _injectionContext = new InjectionContext();

            _injectionWrapper = new InjectionWrapper(injectionMethod, processName, dllBytes);

            _injectionExtensionCache = new Dictionary <string, IInjectionExtension>
            {
                { nameof(EjectDll), new EjectDll(_injectionWrapper) },
                { nameof(HideDllFromPeb), new HideDllFromPeb(_injectionWrapper) },
                { nameof(RandomiseDllHeaders), new RandomiseDllHeaders(_injectionWrapper) }
            };

            var injectionMethodType = Type.GetType("Bleak.Injection.Methods." + injectionMethod);

            _injectionMethod = (IInjectionMethod)Activator.CreateInstance(injectionMethodType, _injectionWrapper);

            // Ensure the architecture of the DLL is valid

            ValidationHandler.ValidateDllArchitecture(_injectionWrapper);
        }