gui, add, text, x0 y0 w100 h20, 项目名 gui, add, edit, x100 y0 w200 h20 vname gui, add, text, x0 y20 w100 h20, 账户 gui, add, edit, x100 y20 w200 h20 vaccount Gui, add, Checkbox, x0 y40 w300 h20 vlog, 记录到数据库 gui, add, edit, x0 y60 w300 h20 vpass Gui, Add, Button, x0 y80 w300 h20 ggen, 生成密码 Gui, Show, , Thinkai的密码生成器 return gen: Gui, Submit, NoHide md5 := MD5(MD5(name) "@xx@" account) ;此处为算法 32位MD5 b:="" loop 14 ;此处做单数位大写处理 前十四位 { c := SubStr(md5,A_index,1) if (mod(A_index,2)=1) StringUpper, c, c b .= c } b .= "++" ;凑成16位 部分限制14位的比如百度就可以酌情复制 GuiControl, , pass, % Clipboard := b ;更新到结果框并复制到剪切板 if log ;此处通过途径记录到你的库里 或者写到文件里 URLDownloadToFile, http://xx.com/reg.php?name=%name%&account=%account%, %A_Temp%xx.tmp return GuiClose: ExitApp MD5(string, encoding = "UTF-8") { return CalcStringHash(string, 0x8003, encoding) } CalcStringHash(string, algid, encoding = "UTF-8", byref hash = 0, byref hashlength = 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) return CalcAddrHash(&data, length, algid, hash, hashlength) } CalcAddrHash(addr, length, algid, byref hash = 0, byref hashlength = 0) { static h := [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, "a", "b", "c", "d", "e", "f"] static b := h.minIndex() hProv := hHash := o := "" if (DllCall("advapi32CryptAcquireContext", "Ptr*", hProv, "Ptr", 0, "Ptr", 0, "UInt", 24, "UInt", 0xf0000000)) { if (DllCall("advapi32CryptCreateHash", "Ptr", hProv, "UInt", algid, "UInt", 0, "UInt", 0, "Ptr*", hHash)) { if (DllCall("advapi32CryptHashData", "Ptr", hHash, "Ptr", addr, "UInt", length, "UInt", 0)) { if (DllCall("advapi32CryptGetHashParam", "Ptr", hHash, "UInt", 2, "Ptr", 0, "UInt*", hashlength, "UInt", 0)) { VarSetCapacity(hash, hashlength, 0) if (DllCall("advapi32CryptGetHashParam", "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("advapi32CryptDestroyHash", "Ptr", hHash) } DllCall("advapi32CryptReleaseContext", "Ptr", hProv, "UInt", 0) } return o }
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。
评论已经关闭