(Note: the basic instructions for removing Barnes and Noble DRM remain the same, except the scripts are different. They come from this page. Click on the script you need and then click the Download link next to the raw button. Save the files where you can find them).
So I’ve been purchasing a lot of ebooks lately, but unfortunately the formatting on them is often horrible. There is however no way to to change the formatting on the books because they are protected by DRM. Luckily, most epub files use Adobe ADEPT as the standard DRM, and a nice little writeup has been created by the person who cracked it showing how to use the files.
This is not done as a means of piracy, but rather for reasons of fair use. The first reason is so that the format can be converted, as I’ve read many ebooks that use up half the width of my screen, which is very frustrating. I’ve found that the best ebook format (for the Sony reader anyway) is HTML, which calibre converts and uploads. This format displays perfectly, but it is also open and so you will never find a ebook in this format for sale. The second reason has to do with ownership. When you purchase an ebook from Sony, Amazon, or any other company, the DRM ensures that that company remains in control of that ebook. At any point they can revoke your license to that book. You do not so much own an ebook with DRM as rent it. When you remove the DRM you ensure that your copy of the book stays your copy, and is not taken away from your arbitrarily.
You will first need to install these 2 programs in order to use the scripts: Python 2.6 and PyCrypto.
Now, in my use of these scripts I’ve noticed a few things myself. In windows XP, I have not been able to successfully run the python scripts by double clicking them. Instead, you have to open up a terminal (start>run>cmd and hit enter) and then navigate to the directory where the script is located (CD is the “change directory” command). Let’s say for example the scripts are in My Documents, which is located at c:\Documents and settings\username\My Documents, but your terminal opens in C:\Documents and settings\Administrator. So you would type “cd c:\Documents and settings\username” into the terminal, using the tab key to autocomplete names, hit enter and it will bring you to that directory.
Now you are in the directory where the scripts are located, but that is not enough. If you type the name of the script and hit enter you only get an error message. This is where python comes in. As the instructions on the main site state, you must install python and pycrypto. Once these are installed you type “python ineptkey.pyw” (the script name), and this tells python to run that script. Once the script is run a box appears which retrieves the key file verifying that you do in fact own the ebook. Then you run the command “python ineptepub.pyw” (or insert your script name) which will open a box asking you to locate the key file, the epub file, and specify a title and output location. Most times the keyfile will be found automatically, but if not make a note of where you saved it. Then you can decrypt the ebook, and you will have a perfectly normal epub file sitting in the output directory.
If you would like to get at that and format it, simply change the .epub extension to .zip and open the zip file and extract the contents. the OEPB folder contains all the HTML files, chapter by chapter. You can open this in any editor and fiddle with it to your hearts content. Once you add the html file to calibre, the best ebook library manager out there, it will convert it to a compatible format before uploading it to your device.