View Single Post
Old 01-27-2012, 02:34 PM   #279
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,478
Karma: 5703586
Join Date: Nov 2009
Device: many
Hi,

Even my new testcase showed just a 1 for those 4 bytes in the older mobi header. I have no idea what those bytes might mean.


My testcase did freak out the split code. I print the ofs and it values used in deletesectionrange and end up with an invalid ofs (it is negative) possibly because one of the original start values was 0xffffffff ? I am not sure.

I will try to track this down.

in split 9444436 418
in split 4220892 194
in split 976 196
in split -9443580 198

Traceback (most recent call last):
File "./mobi_unpack.py", line 919, in <module>
sys.exit(main())
File "./mobi_unpack.py", line 910, in main
unpackBook(infile, outdir)
File "./mobi_unpack.py", line 575, in unpackBook
mobisplit = mobi_split(infile)
File "/Users/kbhend/Desktop/nick_mobi_unpack_update5/mobi_split.py", line 242, in __init__
self.result_file8 = deletesectionrange(datain,0,datain_kf8-1)
File "/Users/kbhend/Desktop/nick_mobi_unpack_update5/mobi_split.py", line 105, in deletesectionrange
dataout = dataout[:first_pdb_record+i*8] + struct.pack('>L',ofs) + struct.pack('L',it) + dataout[first_pdb_record+i*8+8:]
struct.error: integer out of range for 'L' format code
KevinH is offline   Reply With Quote