![]() |
#1 |
The Grand Mouse 高貴的老鼠
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 73,737
Karma: 315126578
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Oasis
|
Which Diff/Merge/Patch/Updater tool?
OK, I now have a new patch for MobiDeDRM, to cope with some (all?) of the very small number of books that don't work with 0.04.
After my previous patch instructions, there were several messages suggesting that using a diff program would be a good idea, rather than manual instructions. I have looked. I have not found any diff/merge/patch/updater tool that meet the all requirements. 1. At least Mac OS X 10.4/10.5 and Windows XP/Vista support 2. Handles files with CRLF line endings correctly 3. Free The tool(s) must take File A and File B and produce a File C, and then be able to take File A and File C and produce File B. Suggestions welcome. Please try to ensure your suggestion meets all three requirements. |
![]() |
![]() |
![]() |
#2 |
Member
![]() Posts: 22
Karma: 20
Join Date: Dec 2008
Location: Mass, USA
Device: CyBook Gen3, iPhone, PRS-505 (Blue)
|
We used Kdiff3 with the Mercurial DSCM (Distributed Source Control Management) system aka hg. This is free, works on Mac OS X and Windows (XP for user - don't use Vista)
Requirements: 1. not sure about vista or 10.4 2. Not sure 3. Free Home page: http://kdiff3.sourceforge.net/ sorry about lack of information. We use Xcode with Mercurial now. Cheers, Rick |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Reticulator of Tharn
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 618
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
|
|
![]() |
![]() |
![]() |
#4 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,154
Karma: 3252017
Join Date: Jan 2008
Location: Germany
Device: Pocketbook Touch Lux (623)
|
Seconded. Have it produce a size-optimized, unified diff (Options -ud) and post the results. The unified diff file works both with GNU patch on any of the platforms where it is available/can be compiled, and is also the most easily human-readable of the various diff formats, IMO, so it also works well as instructions for applying the patch manually.
|
![]() |
![]() |
![]() |
#5 | |
The Grand Mouse 高貴的老鼠
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 73,737
Karma: 315126578
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Oasis
|
Because I haven't been able to get diff and patch to work, and checking around this seems to be because it doesn't work with CRLF files. Here's what I get in terminal (Mac OS X 10.5.6). Tell me what I'm doing wrong.
paul:Mobipocket Manipulation pdurrant$ diff -ud MobiDeDRM002.py MObiDeDRM005.py > patch2to5.txt paul:Mobipocket Manipulation pdurrant$ patch -i patch2to5.txt -out MobiDeDRM005new.py MobiDeDRM002.py patch unexpectedly ends in middle of line patch: **** Only garbage was found in the patch input. paul:Mobipocket Manipulation pdurrant$ cat patch2to5.txt --- MobiDeDRM002.py 2008-03-12 20:01:44.000000000 +0000 +++ MObiDeDRM005.py 2008-12-16 21:23:03.000000000 +0000 @@ -4,6 +4,9 @@ # Changelog # 0.01 - Initial version # 0.02 - Huffdic compressed books were not properly decrypted +# 0.03 - Wasn't checking MOBI header length +# 0.04 - Wasn't sanity checking size of data record +# 0.05 - It seems that the extra data flags take two bytes not four import sys,struct,binascii @@ -60,6 +63,8 @@ def getSizeOfTrailingDataEntries(ptr, size, flags): def getSizeOfTrailingDataEntry(ptr, size): bitpos, result = 0, 0 + if size <= 0: + return result while True: v = ord(ptr[size-1]) result |= (v & 0x7F) << bitpos @@ -133,7 +138,11 @@ sect = self.loadSection(0) records, = struct.unpack('>H', sect[0x8:0x8+2]) - extra_data_flags, = struct.unpack('>L', sect[0xF0:0xF4]) + mobi_length, = struct.unpack('>L',sect[0x14:0x18]) + extra_data_flags = 0 + if mobi_length >= 0xE4: + extra_data_flags, = struct.unpack('>H', sect[0xF2:0xF4]) + crypto_type, = struct.unpack('>H', sect[0xC:0xC+2]) if crypto_type != 2: @@ -162,7 +171,7 @@ def getResult(self): return self.data_file -print "MobiDeDrm v0.02. Copyright (c) 2008 The Dark Reverser" +print "MobiDeDrm v0.05. Copyright (c) 2008 The Dark Reverser" if len(sys.argv)<4: print "Removes protection from Mobipocket books" print "Usage:" paul:Mobipocket Manipulation pdurrant$ Quote:
|
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
The Grand Mouse 高貴的老鼠
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 73,737
Karma: 315126578
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Oasis
|
|
![]() |
![]() |
![]() |
#7 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,832
Karma: 11844413
Join Date: Jan 2007
Location: Tampa, FL USA
Device: Kindle Touch
|
Quote:
On my Mac I actually had to convert the file endings to get it to run properly with a shebang. I used [Mac]Vim. BOb |
|
![]() |
![]() |
![]() |
#8 | |
The Grand Mouse 高貴的老鼠
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 73,737
Karma: 315126578
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Oasis
|
Apart from the legality of MobiDeDRM in the USA and possible elsewhere, I'm unhappy about redistributing someone else's code.
I have now come up with a solution I'm happy with - an easy AppleScript for Mac users, and instructions or a diff file for everyone else. :-) See https://www.mobileread.com/forums/sho...d.php?p=309292 Paul Quote:
|
|
![]() |
![]() |
![]() |
#9 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,229
Karma: 543210
Join Date: Feb 2008
Location: Gatlinburg, Tennessee
Device: Kindles: Paperwhite Signature Ed., Oasis 2, Voyage
|
Quote:
![]() Last edited by bwaldron; 12-17-2008 at 06:04 PM. |
|
![]() |
![]() |
![]() |
#10 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,832
Karma: 11844413
Join Date: Jan 2007
Location: Tampa, FL USA
Device: Kindle Touch
|
Quote:
ConvertLit even has it's own web site. Maybe it if was called ConvertMobi and the description was "allows you to convert Mobipocket Reader format eBooks into open format for use with software or devices which are not directly compatible with Mobipocket Reader"... ![]() BOb |
|
![]() |
![]() |
![]() |
#11 | |
Reticulator of Tharn
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 618
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
|
Quote:
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
DR800 PDF annotation merge tool? | CoolDragon | iRex | 1 | 06-21-2010 02:56 PM |
SonyFont - quick and easy font updater | pepak | Sony Reader Dev Corner | 19 | 06-13-2010 05:35 AM |
Merge feature request (different merge) | Tarran | Calibre | 1 | 05-24-2010 10:57 AM |
PRS-500 HTML merge tool needed | sic | Sony Reader Dev Corner | 14 | 11-07-2007 06:04 PM |