gluon / AbletonLive9_RemoteScripts

Unofficial repository for Ableton Live 9 MIDI Remote Scripts by Julien Bayle
http://julienbayle.net/ableton-live-9-midi-remote-scripts/
513 stars 245 forks source link

launchpad script not working on live #1

Closed goncalopp closed 11 years ago

goncalopp commented 11 years ago

Firstly, let me thank you for taking the time to decompile and package this

I'm trying to get the launchpad scripts working on live 9.0.1. The scripts compile correctly, but the launchpad functions correctly as a dumb midi device and nothing more. No buttons light up, no live integration at all.

While I'm not that familiar with python bytecode, I've checked the original live 9.0.1 pyc and the result of compilation of these sources, and while the overall structure is the same, there's some differences between the two.

Which build of live 9 did you decompile? Is it possible that the scripts changed between builds?

self._challenge = Live.Application.get_random_int(0, 400000000) & 2139062143

I was wondering if that magic number was changed. Could you provide some info on how you managed to decompile these?

alandrees commented 11 years ago

i haven't had a chance to look at the live 9 scripts, but afaik the launchpad doesn't require a challenge to work with ableton (unless stuff changed).

On 13-04-09 10:53 PM, Goncalo Pinheira wrote:

Firstly, let me thank you for taking the time to decompile and package this

I'm trying to get the launchpad scripts working on live 9.0.1. The scripts compile correctly, but the launchpad functions correctly as a dumb midi device and nothing more.

While I'm not that familiar with python bytecode, I've checked the original live 9.0.1 pyc and the result of compilation of these sources, and while the overall structure is the same, there's some differences between the two.

Which build of live 9 did you decompile? Is it possible that the scripts changed between builds?

self._challenge = Live.Application.get_random_int(0, 400000000) & 2139062143

I was wondering if that magic number was changed. Could you provide some info on how you managed to decompile these?

— Reply to this email directly or view it on GitHub https://github.com/gluon/AbletonLive9_RemoteScripts/issues/1.

datamafia commented 11 years ago

The Launchpad has a 2 factor authentication. First is the local self challenge. This is a hardware requirement of, essentially, a bit/sysex handshake -- this should be unchanged. Novation would need to update firmware (on the hardware) to change this - did you se any Novation engineers sneaking around your house. Here is a live 9 and live 8 comparison of the 2 form my work and Julien's decompile:

//Live 9

self._challenge = Live.Application.get_random_int(0, 400000000) & 2139062143

def handle_sysex(self, midi_bytes): if len(midi_bytes) == 8: if midi_bytes[1:5] == (0, 32, 41, 6): response = long(midi_bytes[5]) response += long(midi_bytes[6]) << 8 if response == Live.Application.encrypt_challenge2(self._challenge): self._suppress_send_midi = False self.set_enabled(True)

// Live8

self._challenge = (Live.Application.get_random_int(0, 400000000) & 2139062143)

additional def's for LPAD YSYEX

def handle_sysex(self, midi_bytes):
  if (len(midi_bytes) == 8):
    if (midi_bytes[1:5] == (0,32,41,6)):
      response = long(midi_bytes[5])
      response += (long(midi_bytes[6]) << 8)
      if (response == Live.Application.encrypt_challenge2(self._challenge)):
        self._suppress_send_midi = False
        self.set_enabled(True)

Seems identical to me!?!

The second authentication has not been cracked and I can not speak on the implementation. I am not at liberty to disclose how I know this, why I know this, or any details beyond telling you that the source is valid.

In short there is a hardware based handshake that is in place to eliminate knockoff Launchpad units (the company Bheringer entered the conversation). This security protocol has not been cracked as of middle of last year when I tried, via my contacts. The Novation team has a "prize in the office for the first person to crack the code", what ever that may be I can not tell you.

This is important as they might be accessing this in Live 9 where they did not in Live 8.

Here's what I will try when I return to a Launchpad. I will update a baseline script w/Live 9 needs and test the LPad. Please connect with me directly via my GitHub account or via Twitter using the handle @DJNSM.

Some of the critical calls and subclassing is different, so that is the first place to investigate.

If there is not a simple solution I have 2 more routes available. First is to deconstruct the LPad script and second is to call in on my sources for some possible clarification.

--Marc / Data Mafia / DJNSM The Live 9 web app is coming! Watch http://modern.dj/app for details and release.

alandrees commented 11 years ago

Interesting... This is undocumented in the Launchpad programmers reference, and I never used it at all for my launchpad code. I have been out of the loop for a while, and like I said, haven't had a chance to look at the Live 9 decompiles yet, but if I remember correctly there is no challenge required, only for the APC. Maybe newer Launchpads require a challenge though?

datamafia commented 11 years ago

LP is handshake - looks the same. The extra "Weirdness" is undocumented as far as I know. I doubt they will admit to this in any official manner.

The APC's, Lpad, newer MPDs (32 for sure), and a few other units use this method. I have frequently spoken out against this practice. Deaf ears...

datamafia commented 11 years ago

I wanted to let you know that I am hoping to do a live8 to live9 blog post using the Lpad soon. In the mean time I released my universal script for Live9 http://djnsm.com/ableton-live-9-midi-remote-script-for-the-common-man-now-available/ it will be the base for the next Live Control Surface Web App (legacy live8 avail here : http://modern.dj/app )

I will be putting up some posts outlining the changes - I am just tying to make sure I understand all the stuff first.

--Marc / @djnsm