Post Reply 
Social Buttons
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to Make A Builder and Stub!
Author Message
Ironside Offline
Site Owner
**********

Trade Count: (0)
Posts: 170
Joined: Nov 2010
Reputation: 7
Post: #1
How to Make A Builder and Stub!
How To Make A Builder And a Stub!
Made By LeG10N


Hello there! today we are going to make a Builder! and a Stub! I know what your thinking, "Why would i want to do this? i just want to program hacking tools!" truth be told, this is the base for most hacking tools! Want to make a keylogger? Then how would you send the user name and password for the gmail to the other program? the easiest way, is with a builder!

If you get any errors. or dont understand somthing, just post your question, I will be happy to help any and every problem that occurs with my Tutorial.

Note: if you dont understand where a function goes. Either download the source at the bottom, Or just look ahead, i will be posting full page of source as i go along.

Requirements to use this tutorial:
some basic knowledge
Visual Basic Express (or Visual Studio)


Well then, now that we have all that, lets get started!

We are going to make a new project. lets call it "Our Builder".

Make your form look like this

[Image: 2r6lmoo.jpg]

What you will need:
1 Button, name it "Generate"
3 textboxes, name them "UsernameBox", "PasswordBox" and "RandomBox"
4 Check Boxes, name them "AntiDebuggerCB", "AntiSantaCB", "AntiNaziCB" and "AntiEverythingCB"


Good so far, double click the button labeled "MAKE ME!", a you should see somthing like this:

Code:
Public Class Form1

    Private Sub Generate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Generate.Click

    End Sub
End Class


Now we need to import System.IO so we don't have to type io.* when we are doing somthing with out files. its just a time saver.
put this on the very top of the code, Above "Public Class Form1"
Code:
Imports System.IO


Now lets make our strings, these will go right after "Public Class Form1"

lets make a constant. this will be used so when we split the file on the other side. It tells the command we are going to call later, how to split the file. this needs to be completely unique but still memorable so put this
Code:
Const FileSplit = "--!ZOMG-A-TUTORIAL!--"

Now we need some strings! this will hold all our stuff, right now all we need is somthing to hold the stub in. and the strings for the boxes
Code:
Dim stub, AntiSanta, AntiDebugger, AntiNazi, AntiEverything As String

Our code so far should look like this:
Code:
Imports System.IO
Public Class Form1
    Const FileSplit = "--!ZOMG-A-TUTORIAL!--"
    Dim stub, AntiSanta, AntiDebugger, AntiNazi, AntiEverything As String
    Private Sub Generate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Generate.Click

    End Sub
End Class


As to prevent crashing, lets put all of this inside of a "Try" statement that way, if there is an error. it doesn't just crash. it will tell us the error
Code:
Try
        
Catch ex As Exception
    MsgBox(ex.ToString)
End Try

From here on, everything will go inside the Try statement, that being said, lets open the stub. if you don't know how to do that i'l go through it...if not...i still will

First we need to open our stub:

Code:
FileOpen(1, Application.StartupPath & "\sub.exe", OpenMode.Binary, OpenAccess.Read)

heres how this works:.

Code:
FileOpen(Reference number, file name including the path, mode to open the file as, Mode Of Access)

Reference number: pick a number, this number will be used to call the file, you will see this more in effect later just make sure you dont use the same number twice. when you get more advanced and get to the point that you are opening more then one file at a time. you want to make sure your not opening the wrong file.

File name including the path: This is the path to the file and the name of the file. just like opening a file it needs to know where to open it, the Application.StartupPath is the path that it was started in, we do this to make sure that even if the file is in some random folder, as long as the stub is in the same folder it will still open it

