Closed Archie-osu closed 5 months ago
Hi! Only on mobile right now, but if I'm not mistaken, your address calculation is wrong.
You add the instruction size to the runtime_address and the offset which is correct. But for the Zydis function call you pass (runtime_address + offset) as the buffer, effectively adding the instruction length twice.
Oh yeah, thank you for pointing that out - seems to have been caused by some refactoring I did before implementing the rest of the code. Closing, not an actual issue.
Hi there, I'm having a bit of an issue with running Zydis in the Windows Kernel. I'm disassembling the
HalpTimerQueryHostPerformanceCounter
function on build 22631.3007 (SHA1:ec844089668811d4104e72fc7d3864caa2a37c44
), but Zydis is giving incorrect results.The issue is present on both v4.0.0 and on 15e38ac36fa4a84dde0fc6ae973d33c22e9521e9 (which I amalgamated locally). When disassembling the function, WinDbg's KD gives the correct and expected results:
However, running Zydis in
ZYDIS_MACHINE_MODE_LONG_64
gives different results:My code handling Zydis looks like so: