Advertisement
Guest User

War Dialer Ip Gen

a guest
May 25th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  Public Function Generate()
  2.         ' WriteLine(args.length.ToString)
  3.        '
  4.        'INFO
  5.        ' It will create file if not exist and generates ips.
  6.        ' if the Ip is already on the list it will not re-add it, it will generate a new one and ignore the one already on the list.
  7.        '
  8.        '
  9.        If args.Length = 3 Then
  10.             Dim amount As Integer = 0
  11.  
  12.             Try
  13.                 amount = args(1)
  14.                 Dim outputfile As String = args(2)
  15.                 Dim current As Integer = 0
  16.                 Dim xcurrent As Integer = 0
  17.                 If Not System.IO.File.Exists(outputfile) Then
  18.                     FileOpen(1, outputfile, OpenMode.Output)
  19.                     FileClose(1)
  20.                 End If
  21.                 Dim tlist As New List(Of String)
  22.                 FileOpen(1, outputfile, OpenMode.Input)
  23.                 While Not EOF(1)
  24.                     Dim x = LineInput(1)
  25.                     tlist.Add(x)
  26.                 End While
  27.                 FileClose(1)
  28.                 Dim ip As String = Nothing
  29.                 Dim rn As New Random
  30.                 Do Until current = amount
  31.  
  32.                     Do Until xcurrent = 4
  33.                         Dim n = rn.Next(0, 255)
  34.  
  35.                         ip += n.ToString + "."
  36.                         xcurrent += 1
  37.                     Loop
  38.                     xcurrent = 0
  39.                     Dim finalip As String = ip.TrimEnd(".")
  40.                     ip = Nothing
  41.                     Dim tIP As String = finalip
  42.  
  43.                     If Not tlist.Contains(tIP) Then
  44.                         tlist.Add(tIP)
  45.                         current += 1
  46.                         WriteLine("(" + current.ToString + ") Added: " + tIP)
  47.                     Else
  48.                         WriteLine("(" + current.ToString + ") Failed: " + tIP + "   IP already exist on that list.")
  49.                     End If
  50.                     Threading.Thread.Sleep(20)
  51.                 Loop
  52.                 FileOpen(1, outputfile, OpenMode.Output)
  53.                 For Each x In tlist
  54.                     PrintLine(1, x)
  55.                 Next
  56.                 FileClose(1)
  57.             Catch ex As Exception
  58.                 WriteLine("Argument 1 (Amount), Was not of numeric limits (Numbers only).")
  59.             End Try
  60.         ElseIf args.Length = 2 Then
  61.             WriteLine("Argument 1 (Amount), Was not of numeric limits (Numbers only).")
  62.             WriteLine("Amount of Arguments you put: " + args.length.ToString + ". Amount of Arguments required: 3")
  63.         Else
  64.             WriteLine("Amount of Arguments you put: " + args.length.ToString + ". Amount of Arguments required: 3")
  65.         End If
  66.          FileClose(1)
  67.         Return True
  68.     End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement