看看这可以不?
#include <bk-logfile.au3>
Func Decrypt($password)
Local $Return
$magic = StringSplit("121,65,51,54,122,65,52,56,100,69,104,102,114,118,103,104,71,82,103,53,55,104,53,85,108,68,118,51", ",")
$chrlast = Number("&H" & StringMid($password, 1, 2)) ;; $password 10
$magicnum = 0
For $X = 3 To StringLen($password) Step 2 ;; ( 2)
$chrtmp = Number("&H" & StringMid($password, $X, 2)) ;; $password 10
$chrresultb = ($chrtmp Xor $magic($magicnum))- Number($chrlast) ;;xor $password 10
msgbox $chrresultb
If $chrresultb > 255 or $chrresultb 27 Then
$magicnum = 0 ;; 27 0 121
EndIf
Next
$Return = $pwdtmp
Return $Return
EndFunc
_WriteLog (Decrypt("CB85F6197BCA40"))
..................................................................................................
bk-logfile.au3
.........................
#include-once
#include <Constants.au3>
#include <Misc.au3>
#include <Date.au3>
#include <bk-account.au3>
AutoItSetOption("MustDeclareVars", 1)
AutoItSetOption("RunErrorsFatal", 0)
Global $intLogFile
; Create log file
Func _OpenLogFile($strPath="",$strFilename="",$strHeader="",$strInfos="")
If StringLen($strPath)=0 Then $strPath = @ScriptDir
If StringLen($strFilename)=0 Then $strFilename = StringReplace(StringReplace(@ScriptName,"exe","log"),"au3","log")
DirCreate($strPath)
$intLogFile = FileOpen($strPath & "\" & $strFilename, 2)
If StringLen($strHeader)>0 Then
FileWriteLine($intLogFile, $strHeader)
FileWriteLine($intLogFile, "Computer: " & @Computername)
FileWriteLine($intLogFile, "CPU: " & StringStripWS(regRead("HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0", "processornamestring"),3))
FileWriteLine($intLogFile, "OS: " & @OSVersion)
FileWriteLine($intLogFile, "OS Language: " & @OSLang)
FileWriteLine($intLogFile, "OS Version: " & @OSBuild & "." & @OSServicePack)
FileWriteLine($intLogFile, "Logon Domain: " & @LogonDomain & " (" & @LogonDNSDomain & ")")
FileWriteLine($intLogFile, "Logon Server: " & @LogonServer)
FileWriteLine($intLogFile, "System dir: " & @SystemDir)
FileWriteLine($intLogFile, "Total memory MB: " & TotalMemory())
FileWriteLine($intLogFile, "User: " & _CurrentUser())
FileWriteLine($intLogFile, "Admin rights: " & _iif (IsAdmin() = 1, "yes", "no"))
FileWriteLine($intLogFile, "Profile dir: " & @UserProfileDir)
FileWriteLine($intLogFile, "Date: " & _NowDate())
FileWriteLine($intLogFile, "Time: " & StringFormat("%02d:%02d:%02d", @HOUR, @MIN, @SEC))
FileWriteLine($intLogFile, $strInfos)
FileWriteLine($intLogFile, "")
FileWriteLine($intLogFile, "Log file:")
EndIf
EndFunc ;==>OpenLogFile
Func TotalMemory()
Local $arrMemory
$arrMemory = MemGetStats()
Return Round(($arrMemory[1] / 1024) + 0.5, 0)
EndFunc ;==>TotalMemory
; Write Message into exporer windows and into the Log
Func _WriteLog($strLogMessage="", $intEmptyLine=0)
Local $strSeperator
If $intLogFile=0 Then _OpenLogFile()
If StringLeft($strLogMessage, 1) <> ">" Then $strSeperator = "- "
FileWriteLine($intLogFile, $strSeperator & $strLogMessage & _iif($intEmptyLine=1,@CRLF,""))
EndFunc ;==>WriteLog
; Close log file
Func _CloseLogFile()
FileClose($intLogFile)
EndFunc ;==>CloseLogFile |