View Single Post
Old 11-11-2018, 10:02 PM   #248
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
I'm having a problem with FindBaseAddressString using kobopatch-apply (linux 64-bit), not sure if it is a problem with kobopatch-apply or a problem with my yaml.

I made `My 10 line spacing values` (libnickel.so.1.0.0) into a multi-version patch. Here is the patch32lsb version:
Spoiler:
Code:
<Patch>
patch_name = `My 10 line spacing values`
patch_enable = `yes`
# Multi-version patch: 4.6.9960 - 4.11.11980+
# patch_group = `Line spacing values alternatives`
#
## This patch changes the values on the line spacing adjustment slider,
## reducing the number of spacing options from 15 to 10, but allowing
## much narrower spacing values to be set.
#
# Bypass code-constructed values 1.0, 1.2, 1.5, 2.0, 3.0
find_base_address = "\x4F\xF0\x00\x09\x07\xF1\x80\x01\x4F\xF0\x00\x08\xC3\xF6\xF0\x79\x3C\x1D\xF3\x58\x20\x46\x61\xE9\x1E\x89\x7B\x60"
replace_bytes = 0014, 20 46 61 E9 1E 89, 7B 60 03 E0 00 BF
replace_bytes = 006C, 20 46, 03 E0
replace_bytes = 0096, 20 46, 03 E0
replace_bytes = 00D2, 20 46, 03 E0
replace_bytes = 0138, 20 46, 03 E0
#
# 10 values for replacement, change these replace_float values to suit:
find_base_address = "\xCD\xCC\xCC\xCC\xCC\xCC\xF0\x3F\x1F\x85\xEB\x51\xB8\x1E\xF1\x3F"
replace_float = 0000, 1.05, 0.8
replace_float = 0008, 1.07, 0.85
replace_float = 0010, 1.1, 0.875
replace_float = 0018, 1.35, 0.9
replace_float = 0020, 1.7, 0.925
replace_float = 0028, 1.8, 0.95
replace_float = 0030, 2.2, 0.975
replace_float = 0038, 2.4, 1.0
replace_float = 0040, 2.6, 1.05
replace_float = 0048, 2.8, 1.1
</Patch>

Here is the kobopatch yaml version:
Spoiler:
Code:
My 10 line spacing values:
  - Enabled: yes
  - PatchGroup: Line spacing values alternatives
  - Description: |
      This patch changes the values on the line spacing adjustment slider,
      reducing the number of spacing options from 15 to 10, but allowing
      much narrower spacing values to be set.
    # Bypass code-constructed values 1.0, 1.2, 1.5, 2.0, 3.0
  - FindBaseAddressString: "\x4F\xF0\x00\x09\x07\xF1\x80\x01\x4F\xF0\x00\x08\xC3\xF6\xF0\x79\x3C\x1D\xF3\x58\x20\x46\x61\xE9\x1E\x89\x7B\x60"
  - ReplaceBytes: {Offset: 0x14, FindH: 20 46 61 E9 1E 89, ReplaceH: 7B 60 03 E0 00 BF}
  - ReplaceBytes: {Offset: 0x6C, FindH: 20 46, ReplaceH: 03 E0}
  - ReplaceBytes: {Offset: 0x96, FindH: 20 46, ReplaceH: 03 E0}
  - ReplaceBytes: {Offset: 0xD2, FindH: 20 46, ReplaceH: 03 E0}
  - ReplaceBytes: {Offset: 0x138, FindH: 20 46, ReplaceH: 03 E0}
    # 10 values for replacement, change these replace_float values to suit:
  - FindBaseAddressString: "\xCD\xCC\xCC\xCC\xCC\xCC\xF0\x3F\x1F\x85\xEB\x51\xB8\x1E\xF1\x3F"
  - ReplaceFloat: {Offset: 0x00,  Find: 1.05, Replace: 0.8}
  - ReplaceFloat: {Offset: 0x08,  Find: 1.07, Replace: 0.85}
  - ReplaceFloat: {Offset: 0x10,  Find: 1.1,   Replace: 0.875}
  - ReplaceFloat: {Offset: 0x18,  Find: 1.35,  Replace: 0.9}
  - ReplaceFloat: {Offset: 0x20,  Find: 1.7,   Replace: 0.925}
  - ReplaceFloat: {Offset: 0x28,  Find: 1.8,   Replace: 0.95}
  - ReplaceFloat: {Offset: 0x30,  Find: 2.2,   Replace: 0.975}
  - ReplaceFloat: {Offset: 0x38,  Find: 2.4,   Replace: 1.0}
  - ReplaceFloat: {Offset: 0x40,  Find: 2.6,   Replace: 1.05}
  - ReplaceFloat: {Offset: 0x48,  Find: 2.8,   Replace: 1.1}

The patch32lsb version applies to libnickel.so.1.0. as expecued, but kobopatch-apply gives this error message for the yaml version:
Spoiler:
Code:
  APPLY `My 10 line spacing values`
    Error: i4: could not apply patch: FindBaseAddress: could not find bytes

Last edited by GeoffR; 11-13-2018 at 08:09 PM. Reason: Fixed a mistake in first replace line of both patches
GeoffR is offline   Reply With Quote