Skip to content

Instantly share code, notes, and snippets.

@notmike101
Created November 10, 2015 19:51
Show Gist options
  • Save notmike101/6007a798763e5a2706d5 to your computer and use it in GitHub Desktop.
Save notmike101/6007a798763e5a2706d5 to your computer and use it in GitHub Desktop.
gInject Keygen
Imports Microsoft.VisualBasic
Imports Microsoft.VisualBasic.CompilerServices
Imports System
Imports System.Collections
Imports System.ComponentModel
Imports System.Diagnostics
Imports System.Drawing
Imports System.IO
Imports System.Management
Imports System.Runtime.CompilerServices
Imports System.Runtime.InteropServices
Imports System.Security.Cryptography
Imports System.Text
Module Module1
Sub Main()
Console.Title = "gInject Keygen"
Console.WriteLine("How to use:")
Console.WriteLine(" Run this program, follow instructions")
Console.WriteLine(" Open Fiddler2 and create an AutoResponse condition for")
Console.WriteLine(" http://wannafucky.eu/quikgmod/checkhwid.php?hwid=")
Console.WriteLine(" In the response document, paste the 'Expected Response' code")
Console.WriteLine(" Log in with the selected username")
Console.WriteLine()
Console.Write("Please input the username you want to use: ")
Dim username As String = Console.ReadLine()
Dim response As String = sha1((username & "fjAMcNVNVNs"))
Console.WriteLine()
Console.WriteLine("HWID: " & Conversions.ToString(popid))
Console.WriteLine("Username: " & username)
Console.WriteLine("Expected Response: " & response)
Console.WriteLine()
Console.WriteLine("The expected response code has been copied to your clipboard.")
My.Computer.Clipboard.SetText(response)
Console.ReadKey()
End Sub
Function CId() As String
Dim enumerator As IEnumerator
Dim str2 As String = "."
Dim objectValue As Object = RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(RuntimeHelpers.GetObjectValue(Interaction.GetObject(("winmgmts:{impersonationLevel=impersonate}!\\" & str2 & "\root\cimv2"), Nothing)), Nothing, "ExecQuery", New Object() {"Select * from Win32_Processor"}, Nothing, Nothing, Nothing))
Dim str3 As String = ""
Try
enumerator = DirectCast(objectValue, IEnumerable).GetEnumerator
Do While enumerator.MoveNext
Dim instance As Object = RuntimeHelpers.GetObjectValue(enumerator.Current)
str3 = Conversions.ToString(Operators.ConcatenateObject((str3 & ", "), NewLateBinding.LateGet(instance, Nothing, "ProcessorId", New Object(0 - 1) {}, Nothing, Nothing, Nothing)))
Loop
Finally
If TypeOf enumerator Is IDisposable Then
TryCast(enumerator, IDisposable).Dispose()
End If
End Try
If (str3.Length > 0) Then
str3 = str3.Substring(2)
End If
Return str3
End Function
Function MBID() As String
Dim str2 As String = String.Empty
Dim query As New SelectQuery("Win32_BaseBoard")
Dim searcher As New ManagementObjectSearcher(query)
Dim obj2 As ManagementObject
For Each obj2 In searcher.Get
str2 = obj2.Item("SerialNumber").ToString
Next
Return str2
End Function
Function popid() As Object
Return (sha1(String.Concat(New String() {CId(), "x&a", MBID(), "xnA", VID("C"), "_hyd"})) & "==")
End Function
Function sha1(ByVal str As String) As String
Dim buffer As Byte() = New SHA1CryptoServiceProvider().ComputeHash(Encoding.ASCII.GetBytes(str))
Dim str2 As String = String.Empty
Dim num As Byte
For Each num In buffer
str2 = (str2 & num.ToString("x2"))
Next
Return str2
End Function
Function VID(Optional ByVal strDriveLetter As String = "C") As String
Dim obj2 As New ManagementObject(String.Format("win32_logicaldisk.deviceid=""{0}:""", strDriveLetter))
obj2.Get()
Return obj2.Item("VolumeSerialNumber").ToString
End Function
End Module
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment