gui,add,text,x0y0w100h20,项目名
gui,add,edit,x100y0w200h20vname
gui,add,text,x0y20w100h20,账户
gui,add,edit,x100y20w200h20vaccount
Gui,add,Checkbox,x0y40w300h20vlog,记录到数据库
gui,add,edit,x0y60w300h20vpass
Gui,Add,Button,x0y80w300h20ggen,生成密码
Gui,Show,,Thinkai的密码生成器
return
gen:
Gui,Submit,NoHide
md5:=MD5(MD5(name)"@xx@"account);此处为算法32位MD5可以自己改
b:=""
loop14;这里做单数大写处理前十四位
{
c:=SubStr(md5,A_index,1)
if(mod(A_index,2)=1)
StringUpper,c,c
b.=c
}
b.=" ";凑成16位例如,百度可以酌情复制14位的部分限制
GuiControl,,pass,%Clipboard:=b;更新到结果框并复制到剪切板
iflog;通过这个方式记录在你的库里或者写在文件中
URLDownloadToFile,http://xx.com/reg.php?name=%name%&account=?count%,%A_Temp%\xx.tmp
return
GuiClose:
ExitApp
MD5(string,encoding="UTF-8")
{
returnCalcStringHash(string,0x8003,encoding)
}
CalcStringHash(string,algid,encoding="UTF-8",byrefhash=0,byrefhashlength=0)
{
chrlength:=(encoding="CP1200"||encoding="UTF-16")?2:1
length:=(StrPut(string,encoding)-1)*chrlength
VarSetCapacity(data,length,0)
StrPut(string,&data,floor(length/chrlength),encoding)
returnCalcAddrHash(&data,length,algid,hash,hashlength)
}
CalcAddrHash(addr,length,algid,byrefhash=0,byrefhashlength=0)
{
statich:=[0,1,2,3,4,5,6,7,8,9,"a","b","c","d","e","f"]
staticb:=h.minIndex()
hProv:=hHash:=o:=""
if(DllCall("advapi32\CryptAcquireContext","Ptr*",hProv,"Ptr",0,"Ptr",0,"UInt",24,"UInt",0xf0000000))
{
if(DllCall("advapi32\CryptCreateHash","Ptr",hProv,"UInt",algid,"UInt",0,"UInt",0,"Ptr*",hHash))
{
if(DllCall("advapi32\CryptHashData","Ptr",hHash,"Ptr",addr,"UInt",length,"UInt",0))
{
if(DllCall("advapi32\CryptGetHashParam","Ptr",hHash,"UInt",2,"Ptr",0,"UInt*",hashlength,"UInt",0))
{
VarSetCapacity(hash,hashlength,0)
if(DllCall("advapi32\CryptGetHashParam","Ptr",hHash,"UInt",2,"Ptr",&hash,"UInt*",hashlength,"UInt",0))
{
loop%hashlength
{
v:=NumGet(hash,A_Index-1,"UChar")
o.=h[(v>>4) b]h[(v&0xf) b]
}
}
}
}
DllCall("advapi32\CryptDestroyHash","Ptr",hHash)
}
DllCall("advapi32\CryptReleaseContext","Ptr",hProv,"UInt",0)
}
returno
}