Results 1 to 4 of 4
  1. #1
    aLcohoL_95's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Location
    SatyRicon
    Posts
    685
    Reputation
    8
    Thanks
    291
    My Mood
    Cynical

    [Tutorial]Getting Hashes Codes Of Applications[VB.NET]

    add
    1 button
    1 Textbox

    add this codes to top of public class form1
    [PHP]
    Imports System
    Imports System.IO.FileStream
    Imports System.Security.Cryptography
    Imports System.Text
    Imports System.IO[/PHP]

    And

    Button's Code

    [PHP]
    Dim dialog As New OpenFileDialog
    dialog.CheckFileExists = True
    dialog.CheckPathExists = True
    dialog.ShowDialog()

    Dim provider As New MD5CryptoServiceProvider
    Dim inputStream As New FileStream(dialog.FileName, FileMode.Open, FileAccess.Read, FileShare.Read, &H2000)
    provider.ComputeHash(inputStream)
    Dim hash As Byte() = provider.Hash
    Dim builder As New StringBuilder
    Dim num As Byte
    For Each num In hash
    builder.Append(String.Format("{0:X2}", num))
    Next
    Me.TextBox1.Text = builder.ToString [/PHP]
    Credits : aLcohoL_95(w0rm12)

    CANNIBAL CORPSE P0WNS


  2. #2
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    are you w0rm12? <.< btw its w0rm2.. not w0rm12

    VB.Net Programların HASH Kodunu alma
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  3. #3
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    Not much of a tutorial. Code could be cleaner, too.

    Code:
        Public Function MD5File(ByVal filepath As String) As String
    
            ' open file (as read-only)
            Using reader As New System.IO.FileStream(filepath, IO.FileMode.Open, IO.FileAccess.Read)
                Using md5 As New System.Security.Cryptography.MD5CryptoServiceProvider
    
                    ' hash contents of this stream
                    Dim hash() As Byte = MD5.ComputeHash(reader)
    
                    ' return formatted hash
                    Return ByteArrayToString(hash)
    
                End Using
            End Using
    
        End Function
    
      Private Function ByteArrayToString(ByVal arrInput() As Byte) As String
    
            Dim sb As New System.Text.StringBuilder(arrInput.Length * 2)
    
            For i As Integer = 0 To arrInput.Length - 1
                sb.Append(arrInput(i).ToString("X2"))
            Next
    
    
    
            Return sb.ToString().ToLower
    
        End Function
    Code:
    using opf as new openfiledialog
    opf.showdialog
    msgbox(md5file(opf.filename))
    end using



  4. #4
    aLcohoL_95's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Location
    SatyRicon
    Posts
    685
    Reputation
    8
    Thanks
    291
    My Mood
    Cynical
    Quote Originally Posted by Brinuz View Post
    are you w0rm12? <.< btw its w0rm2.. not w0rm12

    VB.Net Programların HASH Kodunu alma
    yeah its me but it must be w0rm12 bcuz i was born 12 december(12.12)
    and i am from turkey -.- i posted it if u want i can speak turkish

    CANNIBAL CORPSE P0WNS