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 12-17-2008, 09:30 AM   #1
pdurrant
The Grand Mouse
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 31,206
Karma: 86241230
Join Date: Jul 2007
Location: Norfolk, England
Device: NOOK ST GlowLight
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.
pdurrant is offline   Reply With Quote
Old 12-17-2008, 12:11 PM   #2
TS-Rick
Member
TS-Rick began at the beginning.
 
TS-Rick's Avatar
 
Posts: 21
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
TS-Rick is offline   Reply With Quote
 
Enthusiast
Old 12-17-2008, 12:44 PM   #3
llasram
Reticulator of Tharn
llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.
 
llasram's Avatar
 
Posts: 622
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
Quote:
Originally Posted by pdurrant View Post
Suggestions welcome. Please try to ensure your suggestion meets all three requirements.
How about standard GNU diff and patch? Native for Linux and OS X, via MSYS or Cygwin for Windows.
llasram is offline   Reply With Quote
Old 12-17-2008, 02:44 PM   #4
Gudy
Guru
Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.
 
Gudy's Avatar
 
Posts: 765
Karma: 1458681
Join Date: Jan 2008
Location: Germany
Device: Pocketbook Touch Lux (623)
Quote:
Originally Posted by llasram View Post
How about standard GNU diff and patch? Native for Linux and OS X, via MSYS or Cygwin for Windows.
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.
Gudy is offline   Reply With Quote
Old 12-17-2008, 03:10 PM   #5
pdurrant
The Grand Mouse
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 31,206
Karma: 86241230
Join Date: Jul 2007
Location: Norfolk, England
Device: NOOK ST GlowLight
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:
Originally Posted by Gudy View Post
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.
pdurrant is offline   Reply With Quote
Old 12-17-2008, 03:15 PM   #6
pdurrant
The Grand Mouse
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 31,206
Karma: 86241230
Join Date: Jul 2007
Location: Norfolk, England
Device: NOOK ST GlowLight
Oh - found it. wrong parameter in the patch command.

I'll look at kdiff3 too. Thanks.

Paul

Quote:
Originally Posted by pdurrant View Post
tell me what I'm doing wrong.
pdurrant is offline   Reply With Quote
Old 12-17-2008, 04:33 PM   #7
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,518
Karma: 11248282
Join Date: Jan 2007
Location: Tampa, FL USA
Device: Kindle Touch
Quote:
Originally Posted by pdurrant View Post
Oh - found it. wrong parameter in the patch command.

I'll look at kdiff3 too. Thanks.

Paul
It would probably just be easier to put the patched file "somewhere" that it can be got from. The file it self isn't that big. Yes, I know you are not doing a patch to save space.

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
pilotbob is offline   Reply With Quote
Old 12-17-2008, 05:31 PM   #8
pdurrant
The Grand Mouse
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 31,206
Karma: 86241230
Join Date: Jul 2007
Location: Norfolk, England
Device: NOOK ST GlowLight
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 http://www.mobileread.com/forums/sho...d.php?p=309292

Paul

Quote:
Originally Posted by pilotbob View Post
It would probably just be easier to put the patched file "somewhere" that it can be got from. The file it self isn't that big. Yes, I know you are not doing a patch to save space.

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
pdurrant is offline   Reply With Quote
Old 12-17-2008, 05:59 PM   #9
bwaldron
Wizard
bwaldron ought to be getting tired of karma fortunes by now.bwaldron ought to be getting tired of karma fortunes by now.bwaldron ought to be getting tired of karma fortunes by now.bwaldron ought to be getting tired of karma fortunes by now.bwaldron ought to be getting tired of karma fortunes by now.bwaldron ought to be getting tired of karma fortunes by now.bwaldron ought to be getting tired of karma fortunes by now.bwaldron ought to be getting tired of karma fortunes by now.bwaldron ought to be getting tired of karma fortunes by now.bwaldron ought to be getting tired of karma fortunes by now.bwaldron ought to be getting tired of karma fortunes by now.
 
bwaldron's Avatar
 
Posts: 1,221
Karma: 530854
Join Date: Feb 2008
Location: Tampa, Florida, USA
Device: Kindle 1/2/3/4/PW2, Droid Maxx, Galaxy Tab Pro (12.2")
Quote:
Originally Posted by pilotbob View Post
It would probably just be easier to put the patched file "somewhere" that it can be got from.
I wouldn't presume to ask someone to put themself at risk by distributing DRM removal software.

Last edited by bwaldron; 12-17-2008 at 06:04 PM.
bwaldron is offline   Reply With Quote
Old 12-17-2008, 06:26 PM   #10
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,518
Karma: 11248282
Join Date: Jan 2007
Location: Tampa, FL USA
Device: Kindle Touch
Quote:
Originally Posted by bwaldron View Post
I wouldn't presume to ask someone to put themself at risk by distributing DRM removal software.
This is the problem. However there is alot of copyrighted stuff out on the net so no one would really be distributing it.

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
pilotbob is offline   Reply With Quote
Old 12-17-2008, 08:38 PM   #11
llasram
Reticulator of Tharn
llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.
 
llasram's Avatar
 
Posts: 622
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
Quote:
Originally Posted by pilotbob View Post
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"...
Possibly... ConvertLIT.com appears to be hosted in Poland, and on its "legal" page notes that Poland doesn't "currently" have anything like the US DMCA or the EU Copyright Directive. Except that Poland became a full member of the EU in May of 2004. Doh! I'm guessing just no one cares enough to go after it. Heck, it probably boosts sales of MS LIT books -- I know ConvertLIT is why I buy them.
llasram 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
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


All times are GMT -4. The time now is 07:48 PM.


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