Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > Kindle Formats

Notices

Reply
 
Thread Tools Search this Thread
Old 07-07-2008, 02:51 AM   #1
Haidon
Member
Haidon is on a distinguished road
 
Posts: 19
Karma: 69
Join Date: Jul 2008
Device: Sony PRS-505
"invalid PID checksum" when using mobidedrm, even though it IS valid.

I've been trying to use mobidedrm (both 0.0.1 and 0.0.2) to remove the DRM from a number of ebooks that I've purchased for use on my Kindle. The application seems to work properly, and it requests the files and PID to input. However, after doing so, I continuously get the following error message

Quote:
Error: invalid PID checksum
Unfortunately I have entered the correct PID! I have checked and double-checked the PID, and the files will open on the PCs with the software for their respective PIDs, and will not open on other computers. I have two PIDs registered for use with the ebooks and the same error message comes up with each, on all of my files.

I located the directory and inputted the command;
Quote:
python mobidedrm002 inputfile.prc outputfile.prc PID
I renamed the script 'mobidedrm002' in order to make it easier to locate.

I've been trying the command using the terminal in Mac OS X 10.5.3. The majority of my ebooks are purchased for HarperCollins online store, though I plan to purchase books from mobipocket's store if I can get this working. Could this error be a result of my computer, the publisher, or have I been entering something wrong all along?

Any help at all would be greatly appreciated. Thanks.
Haidon is offline   Reply With Quote
Old 07-07-2008, 10:41 AM   #2
wallcraft
reader
wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.
 
wallcraft's Avatar
 
Posts: 6,979
Karma: 5183568
Join Date: Mar 2006
Location: Mississippi, USA
Device: Kindle 3 and Fire
Try putting the PID in quotes. If that does not work, put all the arguments in quotes.
wallcraft is offline   Reply With Quote
Old 07-07-2008, 10:11 PM   #3
Haidon
Member
Haidon is on a distinguished road
 
Posts: 19
Karma: 69
Join Date: Jul 2008
Device: Sony PRS-505
Quote:
Originally Posted by wallcraft View Post
Try putting the PID in quotes. If that does not work, put all the arguments in quotes.
I just tried that then, and the script worked right up to when the same error message came up.

Error: invalid PID checksum

I don't get what's going wrong with it. The script works until it comes up with the error message, and the files open on the applications with their respective PIDs.
Haidon is offline   Reply With Quote
Old 07-07-2008, 10:59 PM   #4
wallcraft
reader
wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.
 
wallcraft's Avatar
 
Posts: 6,979
Karma: 5183568
Join Date: Mar 2006
Location: Mississippi, USA
Device: Kindle 3 and Fire
I suggest going to HarperCollins and finding your PIDs there. Copy one to the "clipboard "and paste it into the command line (however this is done under OS X). So far as I know the PID is always 10 characters long and the last two characters are the checksum (confirming that the 1st 8 are correct). If this works, most likely you have misread a 1 as I or a zero 0 as a O.

MobiPocket does not say how long a PID is (even though it is obvious by inspection), but it does say: incorrect PID message on web site:
Quote:
Problem
You get the "Incorrect PID" message when trying to ente ryour PID on the web site.

Cause
The PID you are entering is incorrect, because some of the characters are confusing.

Solution
Double check every character that can be confusing: 0 (zero) and O, 1 and I etc.
Here "Incorrect PID" is exactly the same as "Error: invalid PID checksum" (since that is what the checksum is for).

If none of this works, Igor kindly provided us with the PID of someones Kindle to test kindlefix.py. So try V176CXM*FZ as the PID. It will fail because this isn't a PID authorized for your ebook, but the point is this PID has a valid checksum and so it should fail with a different error message (Error: no key found. maybe the PID is incorrect).
wallcraft is offline   Reply With Quote
Old 07-09-2008, 02:42 PM   #5
riverhorus
Gnomic Kindler
riverhorus began at the beginning.
 
riverhorus's Avatar
 
Posts: 7
Karma: 30
Join Date: Jul 2008
Location: Ohio, USA
Device: KINDLE
Invalid PID with mobidedrm

Wallcraft,

