Example #1
0
        private void btnInjectSelected_Click(object sender, EventArgs e)
        {
            if (WGH_Core.currentMemoryInterface == null)
            {
                MessageBox.Show("No target is loaded");
                return;
            }

            TerminateIfNeeded();

            StashKey sk = null;

            if (lbStashHistory.SelectedIndex != -1)
            {
                sk = (StashKey)lbStashHistory.SelectedItem;
            }
            else if (lbStockpile.SelectedIndex != -1)
            {
                sk = (StashKey)lbStockpile.SelectedItem;
            }

            if (sk != null)
            {
                WGH_Core.RestoreTarget();

                sk.Run();
                WGH_Executor.Execute();
            }
        }
Example #2
0
        public static bool MergeStashkeys(List <StashKey> sks, bool _stashAfterOperation = true)
        {
            if (sks != null && sks.Count > 1)
            {
                BlastLayer bl = new BlastLayer();
                foreach (StashKey item in sks)
                {
                    bl.Layer.AddRange(item.BlastLayer.Layer);
                }

                StashKey newSk = new StashKey(WGH_Core.GetRandomKey(), bl);
                WGH_Core.ghForm.lbStashHistory.Items.Add(newSk);

                WGH_Core.ghForm.RefreshStashHistory();

                WGH_Core.RestoreTarget();
                newSk.Run();
                WGH_Executor.Execute();

                return(true);
            }
            else
            {
                MessageBox.Show("You need 2 or more items for Merging");
                return(false);
            }
        }
Example #3
0
        public void BlastTarget(int times = 1, bool untilFound = false, bool stashBlastLayer = true)
        {
            if (WGH_Core.currentMemoryInterface is ProcessInterface)
            {
                (WGH_Core.currentMemoryInterface as ProcessInterface).RefreshSize();
            }


            if (WGH_Core.currentMemoryInterface == null)
            {
                MessageBox.Show("No target is loaded");
                return;
            }

            TerminateIfNeeded();

            if (WGH_Core.currentMemoryInterface == null)
            {
                return;
            }


            WGH_Core.RestoreTarget();

            for (int i = 0; i < times; i++)
            {
                var bl = WGH_Core.Blast();

                if (bl != null)
                {
                    WGH_Core.currentStashkey = new StashKey(WGH_Core.GetRandomKey(), bl);

                    if (stashBlastLayer)
                    {
                        DontLoadSelectedStash = true;
                        lbStashHistory.Items.Add(WGH_Core.currentStashkey);
                        lbStashHistory.ClearSelected();
                        lbStashHistory.SelectedIndex = lbStashHistory.Items.Count - 1;
                        lbStockpile.ClearSelected();
                    }

                    if (untilFound)
                    {
                        break;
                    }
                }
            }
            WGH_Executor.Execute();
        }
Example #4
0
        private void btnLoadCorrupt_Click(object sender, EventArgs e)
        {
            BlastLayer bl = new BlastLayer();

            foreach (var item in lbBlastLayer.Items)
            {
                BlastUnit bu = (item as BlastUnit);
                if (bu.IsEnabled)
                {
                    bl.Layer.Add(bu);
                }
            }

            StashKey newSk = (StashKey)sk.Clone();

            newSk.BlastLayer = bl;
            WGH_Core.RestoreTarget();
            newSk.Run();
            WGH_Executor.Execute();
        }
Example #5
0
        private void btnRerollInject_Click(object sender, EventArgs e)
        {
            if (WGH_Core.currentMemoryInterface == null)
            {
                MessageBox.Show("No target is loaded");
                return;
            }

            TerminateIfNeeded();

            StashKey sk = null;


            if (lbStashHistory.SelectedIndex != -1)
            {
                sk = (StashKey)lbStashHistory.SelectedItem;
            }
            else if (lbStockpile.SelectedIndex != -1)
            {
                sk = (StashKey)lbStockpile.SelectedItem;
            }

            if (sk != null)
            {
                StashKey newSk = (StashKey)sk.Clone();
                newSk.Key   = WGH_Core.GetRandomKey();
                newSk.Alias = null;

                WGH_Core.ghForm.DontLoadSelectedStash = true;
                WGH_Core.ghForm.lbStashHistory.Items.Add(newSk);
                WGH_Core.ghForm.lbStashHistory.ClearSelected();
                WGH_Core.ghForm.lbStashHistory.SelectedIndex = WGH_Core.ghForm.lbStashHistory.Items.Count - 1;
                WGH_Core.ghForm.lbStockpile.ClearSelected();


                //TODO: Refactor this properly instead of as a hacky mess
                foreach (BlastUnit bu in newSk.BlastLayer.Layer)
                {
                    var bb = (bu as BlastByte);
                    var bv = (bu as BlastVector);
                    //BAD HACK. USE THIS TO DECTECT IF VECTOR. SORRY I DIDN'T KNOW WHERE TO REFACTOR THIS -NARRY
                    if (bb != null)
                    {
                        if (bb.Type == BlastByteType.SET)
                        {
                            bb.Value = WGH_Core.RND.Next(0, 255);
                        }
                        else if (bb.Type == BlastByteType.ADD || bb.Type == BlastByteType.SUBSTRACT)
                        {
                            int result = WGH_Core.RND.Next(1, 3);
                            switch (result)
                            {
                            case 1:
                                bb.Type = BlastByteType.ADD;
                                break;

                            case 2:
                                bb.Type = BlastByteType.SUBSTRACT;
                                break;
                            }
                        }
                    }
                    if (bv != null)
                    {
                        bv.Values = WGH_VectorEngine.getRandomConstant(WGH_VectorEngine.valueList);
                    }
                }

                WGH_Core.RestoreTarget();

                newSk.Run();
                WGH_Executor.Execute();
            }
        }
Example #6
0
 private void rbExecuteScript_CheckedChanged(object sender, EventArgs e)
 {
     WGH_Executor.RefreshLabel();
 }
Example #7
0
 private void rbExecuteOtherProgram_CheckedChanged(object sender, EventArgs e)
 {
     WGH_Executor.RefreshLabel();
 }
Example #8
0
 private void rbExecuteCorruptedFile_CheckedChanged(object sender, EventArgs e)
 {
     WGH_Executor.RefreshLabel();
 }
Example #9
0
 private void rbNoExecution_CheckedChanged(object sender, EventArgs e)
 {
     WGH_Executor.RefreshLabel();
 }
Example #10
0
 private void btnEditExec_Click(object sender, EventArgs e)
 {
     WGH_Executor.EditExec();
 }