Thread: Kobo Patcher
View Single Post
Old 12-08-2013, 04:27 AM   #582
GeoffR
Wizard
GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.
 
GeoffR's Avatar
 
Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
Here is a demonstration of the problem with the way kpg.exe applies the footer patch that doesn't require any other program to test. I have added the missing string terminator manually with a replace_bytes line:
Spoiler:
Code:
<Patch>
patch_name = `Custom reading footer style test case`
patch_enable = `yes`
#
replace_xor_58 = 13FA550, `ReadingFooter {\n\tmin-height: 70px;\n\tmax-height: 70px;\n\tqproperty-footerMargin: 40;\n}\n\nReadingFooter[deviceCodeName="kraken"], \nReadingFooter[deviceCodeName="phoenix"] {\n\tmin-height: 82px;\n\tmax-height: 82px;\n\tqproperty-footerMargin: 15;\n}\n\nReadingFooter[deviceCodeName="dragon"] {\n\tmin-height: 120px;\n\tmax-height: 120px;\n\tqproperty-footerMargin: 20;\n}\n\n* {\n\tfont-size: 16px;\n}\n\n[deviceCodeName="kraken"], \n[deviceCodeName="phoenix"] {\n\tfont-size: 20px;\n}\n\n[deviceCodeName="dragon"] {\n\tfont-size: 26px;\n}\n\n[localeName="ja_JP"] {\n\tfont-family: A-OTF Gothic MB101 Pr6N;\n}`, `ReadingFooter {\n\tmin-height: 30px;\n\tmax-height: 30px;\n\tqproperty-footerMargin: 15;\n}\n\n`
#
# add a terminating null (xor 0x58) to the above 86-character string: 
#replace_bytes = 13FA5A6, 0A, 58
</Patch>

To test: Apply with the replace_byte line commented out and the patch is ignored on my Glo. But uncomment the replace_bytes line and the patch works as expected. The replacement byte is an encoded null (zero XOR 0x58) applied at the location following the last '\n' character in the replacement string.

This test case is for firmware 3.1.0 (d1b2f00933) on Glo/Aura/AuraHD (I don't think this particular footer would have a problem on other devices).
GeoffR is offline   Reply With Quote