- Joined
- Aug 12, 2011
- Messages
- 353
- Motherboard
- Probook 4440:4540
- CPU
- i3-3110M
- Graphics
- HD4000
- Mac
- Classic Mac
- Mobile Phone
Looks like another kernel patch type is in order to implement this search pattern.
Another UINTN SearchAndReplace(UINT8 *Source, UINT32 SourceSize, UINT8 *Search, UINTN SearchSize, UINT8 *Replace, INTN MaxReplaces) implementation is needed in Clover source code to handle this type of logic.
I think there are multiple occurrences with different content in between known bits, so "brutal force" approaches would not work.
It may take a while...
Logic that will take "modified hex" in Find and Replace and leave it as-is, then pass it to new HexSearchAndReplace().
The format could be used in both Find and Replace data:
Sample:
04000081.{107}04006601.{108}
04000081...04006601.{108} equal to 04000081.{3}04006601.{108}
New HexSearchAndReplace() would traverse the Source Hex-by-Hex and if it finds '.' it will accept any byte. if following is "{" then it will parse count out of the Source and skip "}" and skip "count-1" in check logic (already skipped one byte when it saw '.'). Same thing for "Replace" logic(so it could accommodate really crazy update scenarios).