Jump to content

[HELP] Visual Basic (2008 Express Edition) Console Program issue


UnKn0wnBooof
Go to solution Solved by UnKn0wnBooof,

Recommended Posts

Hi,

I'm working on the payload "ULTIMATE DATA THEIF!" and the program I developed "Wind.bat" doesn't work on all versions of Windows (I get a VB reg read error) so I've decided to write the program in Visual Basic. However, I cant get the program to print out the Windows product key - It just shows the start dialogue and exits.

Current work:

Imports System

Imports System.IO

Imports Microsoft.Win32

Module Main

Sub Main()

Console.Title = "Lavanoid-Project Wind"

Console.WriteLine("-----------------------------------------------")

Console.WriteLine("LAVANOID-PROJECT -- WIND RECOVERY VERSION: 1.6")

Console.WriteLine("-----------------------------------------------")

Console.WriteLine("Windows Product Key Recovery Tool")

Console.WriteLine()

Console.WriteLine("Press any key to exit.")

End Sub

Public Function sGetXPKey() As String

Dim RegKey As RegistryKey = _

Registry.LocalMachine.OpenSubKey("Software\Microsoft\Windows NT\CurrentVersion", False)

Dim bytDPID() As Byte = RegKey.GetValue("DigitalProductID")

Dim bytKey(14) As Byte '0-14 = 15 bytes

Array.Copy(bytDPID, 52, bytKey, 0, 15)

Dim strChar As String = "BCDFGHJKMPQRTVWXY2346789"

Dim strKey As String = ""

For j As Integer = 0 To 24

Dim nCur As Short = 0

For i As Integer = 14 To 0 Step -1

nCur = CShort(nCur * 256 Xor bytKey(i))

bytKey(i) = CByte(Int(nCur / 24))

nCur = CShort(nCur Mod 24)

Next

strKey = strChar.Substring(nCur, 1) & strKey

Next

For i As Integer = 4 To 1 Step -1

strKey = strKey.Insert(i * 5, "-")

Next

Return strKey

Console.WriteLine(strKey)

Console.ReadKey()

End Function

End Module

Thanks.

Wind.zip

Link to comment
Share on other sites

  • Solution

Euhm just a quick glance. ( not a VB writer ) but you don't call any functions from you main function.

Aaaahh. I've fixed it now. I forgot to call the functions (like you said). I fixed it now. I'm new to the language but I seem to be learning fast.

New code:

Imports System

Imports System.IO

Imports Microsoft.Win32

Module Main

Sub Main()

Console.Title = "Lavanoid-Project Wind"

Console.WriteLine("-----------------------------------------------")

Console.WriteLine("LAVANOID-PROJECT -- WIND RECOVERY VERSION: 1.6")

Console.WriteLine("-----------------------------------------------")

Console.WriteLine("Windows Product Key Recovery Tool")

Console.WriteLine()

Console.WriteLine(GetKeyData)

Console.WriteLine("Press any key to exit.")

Console.ReadKey()

End Sub

Public Function GetKeyData() As String

Dim RegKey As RegistryKey = _

Registry.LocalMachine.OpenSubKey("Software\Microsoft\Windows NT\CurrentVersion", False)

Dim bytDPID() As Byte = RegKey.GetValue("DigitalProductID")

Dim bytKey(14) As Byte '0-14 = 15 bytes

Array.Copy(bytDPID, 52, bytKey, 0, 15)

Dim strChar As String = "BCDFGHJKMPQRTVWXY2346789"

Dim strKey As String = ""

For j As Integer = 0 To 24

Dim nCur As Short = 0

For i As Integer = 14 To 0 Step -1

nCur = CShort(nCur * 256 Xor bytKey(i))

bytKey(i) = CByte(Int(nCur / 24))

nCur = CShort(nCur Mod 24)

Next

strKey = strChar.Substring(nCur, 1) & strKey

Next

For i As Integer = 4 To 1 Step -1

strKey = strKey.Insert(i * 5, "-")

Next

Return strKey

End Function

End Module

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...