Thread: Kobo Patcher
View Single Post
Old 12-08-2013, 02:06 AM   #579
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 47,260
Karma: 171291590
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by GeoffR View Post
I've noticed that kpg.exe leaves the replacement string unterminated when using replace_xor. This means that if you replace say `Original` with `New` then the patched file will contain the string `Newginal` instead of `New`.

I think this might be causing some of the problems people have with getting the footer patch to work, as the end of the old string might override the new string depending on what the new combined string looks like.
I checked the output libnickel.so.1.0.0 file from running kpg.exe v1.5 and the entry for the footer patch was what is in the kpg.conf file with the terminating } followed by the pair of LFs.

The bytes at 13FA550 (fw 3.1.0) were:

Code:
2A 20 7B 0A 09 68 65 69 67 68 74 3A 20 32 35 70 78 3B 0A 09 66 6F 6E 74 2D 73 69 7A 65 3A 20 32 30 70 78 3B 0A 7D 0A 0A 68 65 69 67 68 74 3A 20

* {\n\theight: 25px;\n\tfont-size: 20px;\n}\n\nheight:

The only time I would see the termination as being a problem is if someone did not maintain the structure of the the replacement block with the terminating }\n. Admittedly that was why I originally started converting the ReadingFooter block to a human readable form to be able to see and avoid some of those errors.

Regards,
David

Last edited by DNSB; 12-08-2013 at 02:17 AM.
DNSB is offline   Reply With Quote