Hallo zusammen,
habe folgendes Script:
mein Script
#cs ----------------------------------------------------------------------------
[/autoit] [autoit][/autoit] [autoit]AutoIt Version: 3.3.6.0
Author: Florian Kurrle
Sript Version: 2.1
Version: 1.0-The main features were developed
2.0-English is mainlanguage and now the buttons are icons and look how a real code-pad
2.1-The time-function was developed
2.2-The script use a dll with icons, that install itself
2.3-Encryption-function is included now.
Script Function:
Creates a Window, where you can enter a PIN with your mouse and which can output the PIN as variable
Syntax: _PIN_Win([left[, top[, timeout[, PWCode]]]])
timeout = the time after that the window will be closed in milliseconds
use left=-1 and top=-1, or don't write anything there, to create the window in center
PWCode = the code with that the PIN will be encryptet (the script use _StringEncrypt for this operation)
Return values: Success 1
Failure 0 and set @error to 1. This can happend only when there beeing passed wrong parameters.
Usage: #include <PINPad\PINPad.au3> (at first you must copy the hole folder in the standart include-folder)
or
#include "[path\]PINPad.au3" (you must enter the path to the script)
$_PIN is the entered PIN
When you press the E-button, you delete the entered PIN
When you press the C-butto, you confirm the entered PIN
Acknowledgments: BugFix for his function wich that I can temporarily create a file by binary: https://autoit.de/index.php?page…99705#post99705
[/autoit] [autoit][/autoit] [autoit]#ce ----------------------------------------------------------------------------
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>
#include <String.au3>
#include-once
;Declares the glabal variables
Global $_PIN, $_PIN_Crypto
#Region Install-_PINPad_Icons.dll
[/autoit] [autoit][/autoit] [autoit]Local $data = ""
$data &= "0x4D5A90000300000004000000FFFF0000B800000000000000400000000000000000000000000000000000000000000000000000000000000000000000B00000000E1FBA0E00B409CD21B8014CCD21546869732070726F6772616D2063616E6E6F742062652072756E20696E20444F53206D6F64652E0D0D0A2400000000000000F92D54D9BD4C3A8ABD4C3A8ABD4C3A8A9A8A468ABC4C3A8A9A8A428ABC4C3A8A52696368BD4C3A8A0000000000000000504500004C01010095E01F470000000000000000E00002210B0108000000000000D00000000000000000000000100000001000000000400000100000000200000600000006000000060000000000000000E0000000020000A9210100030040050000040000100000000010000010000000000000100000000000000000000000000000000000000000100000FCCE000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002E72737263000000FCCE00000010000000D0000000020000000000000000000000000000400000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030003000000280000800E00000098000080100000000801008000000000000000000000000000000C0032000000200100803300000038010080340000005001008035000000680100803600000080010080370000009801008038000000B001008039000000C80100803A000000E00100803B000000F80100803C000000100200803D000000280200800000000000000000000000000C00000008050080400200800E0500805802008014050080700200801A0500808802008020050080A002008026050080B80200802C050080D002008032050080E802008038050080000300803E0500801803008044050080300300804A050080480300800000000000000000000000000000010001000000600300800000000000000000000000000000010000000000780300000000000000000000000000000000010000000000880300000000000000000000000000000000010000000000980300000000000000000000000000000000010000000000A80300000000000000000000000000000000010000000000B80300000000000000000000000000000000010000000000C80300000000000000000000000000000000010000000000D80300000000000000000000000000000000010000000000E80300000000000000000000000000000000010000000000F80300000000000000000000000000000000010000000000080400000000000000000000000000000000010000000000180400000000000000000000000000000000010000000000280400000000000000000000000000000000010000000000380400000000000000000000000000000000010000000000480400000000000000000000000000000000010000000000580400000000000000000000000000000000010000000000680400000000000000000000000000000000010000000000780400000000000000000000000000000000010000000000880400000000000000000000000000000000010000000000980400000000000000000000000000000000010000000000A80400000000000000000000000000000000010000000000B80400000000000000000000000000000000010000000000C80400000000000000000000000000000000010000000000D80400000000000000000000000000000000010000000000E80400000000000000000000000000000000010009040000F804000050150000A81000000000000000000000F8250000A81000000000000000000000A0360000A8100000000000000000000048470000A81000000000000000000000F0570000A8100000000000000000000098680000A8100000000000000000000040790000A81000000000000000000000E8890000A81000000000000000000000909A0000A8100000000000000000000038AB0000A81000000000000000000000E0BB0000A8100000000000000000000088CC0000A8100000000000000000000030DD000014000000000000000000000044DD000014000000000000000000000058DD00001400000000000000000000006CDD000014000000000000000000000080DD000014000000000000000000000094DD0000140000000000000000000000A8DD0000140000000000000000000000BCDD0000140000000000000000000000D0DD0000140000000000000000000000E4DD0000140000000000000000000000F8DD00001400000000000000000000000CDE000014000000000000000000000020DE0000DC000000000000000000000002004200300002004200310002004200320002004200330002004200340002004200350002004200360002004200370002004200380002004200390002004200430002004200450028000000200000004000000001002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000C7C7C700000000000000000000000000BDBDBD1BBDBDBD6ABBBBBBA4B9B9B9CFB7B7B7ECB7B7B7FFB2B2B2FBB1B1B1ECAFAFAFCFAEAEAEA4ADADAD6AAEAEAE1B000000000000000000000000A9A9A90000000000000000000000000000"
$data &= "00000000000000000000000000000000000000000000000000000000000000CACACA000000000094949400C6C6C642C4C4C4A7C2C2C2E3C0C0C0EBBDBDBDF2BABABAF8B7B7B7FCB5B5B5FFB1B1B1FEB0B0B0FCADADADF8AAAAAAF2A8A8A8EBA8A8A8E3A8A8A8A7A9A9A942FFFFFF0000000000A8A8A8000000000000000000000000000000000000000000000000000000000000000000C5C5C5000000000000000000C8C8C829C9C9C997C8C8C8DBC5C5C5F6C2C2C2FFBFBFBFFFBCBCBCFFB9B9B9FFB5B5B5FFB2B2B2FEB1B1B1FFAFAFAFFFACACACFFA9A9A9FFA6A6A6FFA5A5A5FFA4A4A4F6A3A3A3DBA5A5A597ABABAB290000000000000000ADADAD000000000000000000000000000000000000000000C5C5C5000000000000000000CACACA44CDCDCDACCCCCCCF7C9C9C9FFC5C5C5FFC1C1C1FEBEBEBEFEBCBCBCFFB8B8B8FFB4B4B4FFB1B1B1FFB0B0B0FFAFAFAFFFADADADFFABABABFFA7A7A7FEA5A5A5FEA2A2A2FFA0A0A0FFA1A1A1F7A4A4A4ACA8A8A8440000000000000000ABABAB000000000000000000C6C6C600C6C6C6000000000000000000CCCCCC4CCFCFCFC4D0D0D0FFCDCDCDFFC9C9C9FEC5C5C5FFC2C2C2FFBFBFBFFFBCBCBCFFB9B9B9FFB5B5B5FFB3B3B3FFAFAFAFFFB0B0B0FFAFAFAFFFADADADFFAAAAAAFFA6A6A6FFA2A2A2FF9F9F9FFE9E9E9EFFA0A0A0FFA4A4A4C4A8A8A84C0000000000000000ACACAC0000000000D6D6D600D6D6D60000000000CBCBCB3BD2D2D2CED4D4D4FFD1D1D1FFCCCCCCFEC9C9C9FFC7C7C7FFC3C3C3FFC0C0C0FFBDBDBDFFBABABAFFB8B8B8FFB7B7B7FFB0B0B0FFAFAFAFFFB0B0B0FFAEAEAEFFABABABFFA7A7A7FFA3A3A3FFA0A0A0FF9E9E9EFE9D9D9DFFA0A0A0FFA3A3A3CEA8A8A83B00000000A5A5A500000000001212120000000000C1C1C10FD4D4D4BEDADADAFFD7D7D7FFCFCFCFFEC9C9C9FFC8C8C8FFC6C6C6FFC3C3C3FFBFBFBFFFBBBBBBFFB9B9B9FFB8B8B8FFB7B7B7FFB1B1B1FFAFAFAFFFAFAFAFFFADADADFFAAAAAAFFA8A8A8FFA4A4A4FFA2A2A2FFA1A1A1FF9E9E9EFE9C9C9CFF9E9E9EFFA3A3A3BEB0B0B00F00000000B1B1B1000000000000000000CDCDCD92DCDCDCF4DFDFDFFFD7D7D7FECDCDCDFFC8C8C8FFC6C6C6FFC5C5C5FFC2C2C2FFBDBDBDFFB9B9B9FFB6B6B6FFB7B7B7FFB7B7B7FFB1B1B1FFB0B0B0FFAEAEAEFFACACACFFA9A9A9FFA7A7A7FFA5A5A5FFA4A4A4FFA3A3A3FF9F9F9FFF9A9A9AFE999999FF9F9F9FF4A9A9A992000000000000000000000000C1C1C13DD7D7D7E8DFDFDFFFDDDDDDFFD2D2D2FECDCDCDFFD0D0D0FFCACACAFFC1C1C1FFC4C4C4FFC2C2C2FFBCBCBCFFBBBBBBFFB8B8B8FFBCBCBCFFB6B6B6FFB7B7B7FFA8A8A8FFACACACFFAFAFAFFFA6A6A6FFA8A8A8FFA5A5A5FFA0A0A0FF9E9E9EFF999999FE989898FF9B9B9BFFA3A3A3E8B3B3B33D0000000000000000C9C9C9A1DCDCDCF9E0E0E0FFDDDDDDFED3D3D3FFCECECEFFCDCDCDFFC7C7C7FFC8C8C8FFCBCBCBFFBCBCBCFFBDBDBDFFC8C8C8FFB8B8B8FFA5A5A5FFACACACFFB5B5B5FFBBBBBBFFA5A5A5FFA4A4A4FFA3A3A3FFA7A7A7FFA9A9A9FFA3A3A3FF9E9E9EFF9A9A9AFF989898FE999999FFA0A0A0F9AFAFAFA100000000B7B7B71FD1D1D1E5E1E1E1FFE2E2E2FFDCDCDCFFD3D3D3FFCFCFCFFFCBCBCBFFC8C8C8FFCBCBCBFFC9C9C9FFC2C2C2FFC6C6C6FF9B9B9BFF636363FF575757FF5E5E5EFF6D6D6DFFADADADFFAFAFAFFFAFAFAFFFA7A7A7FFA4A4A4FFA7A7A7FFA5A5A5FFA0A0A0FF9B9B9BFF989898FF969696FF9C9C9CFFABABABE5B6B6B61FBEBEBE60D8D8D8F8E5E5E5FFE2E2E2FEDADADAFFD2D2D2FFD0D0D0FFCDCDCDFFC9C9C9FFC6C6C6FFC2C2C2FFC5C5C5FFBDBDBDFF6A6A6AFF585858FF858585FF6E6E6EFF464646FF808080FFA9A9A9FFACACACFFA2A2A2FFA1A1A1FFA3A3A3FFA3A3A3FFA1A1A1FF9D9D9DFF999999FF959595FE999999FFA7A7A7F8B2B2B260C1C1C19FDDDDDDF9E7E7E7FFE1E1E1FFD8D8D8FFD1D1D1FFD1D1D1FFCFCFCFFFC7C7C7FFC3C3C3FFC7C7C7FFC8C8C8FFA1A1A1FF4B4B4BFF858585FFC5C5C5FFB1B1B1FF515151FF565656FFA3A3A3FFA9A9A9FFA3A3A3FFA5A5A5FFA2A2A2FFA0A0A0FFA0A0A0FF9E9E9EFF9A9A9AFF969696FF979797FFA4A4A4F9B0B0B09FC3C3C3CCDFDFDFFCE6E6E6FFDEDEDEFFD6D6D6FFD1D1D1FFD2D2D2FFD1D1D1FFC9C9C9FFC5C5C5FFCFCFCFFFCACACAFF8E8E8EFF424242FFA8A8A8FFBBBBBBFFC9C9C9FF6E6E6EFF434343FFA4A4A4FFAAAAAAFFA9A9A9FFAAAAAAFFA4A4A4FFA0A0A0FFA0A0A0FF9E9E9EFF9C9C9CFF979797FF979797FFA3A3A3FCAFAFAFCCC4C4C4EBE0E0E0FDE6E6E6FFDDDDDDFFD7D7D7FFD3D3D3FFD2D2D2FFD3D3D3FFD0D0D0FFC8C8C8FFC5C5C5FFC2C2C2FF939393FF474747FFB6B6B6FFACACACFFBABABAFF858585FF3F3F3FFF999999FFA3A3A3FFA6A6A6FFAAAAAAFFA6A6A6FFA2A2A2FF9F9F9FFF9E9E9EFF9C9C9CFF979797FF989898FFA4A4A4FDAFAFAFEBC4C4C4FBE0E0E0FEE7E7E7FFDFDFDFFFDADADAFFD5D5D5FFD2D2D2FFCFCFCFFFCECECEFFCDCDCDFFC6C6C6FFBEBEBEFF959595FF3F3F3FFFB4B4B4FFBDBDBDFFB9B9B9FF8A8A8AFF3C3C3CFF909090FFA7A7A7FFA9A9A9FFACACACFFA5A5A5FF9F9F9FFF9F9F9FFF9E9E9EFF9B9B9BFF979797FF989898FFA5A5A5FEAFAFAFFBC4C4C4FBE1E1E1FEE9E9E9FFE1E1E1FFDDDDDDFFD7D7D7FFD2D2D2FFD0D0D0FFC9C9C9FFC8C8C8FFCDCDCDFFC1C1C1FF8F8F8FFF3C3C3CFFB6B6B6FFB4B4B4FFB8B8B8FF818181FF424242FF9B9B9BFFB2B2B2FFA3A3A3FFA5A5A5FFA7A7A7FFA2A2A2"
$data &= ...
... ;gelöscht, wegen zu viel Zeichen
_CreateTmpFile('_PINPad_Icons.dll', $data)
[/autoit] [autoit][/autoit] [autoit];create the dll-file with the icons in the TEMPDIR
Func _CreateTmpFile($sFileName, $sBin)
Local $sFile = @TempDir & "\" & $sFileName
Local $hFileOut = FileOpen($sFile, 18)
FileWrite($hFileOut, Binary($sBin))
FileClose($hFileOut)
Return $sFile
EndFunc ;==>_CreateTmpFile
#EndRegion Install-_PINPad_Icons.dll
[/autoit] [autoit][/autoit] [autoit]#Region GUI/Func
Func _PIN_Win($left = -1, $top = -1, $timeout = "", $PWCode = "")
If Not IsNumber($timeout) And Not $timeout == "" Or $timeout < 0 Then Return SetError(1, 0, 0)
If $left < -1 Or $top < -1 Then Return SetError(1, 0, 0)
Local $btn, $msg, $btn1, $btn2, $btn3, $btn4, $btn5, $btn6, $btn7, $btn8, $btn9, $btn0, $E, $OldCoord, $begin, $enableT, $enableP
$enableT = 1
$enableP = 1
If $timeout == 0 Or $timeout == "" Then $enableT = 0
If $PWCode == "" Then $enableP = 0
$OldCoord = Opt("GUICoordMode", 0)
[/autoit] [autoit][/autoit] [autoit]$_PIN = "" ;PIN beeing deleted
$begin = TimerInit() ;the timer beeing started
GUICreate("", 109.5, 148, $left, $top)
;Button1
$btn1 = GUICtrlCreateButton("", -1, -1, 37, 37, 0x0040)
GUICtrlSetImage(-1, @TempDir & "/_PINPad_Icons.dll", -2)
;Button2
$btn2 = GUICtrlCreateButton("", 37, -1, 37, 37, 0x0040)
GUICtrlSetImage(-1, @TempDir & "/_PINPad_Icons.dll", -3)
;Button3
$btn3 = GUICtrlCreateButton("", 37, -1, 37, 37, 0x0040)
GUICtrlSetImage(-1, @TempDir & "/_PINPad_Icons.dll", -4)
;Button4
$btn4 = GUICtrlCreateButton("", -74, 37, 37, 37, 0x0040)
GUICtrlSetImage(-1, @TempDir & "/_PINPad_Icons.dll", -5)
;Button5
$btn5 = GUICtrlCreateButton("", 37, -1, 37, 37, 0x0040)
GUICtrlSetImage(-1, @TempDir & "/_PINPad_Icons.dll", -6)
;Button6
$btn6 = GUICtrlCreateButton("", 37, -1, 37, 37, 0x0040)
GUICtrlSetImage(-1, @TempDir & "/_PINPad_Icons.dll", -7)
;Button7
$btn7 = GUICtrlCreateButton("", -74, 37, 37, 37, 0x0040)
GUICtrlSetImage(-1, @TempDir & "/_PINPad_Icons.dll", -8)
;Button8
$btn8 = GUICtrlCreateButton("", 37, -1, 37, 37, 0x0040)
GUICtrlSetImage(-1, @TempDir & "/_PINPad_Icons.dll", -9)
;Button9
$btn9 = GUICtrlCreateButton("", 37, -1, 37, 37, 0x0040)
GUICtrlSetImage(-1, @TempDir & "/_PINPad_Icons.dll", -10)
;Button0
$E = GUICtrlCreateButton("", -74, 37, 37, 37, 0x0040)
GUICtrlSetImage(-1, @TempDir & "/_PINPad_Icons.dll", -12)
;E-Button
$btn0 = GUICtrlCreateButton("", 37, -1, 37, 37, 0x0040)
GUICtrlSetImage(-1, @TempDir & "/_PINPad_Icons.dll", -0)
;C-Button (OK-Button)
$btn = GUICtrlCreateButton("", 37, -1, 37, 37, 0x0040)
GUICtrlSetImage(-1, @TempDir & "/_PINPad_Icons.dll", -11)
GUISetState()
;Check which buttons are pressed and react proportionally
$msg = 0
While 1
$msg = GUIGetMsg()
If $msg == $GUI_EVENT_CLOSE Then Exit
Select
Case $msg = $btn
ExitLoop
Case $msg = $btn1
$_PIN &= 1
Case $msg = $btn2
$_PIN &= 2
Case $msg = $btn3
$_PIN &= 3
Case $msg = $btn4
$_PIN &= 4
Case $msg = $btn5
$_PIN &= 5
Case $msg = $btn6
$_PIN &= 6
Case $msg = $btn7
$_PIN &= 7
Case $msg = $btn8
$_PIN &= 8
Case $msg = $btn9
$_PIN &= 9
Case $msg = $btn0
$_PIN &= 0
Case $msg = $E
$_PIN = ""
Case $timeout < TimerDiff($begin) And $enableT == 1
ExitLoop
EndSelect
WEnd
GUIDelete()
Opt("GUICoordMode", $OldCoord)
If $enableP == 1 Then _PIN_Encrypt($PWCode)
EndFunc
#EndRegion GUI/Func
#Region Encryption
Func _PIN_Encrypt($PWCode)
$_PIN_Crypto = _StringEncrypt(1, $_PIN, $PWCode, 5)
EndFunc
Ganz unten benutze ich eine Passwort-Variable. Wird sie automatisch gelöscht oder soll ich das manuell machen?
Zum Verständnis: Das Script ist eine UDF
LG FKFK