proxmark3-lf-hid-read.lua 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. --
  2. -- Copyright (c) 2019 Clementine Computing LLC.
  3. --
  4. -- This file is part of PopuFare.
  5. --
  6. -- PopuFare is free software: you can redistribute it and/or modify
  7. -- it under the terms of the GNU Affero General Public License as published by
  8. -- the Free Software Foundation, either version 3 of the License, or
  9. -- (at your option) any later version.
  10. --
  11. -- PopuFare is distributed in the hope that it will be useful,
  12. -- but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. -- GNU Affero General Public License for more details.
  15. --
  16. -- You should have received a copy of the GNU Affero General Public License
  17. -- along with PopuFare. If not, see <https://www.gnu.org/licenses/>.
  18. --
  19. local cmds = require('commands')
  20. local getopt = require('getopt')
  21. local bin = require('bin')
  22. local utils = require('utils')
  23. local format=string.format
  24. local floor=math.floor
  25. local os = require("os")
  26. function sleep (a)
  27. local sec = tonumber(os.clock() + a);
  28. while (os.clock() < sec) do
  29. end
  30. end
  31. local function main(args)
  32. print( string.rep('--',30) )
  33. print( string.rep('--',30) )
  34. -- core.console will go async when waiting for the proxmark to return
  35. -- so need to wait for a response (sleep)
  36. core.console('lf hid read')
  37. -- sleep(30) -- run for 30 seconds
  38. os.execute("sleep 30")
  39. print( string.rep('--',30) )
  40. end
  41. main(args)