Code Monkey home page Code Monkey logo

sportwatch's Introduction

Overview

This project is based on the excellent inroads made by the Dutch university students who wrote this paper (https://www.os3.nl/_media/2013-2014/courses/ccf/smartwatches-hristo-leendert.pdf) and I'm grateful to them for their work. My goal is to replicate their results on my own Nike+ Smartwatch and then begin reading more aggressively from the watch. It's possible that this will fail horribly.

The Problem

While the Dutch paper is excellent about documenting the work they did capturing traffic and performing replay attacks, they did not venture into reverse engineering the packet format. So while I have a tantalizing set of opcodes I can send using trial and error (see below), there is no explanation of why (e.g.) opcode 0x10 must be transmitted as 0x0905B310. This means that when I try to send a fun opcode below, my fun is greatly curtailed by having to rely on static values in the first few bytes I send.

The first byte

Is always fixed at 0x09 in the Dutch paper, but seems to work well set to 0x08 as well. Probably worth exploring some other values for this field.

The second byte

The 2d byte seems to depend on the opcode you're sending. For 0xE7 (test buzzer) a value of 0x01 returns nothing, and a few other low values (0x02 - 0x08) the device returns an array that includes the third byte in the return data.

The third byte

The 3rd byte is returned in an array with "1, 2, [third_byte], lots of zeroes, [third byte]."

The fourth byte

...is the opcode. It's possible that 2nd and 3rd byte together form a lazy 24-bit address (disregarding some other item) and are executing some sort of read action.

Sources

PDF is included in this repo for those who want to play along at home. get-version.py and read-eeprom.py are copied directly from the paper. Also thanks to the author of http://dan3lmi.blogspot.com/2012/10/sniffing-usb-traffic-different.html for bus-comm.py and information on using the lsusb command in linux.

Skeletons

I've forgotten where I encountered the idea of keeping a skeletons file, but here is some technical debt/TODO list for this project.

  • A great deal of the Dutch code is duplicated between routines. Refactor this into initialize.py, pass in the ID strings, get back an addressable object
  • Set up static byte arrays with the known commands in them
  • Try sending some traditional read/write commands to get more config info

Interesting OPCODEs

Here are some interesting commands I found in the commands.xml appendix...

  • 0x03 - Latchup - lock battery
  • 0x04 - bootblock - Go to boot block
  • 0x05 - console-write - wonder what this writes to?
  • 0x09 - upgrade - takes a binary file as an argument
  • 0x10 - eeprom-read - reads from the eeprom, takes a 24-bit address for workout storage
  • 0x10 - eeprom-query - get total bytes of available storage
  • 0x14 - desktop-read
  • 0x15 - desktop-write - not clear why I want to read/write the desktop data block, but I'm in.
  • 0x26 - flags-sync - probably holds stateful flags
  • 0x36 - option-gender - pass a string (not a BOOL or INT!) to this field
  • 0x41 - write-attaboy - probably adds a string to the motivational post-workout 'attaboys'
  • 0x51 - ephemeris-query - get ephemerides info (may have satIDs)
  • 0x53 - gpspatch-query - reads patch level of GPS firmware
  • 0x54 - gpspatch-update - takes a binary, presumably GPS modem firmware! Oooooo...
  • 0xE4 - test-gps - (test no 1-4, satellite ID, and duration)
  • 0xE7 - test-buzzer - (1 = play, 0 = stop) ; (frequency in Hz, optional) ; (duration in ms, optional)
  • 0xEB - test-accel - 1 = sample accelerometer, 0 = exit test

sportwatch's People

Contributors

jurph avatar

Stargazers

Wouter avatar Nelson Miguel avatar David Hsieh avatar Lưu Nghĩa Trần avatar  avatar  avatar Maxx Crawford avatar Mikhail Titov avatar Jakub Ronkiewicz avatar  avatar

Watchers

James Cloos avatar Serge Liskovsky avatar  avatar

sportwatch's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.