Remove Kindle ebook DRM

Non-Textbook/Rented ebooks

Rented Textbooks
To make deDRM work with rented Kindle books, you have to open and find the lines:

if val406 != 0:
raise DrmException(u”Cannot decode library or rented ebooks.”)

Then either comment them out (using #) or remove these two lines. Then deDRM works perfectly with rented eBooks.
Remove Kindle ebook DRM was originally published on Something Different