SoloCodigo
		Programación General => Visual Basic 6.0 e inferiores => Mensaje iniciado por: Ashitaka en Lunes  7 de Junio de 2004, 17:43
		
			
			- 
				Un cordial saludos a todos los del foro,he estado luchando por decifrar el product key del Windows(sacar el numero de serie) por medio de Visual Basic. Necesito un poco de  :ayuda: para poder terminar mi proyecto y poder  :smartass:  se que es trampa pero ya me desespero ya llevo 5 meses y no lo he podido resolver espero que me puedan auxilar a qui les dejo mi codigo de como lo etsoy realizando
 espero su ayuda que me puedan ofrecer
 
 Private Declare Function RegQueryValueEx Lib "advapi32.dll" Alias _
 "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, _
 ByVal lpReserved As Long, lpType As Long, lpData As Any, lpcbData As Long) As Long
 Private Declare Function RegOpenKey Lib "advapi32.dll" Alias _
 "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
 '"RegOpenKeyB" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
 Private Declare Function RegCloseKey Lib "advapi32.dll" _
 (ByVal hKey As Long) As Long
 
 Private Sub CmdAceptar_Click()
 End
 End Sub
 
 Private Sub Form_Load()
 Dim Usuario As String
 Dim Organizacion As String
 Dim Producto As String
 Dim Licencia As String
 Dim Licencia1 As Long
 Dim Longitud As Long
 Dim Serie As Long
 Dim Tipo As Long
 Dim hKey As Long
 Dim Tipo1 As Boolean
 Dim x As Long
 Dim strTextCodificar As String
 
 
 
 Const HKEY_LOCAL_MACHINE = &H80000002
 Const REG_SZ = &H1
 Const REG_Binary = &H3
 
 
 x = RegOpenKey(HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows NT\CurrentVersion", hKey) 'Linea de código a modificar en caso de error.
 Usuario = Space$(256)
 Longitud = Len(Usuario)
 x = RegQueryValueEx(hKey, "RegisteredOwner", 0, Tipo, ByVal Usuario, Longitud)
 If x = 0 And Tipo = REG_SZ And Longitud > 1 Then
 Usuario = Left$(Usuario, Longitud - 1)
 Else
 Usuario = "Desconocido"
 End If
 
 Organizacion = Space$(256)
 Longitud = Len(Organizacion)
 x = RegQueryValueEx(hKey, "RegisteredOrganization", 0, Tipo, ByVal Organizacion, Longitud)
 If x = 0 And Tipo = REG_SZ And Longitud > 1 Then
 Organizacion = Left$(Organizacion, Longitud - 1)
 Else
 Organizacion = "Desconocido"
 End If
 
 Producto = Space$(256)
 Longitud = Len(Producto)
 x = RegQueryValueEx(hKey, "ProductName", 0, Tipo, ByVal Producto, Longitud)
 If x = 0 And Tipo = REG_SZ And Longitud > 1 Then
 Producto = Left$(Producto, Longitud - 1)
 Else
 Licencia = "Desconocido"
 End If
 
 
 
 Licencia = Space$(256)
 Longitud = Len(Licencia)
 x = RegQueryValueEx(hKey, "LicenseInfo", 0, Tipo, ByVal Licencia, Longitud)
 If x = 0 And Tipo = REG_Binary And Longitud > 1 Then
 Licencia = Left$(Licencia, Longitud - 1)
 Else
 Licencia = "Desconocido"
 End If
 
 
 
 Label1.Caption = "Usuario: " & Usuario
 Label2.Caption = "Empresa: " & Organizacion
 Label3.Caption = "Version del Windows: " & Producto
 Text1.Text = "N° de Serie: " & Licencia
 
 x = RegCloseKey(hKey)
 End Sub
 
 Public Function Crypt(Text As String) As String
 '
 '
 '
 Dim strTempChar As String 'Declaración de la variable
 'Crea un ciclo para cada uno de los caracteres dentro de la cadena
 For i = 1 To Len(Text)
 
 If Asc(Mid$(Text, i, 1)) < 128 Then
 strTempChar = Asc(Mid$(Text, i, 1)) + 128
 ElseIf Asc(Mid$(Text, i, 1)) > 128 Then
 strTempChar = Asc(Mid$(Text, i, 1)) - 128
 End If
 Mid$(Text, i, 1) = Chr(strTempChar)
 
 Next i
 'Indica cual es la funcion de crypt
 Crypt = Text
 '
 End Function
 
 Private Sub cmdDecrypt_Click()
 
 Dim strTextCodificar As String   'Declaracion de la variable
 strTextCodificar = Text1.Text
 Crypt strTextCodificar          'Desencriptacion de la variable
 Text1.Text = strTextCodificar   'Mostrar el resultado de la desencriptación
 Text1.Text = strTextCodificar
 '
 End Sub
 Private Sub cmdDecrypt2_Click()
 
 Dim strTextCodificar As String   'Declaracion de la variable
 strTextCodificar = Text1.Text
 Crypt strTextCodificar          'Desencriptacion de la variable
 Text1.Text = strTextCodificar   'Mostrar el resultado de la desencriptación
 Label4.Caption = strTextCodificar
 '
 End Sub
 
 
 
 Ocupo  4 label, un textbox, 2 commandButton yo tambien segire :lightsabre: para que salga mi proyecto