I'm having the same problem as Haidon and I've carefully checked and rechecked my PID. I took your suggestion and entered the PID provided by Igor. Got the same error message about an "invalid PID checksum." Any other suggestions what might be going on?

Quote:
Originally Posted by wallcraft View Post
I suggest going to HarperCollins and finding your PIDs there. Copy one to the "clipboard "and paste it into the command line (however this is done under OS X). So far as I know the PID is always 10 characters long and the last two characters are the checksum (confirming that the 1st 8 are correct). If this works, most likely you have misread a 1 as I or a zero 0 as a O.

MobiPocket does not say how long a PID is (even though it is obvious by inspection), but it does say: incorrect PID message on web site: Here "Incorrect PID" is exactly the same as "Error: invalid PID checksum" (since that is what the checksum is for).

If none of this works, Igor kindly provided us with the PID of someones Kindle to test kindlefix.py. So try V176CXM*FZ as the PID. It will fail because this isn't a PID authorized for your ebook, but the point is this PID has a valid checksum and so it should fail with a different error message (Error: no key found. maybe the PID is incorrect).
riverhorus is offline   Reply With Quote
Old 07-09-2008, 04:38 PM   #6
riverhorus
Gnomic Kindler
riverhorus began at the beginning.
 
riverhorus's Avatar
 
Posts: 7
Karma: 30
Join Date: Jul 2008
Location: Ohio, USA
Device: KINDLE
mobidrm

Wallcraft,

Just to let you know and anyone else having an invalid PID checksum with MobiDeDRM0.02. I went back to ver 0.01 and had no problem running the program. Something appears to be broken in ver 0.02. The only difference between the two versions that I can see is the following:

Code:
def getSizeOfTrailingDataEntries(ptr, size, flags):
	def getSizeOfTrailingDataEntry(ptr, size):
		bitpos, result = 0, 0
		while True:
			v = ord(ptr[size-1])
			result |= (v & 0x7F) << bitpos
			bitpos += 7
			size -= 1
			if (v & 0x80) != 0 or (bitpos >= 28) or (size == 0):
				return result
	num = 0
	flags >>= 1
	while flags:
		if flags & 1:
			num += getSizeOfTrailingDataEntry(ptr, size - num)
		flags >>= 1		
	return num
riverhorus is offline   Reply With Quote
Old 07-09-2008, 10:57 PM   #7
Haidon
Member
Haidon is on a distinguished road
 
Posts: 19
Karma: 69
Join Date: Jul 2008
Device: Sony PRS-505
Quote:
Originally Posted by wallcraft
I suggest going to HarperCollins and finding your PIDs there. Copy one to the "clipboard "and paste it into the command line (however this is done under OS X). So far as I know the PID is always 10 characters long and the last two characters are the checksum (confirming that the 1st 8 are correct). If this works, most likely you have misread a 1 as I or a zero 0 as a O.
Though there is only one 'I' in the PID I also tried this approach, though it has returned the same error message.

Quote:
Originally Posted by wallcraft View Post
If none of this works, Igor kindly provided us with the PID of someones Kindle to test kindlefix.py. So try V176CXM*FZ as the PID. It will fail because this isn't a PID authorized for your ebook, but the point is this PID has a valid checksum and so it should fail with a different error message (Error: no key found. maybe the PID is incorrect).
I got the other error message when I inputted that PID (Error: no key found. maybe the PID is incorrect).

Quote:
Originally Posted by riverhorus
Just to let you know and anyone else having an invalid PID checksum with MobiDeDRM0.02. I went back to ver 0.01 and had no problem running the program. Something appears to be broken in ver 0.02.
Both version return the same error message unfortunately.

As my attempts to run the script under Mac OS X (my main machines, unfortunately) have failed, I've also tried loading the script through an oldish Windows machine. I read a tutorial explaining that in order to run it it is necessary to create a .bat file with the following:
Quote:
mobidedrm002.py inputfile.prc outputfile.prc PID
pause
This only brings up a message telling me how to use the application:
Quote:
MobiDeDRM v0.02. Copyright <c> 2008 The Dark Reverser
Removes protection from Mobipocker books
Usage:
mobidedrm infile.mobi outfile.mobi PID
After this it just says "Press any key to continue..." and then closes without actually doing anything. Am I doing something wrong the the DOS command?

