Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader > Kobo Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 11-28-2018, 11:54 AM   #271
geek1011
Wizard
geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.
 
Posts: 1,099
Karma: 2580105
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Kobo Aura Edition 2, Moto G5
Quote:
Originally Posted by jackie_w View Post
@geek1011,

Re: ReplaceZlibGroup

Please can you also show an example of how to use this for the occasions when I prefer to have the Find: and Replace: statements on separate lines to facilitate comparing the find/replace strings.

ETA: Ideally, I'd like to be able to mix and match Find/Replace one-liners and multi-liners in the same ReplaceZlibGroup

Here's an extract from a very large patch that I have. How would I use ReplaceZlibGroup to group these 4 find/replace together without losing the last 2 as multi-liners?

Spoiler:
Code:
jackie_w General GUI:
  - Enabled: no
  - Description: General GUI
  - FindZlib: "HeaderSmallElidedLabel"
  #
  # popup footnote header (HeaderMediumElidedLabel,HeaderMediumTouchLabel,HeaderMediumLabel ???)
  # free some space
  - ReplaceZlib: {Offset: 0, Find: "HeaderMediumElidedLabel[qApp_localeName=\"ja_JP\"],\nHeaderMediumTouchLabel[qApp_localeName=\"ja_JP\"],\nHeaderMediumLabel[qApp_localeName=\"ja_JP\"] {\n  font-family: Sans-SerifJP, sans-serif;\n  font-style: normal;\n}\nHeaderSmallLabel", Replace: "HeaderSmallLabel"}
  - ReplaceZlib: {Offset: 0, Find: "HeaderSmallLabel[qApp_localeName=\"ja_JP\"] {\n  font-family: Sans-SerifJP, sans-serif;\n  font-style: normal;\n}\nHeaderSmallElidedLabel", Replace: "HeaderSmallElidedLabel"}
  #
  # Book Title in Book list (HeaderSmallElidedLabel): reduce font-size and to sans-serif, bold
  - ReplaceZlib:
      Offset: 0
      Find:    "HeaderSmallElidedLabel,\nHeaderSmallItalicLabel {\n  font-family: Georgia;\n  font-style: italic;\n  font-size: 23px;\n  padding-left: 12px;\n  padding-right: 12px;\n  qproperty-alignment: 'AlignLeft|AlignVCenter';\n}"
      Replace: "HeaderSmallElidedLabel,\nHeaderSmallItalicLabel {\n  font-family: Trebuchet, Avenir;\n  font-weight: bold;\n  font-size: 23px;\n  padding-left: 12px;\n  padding-right: 12px;\n  qproperty-alignment: 'AlignLeft|AlignVCenter';\n}"
  - ReplaceZlib:
      Offset: 0
      Find:    "HeaderSmallElidedLabel[qApp_deviceIsDragon=true],\nHeaderSmallItalicLabel[qApp_deviceIsDragon=true] {\n  font-size: 36px;\n  padding-left: 20px;\n  padding-right: 20px;\n}\nHeaderSmallElidedLabel[qApp_deviceIsAlyssum=true],\nHeaderSmallItalicLabel[qApp_deviceIsAlyssum=true] {\n  font-size: 39px;\n}\nHeaderSmallElidedLabel[qApp_deviceIsNova=true],\nHeaderSmallItalicLabel[qApp_deviceIsNova=true] {\n  font-size: 39px;\n}\nHeaderSmallElidedLabel[qApp_deviceIsDaylight=true],\nHeaderSmallItalicLabel[qApp_deviceIsDaylight=true] {\n  font-size: 47px;\n  padding-left: 26px;\n  padding-right: 26px;\n}\nHeaderSmallElidedLabel[qApp_localeName=\"ja_JP\"],\nHeaderSmallItalicLabel[qApp_localeName=\"ja_JP\"] {\n  font-family: Sans-SerifJP, sans-serif;\n  font-style: normal;\n  qproperty-forceLeading: 5;\n}"
      Replace: "HeaderSmallElidedLabel[qApp_deviceIsDragon=true],\nHeaderSmallItalicLabel[qApp_deviceIsDragon=true] {\n  font-size: 32px;\n  padding-left: 20px;\n  padding-right: 20px;\n}\nHeaderSmallElidedLabel[qApp_deviceIsAlyssum=true],\nHeaderSmallItalicLabel[qApp_deviceIsAlyssum=true] {\n  font-size: 36px;\n}\nHeaderSmallElidedLabel[qApp_deviceIsNova=true],\nHeaderSmallItalicLabel[qApp_deviceIsNova=true] {\n  font-size: 36px;\n}\nHeaderSmallElidedLabel[qApp_deviceIsDaylight=true],\nHeaderSmallItalicLabel[qApp_deviceIsDaylight=true] {\n  font-size: 40px;\n  padding-left: 26px;\n  padding-right: 26px;\n}"
  #
