From e92d0e5805b9214116ec020c66237a0a0f18c196 Mon Sep 17 00:00:00 2001 From: Katy Coe Date: Tue, 29 Oct 2019 13:44:03 +0100 Subject: [PATCH] X64: Fix could miss first byte of opcode match --- Il2CppInspector/Il2CppBinaryX64.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Il2CppInspector/Il2CppBinaryX64.cs b/Il2CppInspector/Il2CppBinaryX64.cs index f76b51f..076cb57 100644 --- a/Il2CppInspector/Il2CppBinaryX64.cs +++ b/Il2CppInspector/Il2CppBinaryX64.cs @@ -32,9 +32,14 @@ namespace Il2CppInspector uint i, index; for (i = 0, index = 0; i < buff.Length && index < opcode.Length; i++) - if (buff[i] != opcode[index++]) + if (buff[i] != opcode[index++]) { index = 0; + // Maybe we're starting a new match + if (buff[i] != opcode[index++]) + index = 0; + } + if (index < opcode.Length) return null;