Jump to content
SilviuCS

[VB.NET]How To Make Your Own "File Pumper"

Recommended Posts

Ok, in this tutorial i will explain you about how to make your own file pumper. What is file pumper? If you have a file that is too small, well you can pump it with this program, so it's size will be changed as you wish.

We need some components to be added to our form.
TextBox1
NumericUpDown1
RadioButton1
RadioButton2
Button1
Button2
And set the components.

NumericUpDown1 : [will be used to show how much byte will be added]
Value = 10
Minimum = 10

RadioButton1: [self explanatory]
Text = KiloByte

RadioButton2: [self explanatory]
Text = MegaByte
Checked = true

Button1: [process the pumping]
Text = PUMP !

Button2: [browse the file]
Text: ...

Now, double click on the Button2 and put this code

Dim ofd As New OpenFileDialog
ofd.Filter = "Exe Files|*.exe"
ofd.ShowDialog()
TextBox1.Text = ofd.FileName

this will show up the file dialog when users click the button2

and put this code for the button1

Dim sfd As New SaveFileDialog
sfd.Filter = "Exe Files|*.exe"
sfd.ShowDialog()
Dim filesize As Double = Val(NumericUpDown1.Value)
IO.File.Copy(TextBox1.Text, sfd.FileName)
If RadioButton1.Checked Then
filesize = filesize * 1024
End If
If RadioButton2.Checked Then
filesize = filesize * 1048576
End If
Dim filetopump = IO.File.OpenWrite(sfd.FileName)
Dim size = filetopump.Seek(0, IO.SeekOrigin.[End])
While size < filesize
filetopump.WriteByte(0)
size += 1
End While
filetopump.Close()
MsgBox("Successfully Pumped!")

Source: http://fkn0wned.com

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...