It's all YAML, and you can find all the possible forms here: http://yaml.org/spec/1.2/spec.html . As for your specific question, you can do:

Code:
Example for ReplaceZlibGroup:
  - Enabled: yes
  - Description: An example patch for the new ReplaceZlibGroup instruction.
  - FindZlib: "#someRandomID"
  - ReplaceZlibGroup:
      Offset: 0
      Replacements:
        - Find: "#someRandomID"
          Replace: "#someRandomIDThatMakesTheZlibStreamTooLongWhichWouldHaveErroredWithReplaceZlib"
        - {Find: "#someRandomIDThatMakesTheZlibStreamTooLongWhichWouldHaveErroredWithReplaceZlib", Replace: "#someRandomIDThatIsNowShortEnough"}
geek1011 is offline   Reply With Quote
Old 11-28-2018, 12:07 PM   #272
jackie_w
Wizard
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 4,739
Karma: 11360477
Join Date: Sep 2009
Location: UK
Device: PRS-350, Kobo: Aura6", H2O, GloHD, KA1, ClaraHD, Forma
Quote:
Originally Posted by geek1011 View Post
It's all YAML, and you can find all the possible forms here: http://yaml.org/spec/1.2/spec.html . As for your specific question, you can do:
Thanks for that. Now I get it.

This new feature is a big help when trying to add new tweaks when trying to patch the single mega-CSS stream which controls the general GUI.

ETA: Sorry, the system won't let me give you any more karma at the moment.

Last edited by jackie_w; 11-28-2018 at 12:10 PM. Reason: ETA
jackie_w is offline   Reply With Quote
Advert
Old 12-15-2018, 01:10 AM   #273
geek1011
Wizard
geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.
 
Posts: 1,099
Karma: 2580105
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Kobo Aura Edition 2, Moto G5
kobopatch v0.12.0 released with major new instructions for assembly manipulation

I have released a new version of kobopatch (along with patches v35) with some really nice instructions for assembly manipulation. I have decided to do what I did with the zlib stuff, but for assembly this time. The patches should be twice as fast to update now, and a lot more readable.

