• Earn real money by being active: Hello Guest, earn real money by simply being active on the forum — post quality content, get reactions, and help the community. Once you reach the minimum credit amount, you’ll be able to withdraw your balance directly. Learn how it works.

Visual Basic Simple .Exe Builder Code

Status
Not open for further replies.

MarkTomato

Glory to Ukraine!
User
Joined
Aug 16, 2014
Messages
13
Reputation
0
Reaction score
365
Points
48
Credits
0
‎10 Years of Service‎
87%
So, here is the code for a simple .exe builder with stub.

Builder: (2 TextBoxes and a Button are needed)

Code:
>Public Class Form1
   Const FileSplit As String = "|level23|"
   Dim stub, text, text2 As String

   Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
       Dim sfd As New SaveFileDialog
       sfd.Filter = "Executables(.exe)|*.exe"
       If sfd.ShowDialog = Windows.Forms.DialogResult.OK Then
           text = TextBox1.Text
           text2 = TextBox2.Text
       Else
           Exit Sub
       End If
       FileOpen(1, System.Windows.Forms.Application.StartupPath & "/Stub.exe", OpenMode.Binary, OpenAccess.Read, OpenShare.Default)
       stub = Space(LOF(1))
       FileGet(1, stub)
       FileClose(1)

       FileOpen(1, sfd.FileName, OpenMode.Binary, OpenAccess.ReadWrite, OpenShare.Default)
       FilePut(1, stub & FileSplit & text & FileSplit & text2)
       FileClose(1)
       End
   End Sub
End Class
Stub: (2 TextBoxes are used)

Code:
>Public Class Form1
   Const FileSplit As String = "|level23|"
   Dim stub, text, text2, opt() As String

   Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
       On Error Resume Next
       FileOpen(1, Application.ExecutablePath, OpenMode.Binary, OpenAccess.Read, OpenShare.Shared)
       stub = Space(LOF(1))
       FileGet(1, stub)
       FileClose(1)



       opt = Split(stub, FileSplit)
       text = opt(1)
       text2 = opt(2)
       TextBox1.Text = text
       TextBox2.Text = text2
   End Sub

End Class
 
Status
Not open for further replies.
Back
Top