{"id":1419,"date":"2020-05-10T08:48:19","date_gmt":"2020-05-10T07:48:19","guid":{"rendered":"https:\/\/seegras.discordia.ch\/Blog\/?p=1419"},"modified":"2020-05-10T08:48:19","modified_gmt":"2020-05-10T07:48:19","slug":"removing-adobe-drm-from-books","status":"publish","type":"post","link":"https:\/\/seegras.discordia.ch\/Blog\/removing-adobe-drm-from-books\/","title":{"rendered":"Removing Adobe DRM from Books"},"content":{"rendered":"<p>Digital Restrictions Management is an abomination. I try to avoid it, but ever so often you stumble upon something, and you need it in readable, unrestricted form. Turns out, the mechanisms for removing DRM are just as an unholy mess of outdated software and scripts for proprietary systems as the DRM systems themselves.<\/p>\n<p>The first thing you get when stumbling upon Adobe DRM is an <code>.acsm<\/code> (Adobe Content Server Message) file. It&#8217;s an XML that tells Adobe Digital Editions (and Apps that implement it) where to download the data.<\/p>\n<p>Apparently, there&#8217;s several versions of Adobe DRM, and you can enforce an earlier one with a downgrade attack, by using <a href=\"ftp:\/\/ftp.adobe.com\/pub\/adobe\/digitaleditions\/ADE_2.0_Installer.exe\">Adobe Digital Editions 2.01<\/a> for Windows, apparently still available from Adobe, as it&#8217;s the last version to run on Windows Vista and Windows 7.<\/p>\n<p>And yes, you need to create an account at Adobe to use these.<\/p>\n<p>I actually tried ot the newest one (4.5.11) as well. Installation is straightforward:<\/p>\n<pre>WINEPREFIX=~\/.wine.ade4 winetricks corefonts dotnet40; \\\nWINEPREFIX=~\/.wine.ade4 wine ADE_4.5_Installer.exe\n<\/pre>\n<p>According to <a href=\"https:\/\/appdb.winehq.org\/objectManager.php?sClass=version&amp;iId=33276\">winehq.org<\/a> this should work, but upon trying to download anything with it, it returned <code>E_ADEPT_DOCUMENT_TOO_SHORT<\/code>.<\/p>\n<p>ADE 2.01 is a bit trickier, it needs a 32bit wine prefix, and dotnet 3.5, servicepack 1. As 4.5.11 it needs corefonts too.<\/p>\n<pre>WINEARCH=win32 WINEPREFIX=~\/.wine.ade2 winetricks corefonts dotnet35sp1; \\\nWINEPREFIX=~\/.wine.ade2 wine ADE_2.0_Installer.exe\n<\/pre>\n<p>Again according to <a href=\"https:\/\/appdb.winehq.org\/objectManager.php?sClass=version&amp;iId=27978\">winehq.org<\/a> this should work as well, but also returned <code>E_ADEPT_DOCUMENT_TOO_SHORT<\/code>, which might point to some network-problem, winbind-error, crypto-library too new or somesuch. In any case, you can&#8217;t find anything useful by searching for the error.<\/p>\n<p>So I&#8217;ve been looking for other apps, some open source on github or somesuch, that could use <code>.acsm<\/code> files for download. And I found at least one: Aldiko, on Android. It&#8217;s apparently also abandoned, but it still can be found on Google Play. I got myself Aldiko Classic 3.1.3.<\/p>\n<p>Upon loading a .acsm File in Aldiko (from anywhere, basically, I copied some I downloaded with the Browser on my Workstation into <code>\/sdcard\/Download<\/code>), you get prompted to enter your Adobe acocunt; after that it downloads the books to <code>\/sdcard\/eBooks<\/code>. And you can copy over these to any device that has the keys for your adobe account. Like your wine-prefix.<\/p>\n<p>I initially tried to get <a href=\"https:\/\/github.com\/apprenticeharper\/DeDRM_tools\/releases\">DeDRM<\/a> working standalone or with my Calibre on Linux, but it turned out this thing is a collection of dozens of scripts, which all demand python 2.7. Which is EOL, and which no sane person should use aynmore. As you can see from the pull-requests and issues, there&#8217;s some efforts of making these work on contemporary python, but these went nowhere so far (&#8220;Python tests (2.7) failed&#8221; &#8212; duh!).<\/p>\n<p>Also, as it turned out, after I fixed one of the scripts to run with python 3, these things rely on the existence of ADE on your system; and you either need to somehow convert registry-entries or get files from MacOS to get the device key and the licence key. Which then are pumped through some assembler(!) to get a useful <code>.der<\/code> file. All in all, too complicated,<\/p>\n<p>What I did instead was to install <a href=\"https:\/\/www.python.org\/ftp\/python\/2.7\/python-2.7.msi\">python-2.7.msi<\/a>, <a href=\"http:\/\/www.voidspace.org.uk\/downloads\/pycrypto26\/pycrypto-2.6.win32-py2.7.exe\">pycrypto-2.6.win32-py2.7.exe<\/a> and <a href=\"https:\/\/download.calibre-ebook.com\/3.48.0\/calibre-3.48.0.msi\">calibre-3.48.0.msi<\/a> into the wine-prefix and run from there:<\/p>\n<pre>WINEPREFIX=~\/.wine.ade2 wine msiexec \/i python-2.7.msi; \\\nWINEPREFIX=~\/.wine.ade2 wine pycrypto-2.6.win32-py2.7.exe; \\\nWINEPREFIX=~\/.wine.ade2 wine msiexec \/i calibre-3.48.0.msi\n<\/pre>\n<p>Within calibre, finally, in &#8220;preferences -&gt; Plug-ins -&gt; Load Plugin from file&#8221; I installed <code>DeDRM_Plugin.zip<\/code> from <code>DeDRM_tools_6.7.0.zip<\/code>.<\/p>\n<p>The books downloaded with Aldiko on Android and copied over can now be added to the collection in calibre, and have their DRM removed automatically.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Digital Restrictions Management is an abomination. I try to avoid it, but ever so often you stumble upon something, and you need it in readable, unrestricted form. Turns out, the mechanisms for removing DRM are just as an unholy mess of outdated software and scripts for proprietary systems as the DRM systems themselves. The first [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[95,2,96,67],"tags":[114,113,112],"class_list":["post-1419","post","type-post","status-publish","format-standard","hentry","category-android","category-computers","category-ebooks","category-security","tag-adobe-digital-editions","tag-dedrm","tag-drm"],"_links":{"self":[{"href":"https:\/\/seegras.discordia.ch\/Blog\/wp-json\/wp\/v2\/posts\/1419","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/seegras.discordia.ch\/Blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/seegras.discordia.ch\/Blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/seegras.discordia.ch\/Blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/seegras.discordia.ch\/Blog\/wp-json\/wp\/v2\/comments?post=1419"}],"version-history":[{"count":12,"href":"https:\/\/seegras.discordia.ch\/Blog\/wp-json\/wp\/v2\/posts\/1419\/revisions"}],"predecessor-version":[{"id":1431,"href":"https:\/\/seegras.discordia.ch\/Blog\/wp-json\/wp\/v2\/posts\/1419\/revisions\/1431"}],"wp:attachment":[{"href":"https:\/\/seegras.discordia.ch\/Blog\/wp-json\/wp\/v2\/media?parent=1419"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/seegras.discordia.ch\/Blog\/wp-json\/wp\/v2\/categories?post=1419"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/seegras.discordia.ch\/Blog\/wp-json\/wp\/v2\/tags?post=1419"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}