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

Posts 14 of 4 · Page 1 of 1
[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)
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
Quote Originally Posted by 'Bruno 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
Posts 14 of 4 · Page 1 of 1
This thread is closed for replies.

Tags for this Thread

None

Need help?