elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Únete al Grupo Steam elhacker.NET


+  Foro de elhacker.net
|-+  Programación
| |-+  Scripting
| | |-+  Modificar .vbs
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: Modificar .vbs  (Leído 2,874 veces)
Skim0

Desconectado Desconectado

Mensajes: 4


Ver Perfil
Modificar .vbs
« en: 31 Mayo 2017, 22:34 pm »

Hola buenas,

Necesitaba hacer que este .vbs me creara el txt si preguntar, no tengo ni idea de .vbs. Intente modificar un par de cosas pero me da errores. El .vbs sirve para obtener el cd-key de windows.  Espero que me podais ayudar. Muchas gracias.


Código
  1. Set WshShell = CreateObject("WScript.Shell")
  2. Key = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\"
  3. DigitalID = WshShell.RegRead(key & "DigitalProductId")
  4.  
  5. ProductName = "Product Name: " & WshShell.RegRead(Key & "ProductName") & vbNewLine
  6. ProductID = "Product ID: " & WshShell.RegRead(Key & "ProductID") & vbNewLine
  7. ProductKey = "Installed Key: " & ConvertToKey(DigitalID)
  8. ProductID = ProductName & ProductID & ProductKey
  9.  
  10. If vbYes = MsgBox(ProductId & vblf & vblf & "Save to a file?", vbYesNo + vbQuestion, "Windows Key Information") then
  11.   Save ProductID
  12. End if
  13.  
  14. Function ConvertToKey(Key)
  15.    Const KeyOffset = 52
  16.    isWin8 = (Key(66) \ 6) And 1
  17.    Key(66) = (Key(66) And &HF7) Or ((isWin8 And 2) * 4)
  18.    i = 24
  19.    Chars = "BCDFGHJKMPQRTVWXY2346789"
  20.    Do
  21.        Cur = 0
  22.        X = 14
  23.        Do
  24.            Cur = Cur * 256
  25.            Cur = Key(X + KeyOffset) + Cur
  26.            Key(X + KeyOffset) = (Cur \ 24)
  27.            Cur = Cur Mod 24
  28.            X = X -1
  29.        Loop While X >= 0
  30.        i = i -1
  31.        KeyOutput = Mid(Chars, Cur + 1, 1) & KeyOutput
  32.        Last = Cur
  33.    Loop While i >= 0
  34.    If (isWin8 = 1) Then
  35.        keypart1 = Mid(KeyOutput, 2, Last)
  36.        insert = "N"
  37.        KeyOutput = Replace(KeyOutput, keypart1, keypart1 & insert, 2, 1, 0)
  38.        If Last = 0 Then KeyOutput = insert & KeyOutput
  39.    End If
  40.    a = Mid(KeyOutput, 1, 5)
  41.    b = Mid(KeyOutput, 6, 5)
  42.    c = Mid(KeyOutput, 11, 5)
  43.    d = Mid(KeyOutput, 16, 5)
  44.    e = Mid(KeyOutput, 21, 5)
  45.    ConvertToKey = a & "-" & b & "-" & c & "-" & d & "-" & e
  46. End Function
  47.  
  48. Function Save(Data)
  49.    Const ForWRITING = 2
  50.    Const asASCII = 0
  51.    Dim fso, f, fName, ts
  52.    fName = "Windows Key.txt"
  53.    Set fso = CreateObject("Scripting.FileSystemObject")
  54.    fso.CreateTextFile fName
  55.    Set f = fso.GetFile(fName)
  56.    Set f = f.OpenAsTextStream(ForWRITING, asASCII)
  57.    f.Writeline Data
  58.    f.Close
  59. End Function


« Última modificación: 31 Mayo 2017, 23:29 pm por Eleкtro » En línea

FurioMoltisanti

Desconectado Desconectado

Mensajes: 39



Ver Perfil
Re: Modificar .vbs
« Respuesta #1 en: 31 Mayo 2017, 22:58 pm »

Que es lo que has intentado? Pon lo que has modificado aunque contenga errores.


En línea

tincopasan


Desconectado Desconectado

Mensajes: 1.286

No es lo mismo conocer el camino que recorrerlo.


Ver Perfil
Re: Modificar .vbs
« Respuesta #2 en: 1 Junio 2017, 02:19 am »

en teoría deberías editar:
Código
  1. If vbYes = MsgBox(ProductId & vblf & vblf & "Save to a file?", vbYesNo + vbQuestion, "Windows Key Information") then
  2.   Save ProductID
  3. End if
  4.  

por:
Código
  1. Save ProductID
  2.  
En línea

Skim0

Desconectado Desconectado

Mensajes: 4


Ver Perfil
Re: Modificar .vbs
« Respuesta #3 en: 1 Junio 2017, 20:37 pm »

Muchas gracias tincopasan, me ha funcionando perfectamente asi.  Gracias de nuevo.
En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Modificar voz
Multimedia
eLiTe 4 7,433 Último mensaje 8 Diciembre 2004, 23:13 pm
por The-skull
Modificar PDF
Programación Visual Basic
Perseus 1 2,382 Último mensaje 22 Julio 2005, 12:36 pm
por Tor
Modificar avi
Multimedia
SatDio 2 2,188 Último mensaje 11 Septiembre 2005, 22:23 pm
por ™Carlos.®
modificar un .exe
Ingeniería Inversa
alba17 6 5,289 Último mensaje 25 Octubre 2005, 22:49 pm
por raul_22
Modificar Grub para modificar propiedades de otros distros
GNU/Linux
Puntoinfinito 7 5,593 Último mensaje 2 Agosto 2012, 01:37 am
por dato000
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines