Skip to content

Instantly share code, notes, and snippets.

@miyukki
Created October 15, 2011 00:45
Show Gist options
  • Save miyukki/1288787 to your computer and use it in GitHub Desktop.
Save miyukki/1288787 to your computer and use it in GitHub Desktop.
Saving ".vbs" file.
Option Explicit
On Error Resume Next
Dim objWshShell
Dim objFSO
Dim objFile
Set objWshShell = WScript.CreateObject("WScript.Shell")
Set objFSO = WScript.CreateObject("Scripting.FileSystemObject")
If Err.Number = 0 Then
Set objFile = objFSO.OpenTextFile(objWshShell.ExpandEnvironmentStrings("%USERPROFILE%") & "\AppData\Local\GGOOD marketing\NicoGadget\system\_.html")
If Err.Number = 0 Then
getAccountInfo(objFile.ReadAll)
objFile.Close
Else
WScript.Echo "ファイルオープンエラー: " & Err.Description
End If
Else
WScript.Echo "エラー: " & Err.Description
End If
Set objFile = Nothing
Set objFSO = Nothing
Function getAccountInfo(text)
Dim objRE
Dim reMatch
Dim Mail
Dim Password
Set objRE = new RegExp
objRE.IgnoreCase = True
objRE.pattern = "<input value=""(.*?)"" type=""hidden"" name=""mail"" id=""mail"">"
Set reMatch = objRE.Execute(text)
If reMatch.Count > 0 Then
'WScript.Echo reMatch(0).SubMatches.Item(0)
Mail = reMatch(0).SubMatches.Item(0)
End If
objRE.pattern = "<input value=""(.*?)"" type=""hidden"" name=""password"" id=""password"">"
Set reMatch = objRE.Execute(text)
If reMatch.Count > 0 Then
'WScript.Echo reMatch(0).SubMatches.Item(0)
Password = reMatch(0).SubMatches.Item(0)
End If
Set objRE = Nothing
WScript.Echo "メールアドレス: " & Mail & vbCrLf &_
"パスワード: " & Password
End Function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment