fix: incorrect instruction offsets

This commit is contained in:
oSumAtrIX 2023-05-07 18:57:54 +02:00
parent 4e74a800c3
commit 42a5a387da
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4

View File

@ -22,9 +22,10 @@ class VerticalScrollPatch : BytecodePatch(
override fun execute(context: BytecodeContext): PatchResult {
CanScrollVerticallyFingerprint.result?.let {
it.mutableMethod.apply {
val insertIndex = it.scanResult.patternScanResult!!.endIndex
val moveResultRegister = instruction<OneRegisterInstruction>(insertIndex - 1).registerA
val moveResultIndex = it.scanResult.patternScanResult!!.endIndex
val moveResultRegister = instruction<OneRegisterInstruction>(moveResultIndex).registerA
val insertIndex = moveResultIndex + 1
addInstruction(
insertIndex,
"const/4 v$moveResultRegister, 0x0"