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
|