I have tested all these features, and the output matches byte-for-byte. In addition, the BLX-related instructions are designed in a fail-safe way. If something is broken about the assembler (or it can't match the output of the original compiler), it will refuse to even try to replace stuff to do with it. Note that this cannot protect you from putting in bad branch offsets (no different than before). The NOP replacements also have a check to make sure it is aligned properly.

This release allows me to simplify and speed up the update time for many patches. With this method, there is less typing I need to do for patches which do many branches to the same location from different offsets, less calculations to do manually, and a few other things like that.


The new features in this release are:

- New ReplaceBytesNOP instruction: This replaces assembly instruction bytes with as many NOPs as needed. The usage is the same as ReplaceBytes, just without the Replace.

- New ReplaceBLX instruction: This instruction takes branch addresses, calculates the offset, and assembles the instructions to make it easier to replace one branch instruction with another.

- New FindBLX shorthand option for ReplaceBytes and ReplaceBytesNOP: This option takes a branch address, calculates the offset, and assembles it automatically to make it easier to update and read than FindH or Find. Note that a BLX instruction is always 4 bytes long.

- Improved tests: The unit tests are now more comprehensive.


Examples:

Code:
# The 10 line spacing values patch
  - ReplaceBytes: {Offset: 0x658D3C, FindH: C0 F5 44 EE, ReplaceH: 00 46 00 46}
  - ReplaceBytes: {Offset: 0x658D92, FindH: C0 F5 1A EE, ReplaceH: 00 46 00 46}
  - ReplaceBytes: {Offset: 0x658DBC, FindH: C0 F5 04 EE, ReplaceH: 00 46 00 46}
  - ReplaceBytes: {Offset: 0x658DF8, FindH: C0 F5 E6 ED, ReplaceH: 00 46 00 46}
  - ReplaceBytes: {Offset: 0x658E5E, FindH: C0 F5 B4 ED, ReplaceH: 00 46 00 46}
# Becomes:
  - ReplaceBytesNOP: {Offset: 0x658D3C, FindBLX: 0x4199C8}
  - ReplaceBytesNOP: {Offset: 0x658D92, FindBLX: 0x4199C8}
  - ReplaceBytesNOP: {Offset: 0x658DBC, FindBLX: 0x4199C8}
  - ReplaceBytesNOP: {Offset: 0x658DF8, FindBLX: 0x4199C8}
  - ReplaceBytesNOP: {Offset: 0x658E5E, FindBLX: 0x4199C8}
Code:
# The both page turn sides go next patch
  - ReplaceBytes: {Offset: 0x83EDE8, FindH: D0 F7 AA E0, ReplaceH: DB F7 5A E3}
  - ReplaceBytes: {Offset: 0x83D426, FindH: D1 F7 8C E5, ReplaceH: DD F7 3C E0}
  - ReplaceBytes: {Offset: 0x83D432, FindH: D6 F7 D6 E6, ReplaceH: DC F7 5E E4}
# Becomes:
  - ReplaceBLX: {Offset: 0x83EDE8, Find: 0x40EF40, Replace: 0x41A4A0}
  - ReplaceBLX: {Offset: 0x83D426, Find: 0x40EF40, Replace: 0x41A4A0}
  - ReplaceBLX: {Offset: 0x83D432, Find: 0x4141E0, Replace: 0x419CF0}
Code:
# The always show upgrade confirmation patch:
  - ReplaceBytes: {Offset: 0xACE2CA, FindH: 46 F5 FA E3, ReplaceH: 4F F0 00 00}
# Becomes:
  - ReplaceBytes: {Offset: 0xACE2CA, FindBLX: 0x414AC0, ReplaceH: 4F F0 00 00}
And many more like this.

Last edited by geek1011; 12-15-2018 at 01:59 AM.
geek1011 is offline   Reply With Quote
Old 12-15-2018, 03:32 AM   #274
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 5,148
Karma: 5678910
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Thank you very much in two ways: for your work with the patches... and for remembering my youth with the assembler handling
Terisa de morgan is offline   Reply With Quote
Old 02-04-2019, 12:38 AM   #275
geek1011
Wizard
geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.
 
Posts: 1,099
Karma: 2580105
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Kobo Aura Edition 2, Moto G5
kobopatch v0.13.0 released with more new instructions for assembly manipulation

I have released a new version of kobopatch (along with patches v40) with some new assembly manipulation instructions.


The new features in this release are:

- New FindBaseAddressSymbol instruction: This finds the base address of a function. Use the demangled c++ symbol name (or the c symbol name). The advantage of this instruction is offsets of functions using this instruction do not have to be recalculated every firmware version.

- New ReplaceBytesAtSymbol instruction: This instruction combines FindBaseAddressSymbol and ReplaceBytes.


Examples:

Code:
# Making a setting always true (offset 53 is the toBool function call inside the setting getter).
# This example uses all the new assembly manipulation instructions from the last two versions to reduce the number of offsets to update every version from 3 to 1.
  - ReplaceBytesAtSymbol: {Symbol: "ApplicationSettings::readABookShown()", Offset: 53, FindBLX: 0x40491c, ReplaceH: 4F F0 01 00}
And other ones coming soon once I update them.

Last edited by geek1011; 02-04-2019 at 12:59 AM.
geek1011 is offline   Reply With Quote
Advert
Old Yesterday, 10:35 AM   #276
bighead
Member
bighead began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Aug 2015
Device: kobo glo hd
I see all patch of 4.12.121111
libadobe.so.yaml
libnickel.so.1.0.0.yaml
librmsdk.so.1.0.0.yaml
nickel.yaml

It have many Option to choose open or close,and my brain is burning!
bighead is offline   Reply With Quote
Reply

Tags
kobo, kobopatch, patch, patch32lsb

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
kobopatch - A new (WIP) patching system geek1011 Kobo Developer's Corner 93 05-27-2018 04:04 PM
Patching H2O Maillemom Kobo Developer's Corner 8 10-19-2016 10:58 AM
Instructions for patching firmware 3.17.3 GeoffR Kobo Developer's Corner 60 09-17-2015 06:35 PM
Instructions for patching firmware 3.8.0 GeoffR Kobo Developer's Corner 92 10-22-2014 08:22 AM
how to clean more disk space in root file system to upgrade system chinaet iRex 1 12-18-2006 04:54 PM


All times are GMT -4. The time now is 11:35 PM.


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