Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C# 

[TUT]Builder and stub[C#]

This tutorial will show you how to make a very simple builder and stub in C# which can be easily moded for use in your own projects.

Create a new project in visual studio for the builder and set up a form like this:
Spoiler (Click to View)

double click the button and write this code in the handler:
Spoiler (Click to View)
(dont forget to add
Code
System.IO;
to the using statements at the top of the code.)
the code displays a save file dialog and if the user chooses a filepath the stub is copied to it, the string split is used to determine where the info starts and end it can be whatever you want, the text in the textbox is then surrounded in the split, the FileStream is used to access the file and the BinaryWriter actually writes the data, by setting the position to the length + 1 we are writing to the end of file instead of somewhere were it could corrupt the program, the data is then written and the writer is closed.

Now create a new project for the stub only add a label to the form
Spoiler (Click to View)

double click the form and you will be taken to the load method, write this code there:
Spoiler (Click to View)
(dont forget to add
Code
System.IO;
to the using statements at the top of the code again.)
the first line creates a StreamReader at Application.ExecutablePath which is the path of the application running the code, the next lines read the binary data of the file, the last line maybe confusing but i will explain it,
the Enc.Getstring() coverts the binary data into a string of ascii characters, the substring method allows us to create a string from another string by specifying a position in it, for use the index of the split, now we have a string containing just the info we wrote to the file, the replace method replace the split with blank text so we have just what the user wrote in the textbox.

to test it build both projects and paste the stub.exe into the same directory as the builder.
Spoiler (Click to View)

please give feedback and suggestions.
Well done. Its a nice and useful sample and its even working.
;)
(Jul 4, 2010 07:55 AM)Elios Wrote:  Well done. Its a nice and useful sample and its even working.
;)

thanks bro, of course its working lol
bump, come on guys i put (some) effort into this
Can also make a keylogger for this =3
(Jul 5, 2010 10:39 PM)cystem Wrote:  Can also make a keylogger for this =3

yep thats the idea, can be used for bots, keyloggers whatever
Hi mate,
please suggest what to change to transfer 2 or more string content.
I am battling to change it so that I can build a file with "info 1" "info2" etc.
Very nice tutorial killerdoob420.
(Aug 15, 2010 12:52 AM)Elios Wrote:  Hi mate,
please suggest what to change to transfer 2 or more string content.
I am battling to change it so that I can build a file with "info 1" "info2" etc.

Sure here you go change the builder to:
Code
string secondSplit = "-herp-";
string info = split+info1+secondSplit+info2+split;
and in the stub change to
Code
string secondSplit = "-herp-";
string info = Enc.GetString(fileData).Substring(Enc.getString(fileData).IndexOf(split)).Replace(split, "");
string[] infos = info.Split(secondSplit.ToCharArray());
label1.Text = infos[0];
label2.Text = infos[1];
hope that helps
Hi,
looks like I am not winning.
I have changed the builder replacing these old two rows of code with these ones:

Code
string secondSplit = "-herp-";
    string info = secondSplit + textBox1.Text + secondSplit + textBox2.Text + secondSplit;

and also replaced the relevant code in the stub with this one:

Code
string secondSplit = "-herp-";
string info = Enc.GetString(fileData).Substring(Enc.GetString(fileData).IndexOf(secondSplit)).Replace(secondSplit, "");
    string[] infos = info.Split(secondSplit.ToCharArray());
    label1.Text = infos[0];
    label2.Text = infos[1];

The result I got in the generated file is a disaster. Lol.
Am I doing something wrong?
So, looks like there are no answers for this problem
(bumping).
Code
string secondSplit = "-herp-";
    string info = secondSplit + textBox1.Text + secondSplit + textBox2.Text + secondSplit;
should be
Code
string secondSplit = "-herp-";
    string info = split + textBox1.Text + secondSplit + textBox2.Text + split;

and this
Code
string secondSplit = "-herp-";
string info = Enc.GetString(fileData).Substring(Enc.GetString(fileData).IndexOf(secondSplit)).Replace(secondSplit, "");
    string[] infos = info.Split(secondSplit.ToCharArray());
    label1.Text = infos[0];
    label2.Text = infos[1];
should be:
Code
string secondSplit = "-herp-";
string info = Enc.GetString(fileData).Substring(Enc.GetString(fileData).IndexOf(split)).Replace(split, "");
    string[] infos = info.Split(secondSplit.ToCharArray());
    label1.Text = infos[0];
    label2.Text = infos[1];

see you have to different splits one to separate the info from the file and the second one to split up the details in the info
bringing some of my old tuts up
Be awesome if [censored] hadn't deleted the pics =)
Yep, if I ever get Leet ill re-up all the images in my tutorials.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C] by SIM-4717218Aug 21, 2020 11:33 AM 0 160 Aug 21, 2020 11:33 AM
Last Post: SIM-4717218
[C] by jBarrelFeb 14, 2020 03:47 AM 11 398 Feb 14, 2020 03:47 AM
Last Post: Backbone
[C] by jimcola99Jan 14, 2020 03:29 PM 1 185 Jan 14, 2020 03:29 PM
Last Post: akali