Libgourou : a Free ADEPT protocol implementation

Sunday, 04 July 2021
|
Écrit par
Grégory Soutadé

Two months ago I released a software that can use librmsdk.so from Adobe in order to retrieve ePub files (with Adobe DRM) from ACSM request files. It was the result of a long work of reverse engineering. The main problem with it is that it requires to run on an ARMv7 platform.

When I published it, I felt I can go further, but I was afraid of counter measures or cryptic algorithms that can be used by Adobe. Nevertheless, thanks to all knowledge acquired by my first reverse attempt I decided to try. In the end, Adobe choose to use standard algorithms with no obfuscation (maybe because it's delivered with a full SDK for clients). Plus, the target library wasn't compiled with code optimization \o/.

So I'm pleased to announce the first release of libgourou. It's a Free and Open Source implementation of ADEPT protocol. It supports :

  • Account signIn
  • Device activation
  • ePub download from ACSM request file

In addition to libgourou, two utils acsmdownloader and activate are provided in order to create a new device and download ePub from your favorite UNIX platform (like Linux x86/amd64 !) without any call to Adobe's code (no ADE, no WINE !).

Like RMSDK, it's based on a client/server model were the client has to implement some system specific functions (network, crypto...). It allows the library to be very portable (it's written in C++ 11).

The library by itself is licensed under LGPLv3 and the client (reference implementation) is under BSD license.

I can now tell it : we have a real alternative to ADE for Linux platforms !

Source are available on my forge

Basic usage

Basic usage of utils (you can use precompiled version). First, create a "device"

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD
./utils/adept_activate -u "AdobeID USERNAME"

Then a ./.adept directory is created with all configuration file

To download an ePub/PDF :

./utils/acsmdownloader -f <ACSM_FILE>
#
1
De
Ben in Seattle
, le
01 November 2021 03:11
Hourra! This is fabulous and it actually works. Is libgorou finished or is there yet more to do? By the way, was it intentional that you released it on the Fourth of July? It is a wonderful gift you have given to the world and I can think of no better way to celebrate Liberty than to use libgorou. Merci. Merci beaucoup!
Répondre
Auteur :


e-mail* :


Le commentaire :


#
2
De
Greg
, le
01 November 2021 08:11
Hello Ben,

Current version is complete and has been well tested by a lot of people from mobileread. However, I can still add some features or fix some bugs if found.

For Calibre users, Leseratte has translated my code in Python and build a plugin. It makes things more transparent. From my side, I targeted command line usage and integration in other software (like Koreader).

About Fourth of July, it's purely a chance. Libgourou is the result of a long work I started from beginning of 2021 !

Enjoy
Répondre
Auteur :


e-mail* :


Le commentaire :


#
3
De
michal
, le
17 November 2021 11:11
Thanks for your hard work! I can now delete VirtualBox and ADE!
Répondre
Auteur :


e-mail* :


Le commentaire :


#
4
De
David
, le
20 November 2021 05:11
Would you have any idea of what it would take to support PDFs?

It produces a PDF file with no problems, and if I put it into ineptpdf it seems to load it as a PDF file fine, but fails to decrypt it.

The issue seems to be that it's another format; ineptpdf expects some zlib compressed data under ADEPT_LICENSE, but the PDF has what looks to be 2048 bytes of encrypted data instead (2052 bytes; 2048 bytes of random noise, 2 bytes 0x00, 2 bytes 0xff). Would you know what this is, or if anyone's been able to decode it?

Also, do you know if it's possible to force a downgrade? In verbose mode I see:

> 00 0c targetDevice
> 02 01 00 19 http://ns.adobe.com/adept
> 00 0f softwareVersion
> 02 04 00 06 10.0.4
> 03 01 00 19 http://ns.adobe.com/adept

I'm guessing it's more complicated than just taking the number down, though, since the protocol probably also changed. Is 10.0.4 considered decrypted?
Répondre
Auteur :


e-mail* :


Le commentaire :


#
5
De
Greg
, le
20 November 2021 12:11
Hello,

I tested libgourou with some PDF and version 10.0.4, seems good for me. Don't know if your problem is related to PDF or DRM. Can you read it with your eReader ?

To downgrade protocol version, you can try to update .adept/device.xml (hobbes entry). If it doesn't work, you can try to activate a new device in combination with "--hobbes-version" switch to define your own version.

But I cannot guarantee libgourou will works with a downgraded protocol.

You can send me the output PDF from libgourou AND from ADE, I maybe find the difference between them.
Répondre
Auteur :


e-mail* :


Le commentaire :


Auteur :


e-mail* :


Le commentaire :




* Seulement pour être notifié d'une réponse à cet article
* Only for email notification