Once again, thanks for any and all advice!
Haidon is offline   Reply With Quote
Old 07-09-2008, 11:32 PM   #8
wallcraft
reader
wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.
 
wallcraft's Avatar
 
Posts: 6,979
Karma: 5183568
Join Date: Mar 2006
Location: Mississippi, USA
Device: Kindle 3 and Fire
Quote:
Originally Posted by Haidon View Post
I got the other error message when I inputted that PID (Error: no key found. maybe the PID is incorrect).
This is an indication that the script is working, at least for some PIDs. It also indicates that the original PID might be mistyped (or the script may only work on some PIDs).

Quote:
Originally Posted by Haidon View Post
I've also tried loading the script through an oldish Windows machine. I read a tutorial explaining that in order to run it it is necessary to create a .bat file with the following:

This only brings up a message telling me how to use the application:
I don't think you need a .bat file, but in any case the "usage" message is an indication that the script is being called with the wrong number of arguments (i.e. not 3). Some of the arguments may need to be in quotes.
wallcraft is offline   Reply With Quote
Old 07-09-2008, 11:43 PM   #9
pilotbob
Grand Sorcerer
pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.
 
pilotbob's Avatar
 
Posts: 19,566
Karma: 11337367
Join Date: Jan 2007
Location: Tampa, FL USA
Device: Kindle Touch
Quote:
Originally Posted by Haidon View Post
mobidedrm002.py inputfile.prc outputfile.prc PID
pause
You didn't put literally the above in the bat file, did you?

BOb
pilotbob is offline   Reply With Quote
Old 07-11-2008, 04:55 AM   #10
Haidon
Member
Haidon is on a distinguished road
 
Posts: 19
Karma: 69
Join Date: Jul 2008
Device: Sony PRS-505
Quote:
Originally Posted by pilotbob View Post
You didn't put literally the above in the bat file, did you?

BOb
No. I typed in the correct details for the files and the PID. I just used that as an example, as I tried it multiple ways, with and without quotation marks. Unfortunately nothing worked. I can think of no other reason for this to be other than what wallcraft suggested, that the script only works with some (likely most, but not all) PIDs.
Haidon is offline   Reply With Quote
Old 07-18-2008, 08:39 AM   #11
red_dragon
Member
red_dragon is on a distinguished road
 
Posts: 20
Karma: 50
Join Date: Jul 2008
Device: Bebook
You could disable the PID check and examine what mobidedrm expects. After making the changes you have to pass a 8 char PID to the python program:

(Be careful with the indentions)

Code:
	def __init__(self, data_file, pid):
### BEGIN NEW CODE ###
		# Calculate PID checksum if just the first 8 chars are specified
		if len(pid) == 8:
			pid = checksumPid(pid)
			print "Full PID is %s" % pid
### END NEW CODE ###
		if checksumPid(pid[0:-2]) != pid:
			raise DrmException("invalid PID checksum")
		pid = pid[0:-2]

Does it work for you?

If the decrypted result is garbage then your PID is not correct.

-Red Dragon

Last edited by red_dragon; 07-18-2008 at 08:44 AM. Reason: clarification and spelling
red_dragon is offline   Reply With Quote
Old 07-24-2008, 11:21 PM   #12
adinb
RSS &amp;amp; Gadget Addict!
adinb is on a distinguished road
 
adinb's Avatar
 
Posts: 82
Karma: 67
Join Date: May 2005
Location: Albuquerque, NM
Device: Sony PRS-500, iPod Touch, iPhone
Quote:
Originally Posted by red_dragon View Post

Does it work for you?

If the decrypted result is garbage then your PID is not correct.

-Red Dragon
I'm another one experiencing the problem...inserting the code into the python script computed the original checksum (WE) and correctly de-decrypted a couple of test books. (I used V.01 of the script for this testing)
adinb is offline   Reply With Quote
Old 07-25-2008, 03:29 AM   #13
Haidon
Member
Haidon is on a distinguished road
 