Mode to open the file as: this is fairly simple. since we are opening a binary file, the mode is binary (I've never needed to use the other modes)

Mode Of Access: there are Read, ReadWrite, Write and Default, we are selecting Read, since we don't need to write to the file right now


Our code so far:

Code:
Imports System.IO
Public Class Form1
    Const FileSplit = "--!ZOMG-A-TUTORIAL!--"
    Dim stub, AntiSanta, AntiDebugger, AntiNazi, AntiEverything As String
    Private Sub Generate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Generate.Click

        Try
        
        FileOpen(1, Application.StartupPath & "\sub.exe", OpenMode.Binary, OpenAccess.Read)
        
        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try
    End Sub
End Class

Next we need to make sure the stubs length is the same as the file

Code:
stub = Space(LOF(1))

How this function works:
Code:
Space(Size)
&
LOF(Reference number)
The Space(Size) function fills the string with the amount of bytes as the length specified the LOF(File number) function stands for Length Of File. and it does as it says, it gets the Length of the Specified via the files Reference number

So this command makes the "stub" string the same length as the File specified.



Now that that is done. lets get the file and put it into our "stub" string

Code:
FileGet(1, stub)
How this code works:

Code:
FileGet(Reference Number, String to put file into)
Reference number: should be the number of the file you want to get, because we are getting the file number 1, we will use 1 as the number


String to put file into: this is where we are going to store the file


Now we no longer need the file open so we can close it

Code:
FileClose(1)

How the Code works:
Code:
FileClose(Reference Number)
This is rather simple, if you have caught on so far, we are just closing the file 1, since we have stored it in the "stub" string


Our code so far:
Code:
Imports System.IO
Public Class Form1
    Const FileSplit = "--!ZOMG-A-TUTORIAL!--"
    Dim stub, AntiSanta, AntiDebugger, AntiNazi, AntiEverything As String
    Private Sub Generate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Generate.Click

        Try
        
        FileOpen(1, Application.StartupPath & "\sub.exe", OpenMode.Binary, OpenAccess.Read)
        stub = Space(LOF(1))
        FileGet(Reference Number, String to put file into)
        FileClose(1)
        
        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try
    End Sub
End Class

Awesome! Now the hard part is over....it just gets confusing for some. haha, but don't worry I'll walk you through it.


The way we are passing over our information, I haven't been able to passover anything but strings, (if its possible please tell me)

So we are going to make sure everything that we are passing over is a string

Here is what we are passing over to our stub:
Username (string)
Password (string)
Text in the random box (string)
Check boxes:
anti-debugger (boolean)
anti-santa (boolean)
anti-nazi (boolean)
anti-everything (boolean)

well it looks like we have a small problem, we have 3 items that are ready to be passed over already, however the check boxes are not, as we can not pass boolean values. so lets make some simple code to make sure that we can do this, im not going to explain this. you should get it. im just explaining making the generator. If you have problems with this just post or PM me, I will be happy to help.


Code:
If AntiDebuggerCB.Checked = True Then
     AntiDebugger = "True"
ElseIf AntiSantaCB.Checked = True Then
     AntiSanta = "True"
ElseIf AntiNaziCB.Checked = True Then
      AntiNazi = "True"
ElseIf AntiEverythingCB.Checked = True Then
      AntiEverything = "True"
End If

Our code so far:
Code:
Imports System.IO
Public Class Form1
    Const FileSplit = "--!ZOMG-A-TUTORIAL!--"
    Dim stub, AntiSanta, AntiDebugger, AntiNazi, AntiEverything As String
    Private Sub Generate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Generate.Click

        Try
        
        FileOpen(1, Application.StartupPath & "\sub.exe", OpenMode.Binary, OpenAccess.Read)
        stub = Space(LOF(1))
        FileGet(Reference Number, String to put file into)
        FileClose(1)
        
        If AntiDebuggerCB.Checked = True Then
            AntiDebugger = "True"
        ElseIf AntiSantaCB.Checked = True Then
            AntiSanta = "True"
        ElseIf AntiNaziCB.Checked = True Then
            AntiNazi = "True"
        ElseIf AntiEverythingCB.Checked = True Then
            AntiEverything = "True"
        End If
        
        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try
    End Sub
End Class

OK! now we have everything in string form, lets move on then!

Our next step is to open a new file and save all this information to it. but first, lets make sure that the file isn't there so we don't over write it or cause an error.

Code:
If File.Exists(Application.StartupPath & "\Program.exe") Then
    File.Delete(Application.StartupPath & "\Program.exe")
End If

You should be able to see what this does. if the file we want to make exists it deletes it, that way we aren't writing over a file. and possibly screwing somthing up



So lets open the file, just as before. except this time. we are going to use the OpenMode.ReadWrite option. insted of OpenMode.Read, that way we can actualy write to the file.

Code:
FileOpen(2, Application.StartupPath & "\Program.exe", OpenMode.Binary, OpenAccess.ReadWrite)

Notice that we used a different Reference number. this is because its a different file.



OMG almost done! lets cram alllll this information into this, BUT WAIT! we need to do this a special way. first. note how we save it, as we are not going to have any reference as to what file is what, we have to either remember the order. or copy+paste it some where

So, lets call a FilePut() function (don't let your brain explode....il explain it)

Code:
FilePut(2, stub & FileSplit & UsernameBox.Text & FileSplit & PasswordBox.Text & FileSplit & RandomBox.Text & FileSplit & AntiDebugger & FileSplit & AntiNazi & FileSplit & AntiSanta & FileSplit & AntiEverything)

I know, your thinking "SLOW DOWN LEG10N! I CAN THINK THAT FAST HOLY SHIT!" just take it one step at a time. and relax Smile i'm walking you through it

Heres how the function is called:
Code:
FilePut(Reference Number, String to put in the file)

Clearly the reference number is the number of the file we want to write to, and for us, thats 2 so it points to "Program.exe"

But now for the long..... brain blowing.... crotch popping part.... the string.... Dont be scared. This is just like a normal string.

But to combine all our strings into one. We are adding "FileSplit" in between each one, so that we can split it later. so the "&" char is just like before when opening our stub, it takes two strings and combines them into one. we are just putting them in one area so we dont have to dim a string just for that.

Now that that is done, we can close the file

Code:
FileClose(2)

Same as before, just closeting the file since its written.


ZOMG! we are done with the Generator! lets make a message box to congratulate us!

Code:
MsgBox("WAY TO GO! IT WORKED!")


Our full code:
Code:
Imports System.IO
Public Class Form1
    Const FileSplit = "--!ZOMG-A-TUTORIAL!--"
    Dim stub, AntiSanta, AntiDebugger, AntiNazi, AntiEverything As String
    Private Sub Generate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Generate.Click

        Try
        
        FileOpen(1, Application.StartupPath & "\sub.exe", OpenMode.Binary, OpenAccess.Read)
        stub = Space(LOF(1))
        FileGet(Reference Number, String to put file into)
        FileClose(1)
        
        If AntiDebuggerCB.Checked = True Then
            AntiDebugger = "True"
        ElseIf AntiSantaCB.Checked = True Then
            AntiSanta = "True"
        ElseIf AntiNaziCB.Checked = True Then
            AntiNazi = "True"
        ElseIf AntiEverythingCB.Checked = True Then
            AntiEverything = "True"
        End If
        
        If File.Exists(Application.StartupPath & "\Program.exe") Then
            File.Delete(Application.StartupPath & "\Program.exe")
        End If
        
        FileOpen(2, Application.StartupPath & "\Program.exe", OpenMode.Binary, OpenAccess.ReadWrite)
        FilePut(2, stub & FileSplit & UsernameBox.Text & FileSplit & PasswordBox.Text & FileSplit & RandomBox.Text & FileSplit & AntiDebugger & FileSplit & AntiNazi & FileSplit & AntiSanta & FileSplit & AntiEverything)
        FileClose(2)
        
        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try
    End Sub
End Class

WHOOO!!!! half done! Yes i know its extremely long, but hey, its detailed!

right about now would be a good time to grabs some food, maybe a drink. pr0n...what ever floats your boat.

On to the Stub, just like before make your Stub form look like this:
[Image: 9hktxt.jpg]

the names are as follows:
three labels for the textbox's text, named "UsernameText", "PasswordText" and "RandomText"
Four labels for the Checkbox's, named "AntiDebuggerText", "AntiSantaText", "AntiEverythingText" and "AntiNaziText"

This time instead of double clicking a button, double click the background. you should see somthing like this:
Code:
Public Class Form1

     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    
     End Sub
End Class

now, all of our code is going to go within "Form1_Load", the rest of this will be easy. since we already did it!, The only hard part will be the Split function, well understanding it will be hard for some.

Note: if you have not read the first half, please do so now before continuing

Just like before we need to import System.IO so we dont have to write IO.* infront of what we are doing with the file.
Code:
Imports System.IO

this is extremely important! make sure this is EXACTLY as it is in the other side. or this wont work because we are using this as a spacer to tell Split() how to split the string.
Code:
Const FileSplit = "--!ZOMG-A-TUTORIAL!--"

And before we can do anything. we need to dim us some new strings, you will notice that we have a new thing here. "Settings()", no its not a function, its a string, to be more specific. this is an array. it can hold more then one string, addressed by a number, just like with the files.

Code:
Dim self, Settings() As String

You will notice that this is different. we don't have a button, we are going to do all this while its still starting up. it makes it easier.

Lets open the program. however this time, we are not opening a different file. we are having our program open itself. so instead of typing "Application.StartupPath", since the file could have been renamed, lets type "Application.ExecutablePath" this is the path and the filename to the executable. this makes it alot easyer
Code:
FileOpen(1, Application.ExecutablePath, OpenMode.Binary, OpenAccess.Read)
Just as we did in the builder. lets just open this with the Access mode "Read"

And once again. we need to fill the string with the right amount of bytes. if you need to know how this works. please read the first half of this tutorial
Code:
self = Space(LOF(1))


now we will get the file. but notice something, this time, we are not getting a different file, we are storing our full EXE in a string why is this you may ask? its simple, when use the FilePut() function we put our Stub into the file, but we put more then that! we added all our information to it didn't we? such as the username and password. and our check boxes! and that is appended to the back of our file!
Code:
FileGet(1, self)


Now to close the file.
Code:
FileClose(1)

Our code so far:
Code:
Imports System.IO
Public Class Form1
    Const FileSplit = "--!ZOMG-A-TUTORIAL!--"
    Dim self, Settings() As String
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    
        FileOpen(1, Application.ExecutablePath, OpenMode.Binary, OpenAccess.Read)
        self = Space(LOF(1))
        FileClose(1)
    
    End Sub
End Class

OK OK this is where i am going to confuse a lot of you, we are going to take our "self" string. and split it up, so that we can use it later.
Code:
Settings = Split(self, FileSplit)

Now lets explain how this works, so that you can use this for anything you want.
The function goes as follows:
Code:
Split(String to split, Char or string to split by)

So lets say we have a string that says "We Are LeG10N" and we split it by spaces, the function would be:
Code:
OurString = Split("We Are LeG10N", " ")

To put it simply. the function finds each space, (" ") and splits it there, to break it down into several strings

After that, OurString now has 3 parts. (0), (1), and (2), this will be hard for a lot of new programmers. seeing as most of us count starting at 1, and not 0, but in the programing world 0 the base number.

OurString now has the following strings
Code:
OurString(0) = "We"
OurString(1) = "Are"
OurString(2) = "LeG10N"

And thats exactly how this works for our use, remember how we ordered our FilePut() function? (this is why i said it would be a good idea to copy+paste
Lets review our FilePut() Function.
Code:
FilePut(2, stub & FileSplit & UsernameBox.Text & FileSplit & PasswordBox.Text & FileSplit & RandomBox.Text & FileSplit & AntiDebugger & FileSplit & AntiNazi & FileSplit & AntiSanta & FileSplit & AntiEverything)

OK so the way we ordered this. and since we are splitting this massive string into parts via "FileSplit" we should have 8 strings in Settings() and they are as follows

[qoute]
Settings(0) = our stub (this file)
Settings(1) = the text from our username box
Settings(2) = the text from our password box
Settings(3) = the text from our random box
Settings(4) = the string we made for our Anti-Debugger check box
Settings(5) = the string we made for our Anti-Nazi check box
Settings(6) = the string we made for our Anti-Santa check box
Settings(7) = the string we made for our Anti-Everything check box[/qoute]

So for now we can use this as our reference. so that we don't have to think of this like crazy while we are programing.

Now! since we got the hard part out of the way. lets put out Settings() strings to work!

Code:
UserNameText.Text = Settings(1)
PasswordText.Text = Settings(2)
RandomText.Text = Settings(3)
This should be clear by now, our username text now equals the text we stored from out username text box in the first program. The same thing for the password text and the random text.

We are almost done! using our reference we made, we can make a if then elseif statement!

'from here on it just requires a little thinking. we just piece together what we know so far. and we test the remaining Settings()
'strings to see if they = "True" like we set them to be if it was checked!
If Settings(4) = "True" Then
AntiDebuggerText.Text = "Hey you cant debug me!"
ElseIf Settings(5) = "True" Then
AntiNaziText.Text = "Good, I dont like Nazi's either"
ElseIf Settings(6) = "True" Then
AntiSantaText.Text = "ZOMG! your going to get coal in your stocking!"
ElseIf Settings(7) = "True" Then
AntiEverythingText.Text = "Well in that case. I'm Anti-you!"
End If

Our Final code for this project:
Code:
Imports System.IO
Public Class Form1
    Const FileSplit = "--!ZOMG-A-TUTORIAL!--"
    Dim self, Settings() As String
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    
        FileOpen(1, Application.ExecutablePath, OpenMode.Binary, OpenAccess.Read)
        self = Space(LOF(1))
        FileClose(1)
    
        Settings = Split(self, FileSplit)
    
        UserNameText.Text = Settings(1)
        PasswordText.Text = Settings(2)
        RandomText.Text = Settings(3)
        
    If Settings(4) = "True" Then
        AntiDebuggerText.Text = "Hey you cant debug me!"
    ElseIf Settings(5) = "True" Then
        AntiNaziText.Text = "Good, I dont like Nazi's either"
    ElseIf Settings(6) = "True" Then
        AntiSantaText.Text = "ZOMG! your going to get coal in your stocking!"
    ElseIf Settings(7) = "True" Then
        AntiEverythingText.Text = "Well in that case. I'm Anti-you!"
    End If

    End Sub
End Class

HOLY PROGRAMMER BATMAN! WHERE DONE! haha, good work! you finished a Builder and a stub!
12-28-2010 01:31 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: