I just wonder to know, is there any change to manipulate it or break it on Windows?
For example ivgot a code like that:
while (1)
{
auto v6 = __rdtsc();
switch (v6 & 0xF)
{
case 1ui64:
something();
break;
case 2ui64:
something2();
break;
default:
break;
}
}
and the request is simple as breaking the only 2ui64 case.


Run inside a VM; a hypervisor can configure it so
rdtsccauses a VM exit, so it can put whatever it wants into EDX:EAX before resuming.You can't change how the CPU executes a
rdtscinstruction, and__rdtsc()is an intrinsics that inlines that instruction, not calling anywhere you could hook.So your only other option is to modify the binary, e.g. to replace
rdtsc(2 bytes) withxor eax,eax(2 bytes), so the RDTSC return value is always0.Or
mov al, 7so__rdtsc() % 256is always 7, if you want to make thatswitchtake the default case. The full RDTSC output in EDX:EAX will include whatever values were in EDX and the higher bytes of EAX, but your code only depends on the low byte (in fact low nibble) of that integer value. (&0xFzeros the high bits.)