public override IntPtr Inject(PortableExecutable dll, IntPtr hProcess)
        {
            //same as above, write the temp file and defer to the other Inject methods.
            ClearErrors();
            string path = Utils.WriteTempData(dll.ToArray());
            IntPtr hModule = IntPtr.Zero;
            if (!string.IsNullOrEmpty(path))
            {
                hModule = Inject(path, hProcess);
                try
                {
                    System.IO.File.Delete(path);
                }
                catch { /* nom nom nom */ }

            }
            return hModule;
        }
예제 #2
0
        public override IntPtr Inject(JLibrary.PortableExecutable.PortableExecutable dll, IntPtr hProcess)
        {
            this.ClearErrors();
            string str  = Utils.WriteTempData(dll.ToArray());
            IntPtr zero = IntPtr.Zero;

            if (!string.IsNullOrEmpty(str))
            {
                zero = this.Inject(str, hProcess);
                try
                {
                    File.Delete(str);
                }
                catch
                {
                }
            }
            return(zero);
        }