Narrow function clearing patch

We wish to preserve the first blr, but it's ridiculous to clear it and replace it with itself.

Now, we only clear the contents of the three textinput::EventObserver we overwrite.
This commit is contained in:
Spotlight 2021-12-30 21:49:28 -06:00
parent 957d69f118
commit 0551c6a9a9
No known key found for this signature in database
GPG Key ID: 874AA355B3209BDC
2 changed files with 3 additions and 16 deletions

View File

@ -4,15 +4,10 @@ package main
// See docs/patch_overwrite_ios.md for more information.
var OverwriteIOSPatch = PatchSet{
Patch{
Name: "Clear textinput::EventObserver functions",
AtOffset: 20320,
Name: "Clear extraneous textinput::EventObserver functions",
AtOffset: 20336,
Before: Instructions{
// Function: textinput::EventObserver::onSE
BLR(),
padding,
padding,
padding,
// Function: textinput::EventObserver::onEvent
BLR(),
padding,
@ -32,9 +27,7 @@ var OverwriteIOSPatch = PatchSet{
// We wish to clear extraneous blrs so that our custom overwriteIOSMemory
// function does not somehow conflict. We only preserve onSE.
After: append(Instructions{
BLR(),
}.toBytes(), emptyBytes(60)...),
After: emptyBytes(48),
},
Patch{
Name: "Repair textinput::EventObserver vtable",

View File

@ -2,8 +2,6 @@ package main
import (
"encoding/binary"
"encoding/hex"
"log"
)
// Register represents a value for a PowerPC register.
@ -115,10 +113,6 @@ func EncodeInstrDForm(opcode byte, rT Register, rA Register, value uint16) Instr
secondInstr := instr[1].getByte()
valByte := twoByte(value)
log.Println(hex.EncodeToString([]byte{
firstInstr, secondInstr, valByte[0], valByte[1],
}))
return Instruction{firstInstr, secondInstr, valByte[0], valByte[1]}
}