Upgrade to Pro — share decks privately, control downloads, hide ads and more …

TEPRA Lite ではじめる BLE リバースエンジニアリング / tepra-lite-ble-reverse-engineering

C825832c4fc71ffdfd44905729281fb0?s=47 Takumi Sueda
September 26, 2021
4.3k

TEPRA Lite ではじめる BLE リバースエンジニアリング / tepra-lite-ble-reverse-engineering

第54回 情報科学若手の会 #wakate2021

C825832c4fc71ffdfd44905729281fb0?s=128

Takumi Sueda

September 26, 2021
Tweet

Transcript

  1. TEPRA Lite BLE 54 #wakate 2021 @puhitaku

  2. Takumi Sueda @puhitaku NICT ( ) HOMMA 
 2014 2018

    2020 
 Linux 

  3. TEPRA 3

  4. https://twitter.com/ejo 090 /status/ 425 52 334 04 306 96 448

    4
  5. https://twitter.com/okayan 08 /status/ 7 972 55 664 46 460 10

    89 5
  6. https://twitter.com/okayan 08 /status/ 5 658 60 495 74 418 43

    22 6
  7. 1000 https://www.kingjim.co.jp/products/tepra/ 7

  8. 8

  9. : 9

  10. https://www.kingjim.co.jp/products/tepra/sr 37 0 .html 10

  11. 100 https://www.kingjim.co.jp/products/tepra/sr 37 0 .html 11

  12. 
 
 12

  13. https://www.kingjim.co.jp/products/brand/tepra-pro.html 13

  14. OS 15,000 https://www.kingjim.co.jp/products/brand/tepra-pro.html 14

  15. 1 15

  16. 1 16

  17. TEPRA Lite LR 30 
 TEPRA Lite LR 30 17

  18. TEPRA Lite LR 30 https://www.kingjim.co.jp/sp/lr 3 0 / 18

  19. TEPRA Lite LR 30 https://www.kingjim.co.jp/sp/lr 3 0 / 19

  20. TEPRA Lite LR 30 https://www.kingjim.co.jp/sp/lr 3 0 / 20

  21. TEPRA Lite LR 30 21

  22. TEPRA Lite LR 30 22

  23. TEPRA Lite LR 30 https://www.kingjim.co.jp/products/tepra/sr 37 0 .html 23

  24. TEPRA Lite LR 30 
 24

  25. TEPRA Lite LR 30 25

  26. TEPRA Lite LR 30 26

  27. TEPRA Lite BLE 54 #wakate 2021 @puhitaku

  28. Bluetooth Low Energy (BLE) https://www.kingjim.co.jp/sp/lr 3 0 /feature/index.html 28

  29. 1 . Android APK 2 . BLE sni ff er

    2 BLE 29 Bluefruit LE Sni ff er https://www.switch-science.com/catalog/ 3 34 7 /
  30. PC Bluetooth 2 Bluetooth Bluez Linux BT Python OS 😇

    BLE PC 30
  31. PC Bluetooth API 
 MicroPython Wi-Fi BLE 🥰 BLE 31

    ESPr® Developer 32 https://www.switch-science.com/catalog/ 3 21 0 /
  32. 1 . 2 . BLE Service Characteristic 
 3 .

    4 . 5 . 2 4 6 . API 7 . 32 
 CC BY 2 . 0 https://www. fl ickr.com/photos/inucara/ 4 809 4 81634
  33. 1. 33

  34. 1. 34

  35. 1. Nordic 
 Wireshark sni ff er Python 2 Apple

    Silicon Mac pyenv Python 2 . 7 . 18 pyenv PR macOS + Apple Silicon + pyenv Python 3 Bluefruit LE Sni ff er Python 2 Bluefruit LE Sni ff er macOS (Apple Silicon) 35
  36. 2 . BLE Service 
 Characteristic 36

  37. 2 . GATT Service Characteristic ATT (ATTribute Protocol) 
 512

    Attribute Handle 2 GATT (Generic ATTribute Protocol) 
 Attribute Service Characteristic ATT Service 
 Characteristic 
 Service 
 37 ATT GATT Service Service Declaration Declaration Characteristic Characteristic Declaration Value Descriptor Declaration Value Descriptor Characteristic Characteristic
  38. 2 . GATT Service Characteristic MicroPython Python (REPL) Bluetooth API

    bluetooth import BLE IRQ API gattc_discover_services Service discovery prop_write_without_response Characteristic MicroPython BLE 38
  39. 2 . GATT Service Characteristic 0x180f Battery Service … 0x2a19

    Battery Level Characteristic 0xfff0 TEPRA Lite Service 0xfff1 TEPRA Lite Char. … Notify (RX) 0xfff2 TEPRA Lite Char. … Write Without Response (TX) Service Characteristic 39 Service Characteristic
  40. 2 . GATT Service Characteristic 0x180f Battery Service … 0x2a19

    Battery Level Characteristic 0xfff0 TEPRA Lite Service 0xfff1 TEPRA Lite Char. … Notify (RX) 0xfff2 TEPRA Lite Char. … Write Without Response (TX) Service Characteristic 40 Characteristic
  41. 3. 
 41

  42. 3. 42

  43. 3. 43

  44. 3. 44 0 5

  45. 3. 45 f0 5c = 2 00 03 00 00

    00 00 00 00 = 1 00 03 00 00 00 00 00 00 = 2
  46. 3. 46 00 03 00 00 00 00 00 00

    2 Bytes (word) After 00 00 00 00 00 00 00 03 Before After
  47. 4. 47

  48. 4. 
 48

  49. 4. 1 49

  50. 6. 
 API 50

  51. 6. API 51 0 5 REST API zlib /prints POST

  52. 6. API 52 0 5 CLI Pillow QR

  53. 7. 53

  54. 7. https://github.com/puhitaku/tepra-lite-esp32 54 GitHub

  55. 55

  56. 
 API CLI 56

  57. Bluetooth 
 57 Sni ff er API Bluetooth MicroPython

  58. 
 
 58

  59. None