Log rdtsc

This commit is contained in:
momo5502
2025-08-15 12:54:36 +02:00
parent 6584eaaff5
commit 127ed1b552
3 changed files with 42 additions and 0 deletions

View File

@@ -437,6 +437,8 @@ void windows_emulator::setup_hooks()
});
this->emu().hook_instruction(x86_hookable_instructions::rdtscp, [&] {
this->callbacks.on_rdtscp();
const auto ticks = this->clock_->timestamp_counter();
this->emu().reg(x86_register::rax, ticks & 0xFFFFFFFF);
this->emu().reg(x86_register::rdx, (ticks >> 32) & 0xFFFFFFFF);
@@ -449,6 +451,8 @@ void windows_emulator::setup_hooks()
});
this->emu().hook_instruction(x86_hookable_instructions::rdtsc, [&] {
this->callbacks.on_rdtsc();
const auto ticks = this->clock_->timestamp_counter();
this->emu().reg(x86_register::rax, ticks & 0xFFFFFFFF);
this->emu().reg(x86_register::rdx, (ticks >> 32) & 0xFFFFFFFF);