diff --git a/lib/YaeAchievementLib.vcxproj b/lib/YaeAchievementLib.vcxproj
index 30eeace..078aa21 100644
--- a/lib/YaeAchievementLib.vcxproj
+++ b/lib/YaeAchievementLib.vcxproj
@@ -69,9 +69,7 @@
NotSet
DebugFull
-
- copy $(TargetPath) C:\ProgramData\Yae\YaeAchievement.dll /y
-
+
@@ -93,9 +91,7 @@
true
DebugFull
-
- copy $(TargetPath) C:\ProgramData\Yae\YaeAchievement.dll /y
-
+
diff --git a/lib/src/il2cpp-init.cpp b/lib/src/il2cpp-init.cpp
index af93317..a328dee 100644
--- a/lib/src/il2cpp-init.cpp
+++ b/lib/src/il2cpp-init.cpp
@@ -488,9 +488,17 @@ namespace
immValue = static_cast(i.Operands[1].imm.value.u);
}
- if (i.Instruction.meta.branch_type == ZYDIS_BRANCH_TYPE_NEAR && i.Operands.size() == 1) {
+ if (i.Instruction.meta.branch_type == ZYDIS_BRANCH_TYPE_NEAR && i.Operands.size() == 1 &&
+ (i.Instruction.mnemonic == ZYDIS_MNEMONIC_JZ || i.Instruction.mnemonic == ZYDIS_MNEMONIC_JNZ)) // jz for true branch, jnz for false branch
+ {
+ // assume the branching is jz
uintptr_t branchAddr = Globals::BaseAddress + i.RVA + i.Instruction.length + i.Operands[0].imm.value.s;
+ // check if the branch is jnz and adjust the branch address
+ if (i.Instruction.mnemonic == ZYDIS_MNEMONIC_JNZ) {
+ branchAddr = Globals::BaseAddress + i.RVA + i.Instruction.length;
+ }
+
// decode the branch address immediately
const auto instructions = DecodeFunction(branchAddr, 10);
const auto isMatch = std::ranges::any_of(instructions, [pOnPlayerStoreNotify](const DecodedInstruction& instr) {