Posts: 19
Karma: 69
Join Date: Jul 2008
Device: Sony PRS-505
Quote:
Originally Posted by red_dragon View Post
You could disable the PID check and examine what mobidedrm expects. After making the changes you have to pass a 8 char PID to the python program:

(Be careful with the indentions)

Code:
	def __init__(self, data_file, pid):
### BEGIN NEW CODE ###
		# Calculate PID checksum if just the first 8 chars are specified
		if len(pid) == 8:
			pid = checksumPid(pid)
			print "Full PID is %s" % pid
### END NEW CODE ###
		if checksumPid(pid[0:-2]) != pid:
			raise DrmException("invalid PID checksum")
		pid = pid[0:-2]

Does it work for you?

If the decrypted result is garbage then your PID is not correct.

-Red Dragon
Success!

After adding the above code I managed to get the script working. The original PID still didn't work; strangely it returned a message telling me my 'FULL PID' was something different.

Quote:
FULL PID is ----------
Note: I've blanked out the actual PID. What it suggested above was the same as the actual PID for the first 7 digits, and then with a different last three. MobiDeDRM wouldn't accept it as a PID either.

But when I took the last two digits off the PID, cutting it from 10 digits to 8, as red_dragon's code suggested, it worked flawlessly. It came up with a message similar to the one above, listing my actual PID instead of the incorrect one, and then decoded the file.

I've tried it on a number of files at its worked each time. If anyone else is having the same problem I recommend trying this.

Thanks to everyone who's helped solve this problem!
Haidon is offline   Reply With Quote
Old 07-25-2008, 03:18 PM   #14
adinb
RSS &amp;amp; Gadget Addict!
adinb is on a distinguished road
 
adinb's Avatar
 
Posts: 82
Karma: 67
Join Date: May 2005
Location: Albuquerque, NM
Device: Sony PRS-500, iPod Touch, iPhone
I'm going to go out on a branch here and bet that the "invalid" PIDs were all PID's from PCs (as opposed to "mobile" implementations of mobipocket PID's).

The "Dark Reverser" might want to update his official copy of his script to either diable PID checking or take PC PID checksums into account.

Glad to hear that this little mystery is getting cleared up for everyone w/issues.
adinb is offline   Reply With Quote
Old 07-26-2008, 10:51 AM   #15
wallcraft
reader
wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.
 
wallcraft's Avatar
 
Posts: 6,979
Karma: 5183568
Join Date: Mar 2006
Location: Mississippi, USA
Device: Kindle 3 and Fire
Quote:
Originally Posted by Haidon View Post
But when I took the last two digits off the PID, cutting it from 10 digits to 8, as red_dragon's code suggested, it worked flawlessly. It came up with a message similar to the one above, listing my actual PID instead of the incorrect one, and then decoded the file.
The PID for a Windows PC often (always?) has a $ as the 8th character, and I think this is what is causing the problem. On a Mac (and Linux), but not under Windows, this may be replaced by some other character before the python script even sees its arguments. What actually gets changed is some string starting with $ and this probably does not happen if the $ is last, i.e. when using the new 8-character PID option. There have been reports of success using single quotes around the PID (double quotes don't work), see Mobipocket Decoder Tool, post 120 and subsequent posts. The makes sense because single quotes turns off the command line replacement of $.

Last edited by wallcraft; 07-26-2008 at 10:58 AM.
wallcraft is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
"dx" is not a valid search keyword sushovande Feedback 6 08-15-2010 09:20 PM
PRS-600 "Internal content invalid. Formatting" 600 crash (is it dead ?) zelda_pinwheel Sony Reader 93 02-18-2010 05:27 PM
Classic "Invalid Update" shrktank Barnes & Noble NOOK 4 02-14-2010 06:58 PM
Error help: "Invalid input object: NoneType" MichaelGray ePub 1 02-14-2010 09:16 AM
Error message : "Invalid Format" " Do you want to format your internal memory" narbeauchamp Sony Reader 11 07-22-2009 12:39 PM


All times are GMT -4. The time now is 02:45 AM.


MobileRead.com is a privately owned, operated and funded community.