fix player store id resolver

This commit is contained in:
REL
2025-02-12 04:24:43 -05:00
parent b1f5d9a2b2
commit e251497edc
2 changed files with 11 additions and 7 deletions

View File

@@ -69,9 +69,7 @@
<SubSystem>NotSet</SubSystem>
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
</Link>
<PostBuildEvent>
<Command>copy $(TargetPath) C:\ProgramData\Yae\YaeAchievement.dll /y</Command>
</PostBuildEvent>
<PostBuildEvent />
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
@@ -93,9 +91,7 @@
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
</Link>
<PostBuildEvent>
<Command>copy $(TargetPath) C:\ProgramData\Yae\YaeAchievement.dll /y</Command>
</PostBuildEvent>
<PostBuildEvent />
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="src\globals.h" />

View File

@@ -488,9 +488,17 @@ namespace
immValue = static_cast<uint32_t>(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) {