According to the SQLite documentation documentation, substr() should be able to act on blobs, in which case its index arguments act on bytes.