Advertisement
Reaokn

EasyExploits Code V2

May 15th, 2020
475
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.24 KB | None | 0 0
  1. Movable Form
  2.  
  3. public const int WM_NCLBUTTONDOWN = 0xA1;
  4.         public const int HT_CAPTION = 0x2;
  5.  
  6.         [DllImport("user32.dll")]
  7.         public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
  8.  
  9.         [DllImport("user32.dll")]
  10.         public static extern bool ReleaseCapture();
  11.  
  12.         private void FormMoveable_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
  13.         {
  14.             if (e.Button == MouseButtons.Left)
  15.             {
  16.                 ReleaseCapture();
  17.                 SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
  18.             }
  19.         }
  20.  
  21. List Box
  22.  
  23. => fastColoredTextBox1.Text = File.ReadAllText($"./Scripts/{listBox1.SelectedItem}");
  24.  
  25. (watch parex's video to learn how to use the listbox and refresh code)
  26.  
  27. Refresh Code
  28.  
  29. listBox1.Items.Clear();//Clear Items in the LuaScriptList
  30.            Functions.PopulateListBox(listBox1, "./Scripts", "*.txt");
  31.            Functions.PopulateListBox(listBox1, "./Scripts", "*.lua");
  32.  
  33. Save File
  34.  
  35. SaveFileDialog sfd = new SaveFileDialog();
  36.            sfd.Filter = "Txt Files (*.txt)|*.txt|Lua Files (*.lua)|*.lua|All Files (*.*)|*.*";
  37.            if (sfd.ShowDialog() == DialogResult.OK)
  38.            {
  39.                Stream s = sfd.OpenFile();
  40.                StreamWriter sw = new StreamWriter(s);
  41.                sw.Write(fastColoredTextBox1.Text);
  42.                sw.Close();
  43.            }
  44.  
  45. Execute File
  46.  
  47. OpenFileDialog ef = new OpenFileDialog();
  48.            ef.Filter = "Txt Files (*.txt)|*.txt|Lua Files (*.lua)|*.lua";
  49.  
  50.            if (ef.ShowDialog() == DialogResult.OK)
  51.            {
  52.                api.Execute(ef.FileName);
  53.            }
  54.  
  55. Open File
  56.  
  57. //Skirt
  58.            OpenFileDialog opendialogfile = new OpenFileDialog();
  59.            opendialogfile.Filter = "Lua File (*.lua)|*.lua|Text File (*.txt)|*.txt";
  60.            opendialogfile.FilterIndex = 2;
  61.            opendialogfile.RestoreDirectory = true;
  62.            if (opendialogfile.ShowDialog() != DialogResult.OK)
  63.                return;
  64.            try
  65.            {
  66.                fastColoredTextBox1.Text = "";
  67.                System.IO.Stream stream;
  68.                if ((stream = opendialogfile.OpenFile()) == null)
  69.                    return;
  70.                using (stream)
  71.                    this.fastColoredTextBox1.Text = System.IO.File.ReadAllText(opendialogfile.FileName);
  72.            }
  73.            catch (Exception)
  74.            {
  75.                int num = (int)MessageBox.Show("An unexpected error has occured", "OOF!", MessageBoxButtons.OK, MessageBoxIcon.Information);
  76.  
  77.            }
  78.  
  79.  
  80. Code to put into Functions
  81.  
  82. public static void PopulateListBox(ListBox lsb, string Folder, string FileType)
  83.        {
  84.            DirectoryInfo dinfo = new DirectoryInfo(Folder);
  85.            FileInfo[] Files = dinfo.GetFiles(FileType);
  86.            foreach (FileInfo file in Files)
  87.            {
  88.                lsb.Items.Add(file.Name);
  89.            }
  90.        }
  91.  
  92.  
  93. Execute
  94.  
  95. module.ExecuteScript(fastColoredTextBox1.Text);
  96.  
  97. Define module
  98.  
  99. EasyExploits.Module module = new EasyExploits.Module();
  100.  
  101. Attach
  102.  
  103. module.LaunchExploit();
  104.  
  105. Clear
  106.  
  107. fastColoredTextBox1.Text = "";
  108.  
  109. Open Form2
  110.  
  111. Form2 f2 = new Form2();
  112. f2.ShowDialog();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement