Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spotify: update sendPong, handle MP3_160_ENC #120

Open
wants to merge 49 commits into
base: master
Choose a base branch
from
Open

spotify: update sendPong, handle MP3_160_ENC #120

wants to merge 49 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Jan 8, 2016


Had a bit of spare time over the holidays to look into this. Apologies for the wall of code (courtesy of Google Closure), it was either that or ~350 lines of pretty random assignments. Anyone manages to cut it down let me know, I'd love to know how.

@LinusU
Copy link
Contributor

LinusU commented Jan 8, 2016

Awesome!

How did you manage to reverse engineer it?

@TooTallNate
Copy link
Owner

Pretty badass 😎

@ghost
Copy link
Author

ghost commented Jan 9, 2016

Cheers guys, @LinusU JPEXS now supporting Alchemy opcode decompilation helped, it would have been a lot more painful to work with the control flow on an unending stream of bytecodes. That cross-referenced with assembly of C++ stdlib allowed all the inlined functions to be removed, leaving what you see in the commit as the main algorithm. Weirdly, there did seem to be a second encryption routine in there that wasn't used, might be something to keep an eye on in the future.

@ghost
Copy link

ghost commented Jan 14, 2016

Haven't done extensive testing yet, but this appears to work fine! Very nice work

novag pushed a commit to novag/spotify.py that referenced this pull request Apr 6, 2016
add lib/crypto.js: handles all key generation and decryption functionality
modify lib/spotify.js: handles sneaky `album_art` messages
modify lib/track.js: `play` now includes decryption transformer in pipeline
modify lib/util.js: added hex2bin and bin2hex helper functions
modify package.json: commit changes require newer `superagent`
@ghost ghost changed the title update sendPong spotify: update sendPong, handle MP3_160_ENC Apr 30, 2016
theSmallNothing and others added 6 commits May 1, 2016 17:25
modify package.json: remove references to `protobuf`
modify lib/schemas.js: remove references to `protobuf`, make `protobufjs` the only parser
remove proto/*.desc: only required for the `protobuf` module
So as it turns out, the old code seems to have taken the very first "album_art" message over to every single track that followed, if an Album or Playlist was fetched.
This code basically runs it through a new Context within the code-execution VM every time one of those messages is being received.
Fix for trying to fetch a whole album / playlist at once.
Fix library method not being able to fetch saved tracks.
@RealZyXeL
Copy link

Is it possible to use part of this code to decrypt 160kb/s MP3s from the Spotify Web-Player or did they changed something in the meantime?

@denysvitali
Copy link
Contributor

I've already tried without success unfortunately. If somebody finds a way to do it cc me please :)

@RealZyXeL
Copy link

Strange... The swf key is definitly the same as before - this was the reason I found this website ;-)

@denysvitali
Copy link
Contributor

I know, but apparently the resulting file is garbage. They may have changed something, or it is me that I'm not good at implementing stuff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.