mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-27 23:11:02 +00:00
Log rdtsc
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -27,6 +27,8 @@ struct emulator_callbacks : module_manager::callbacks, process_context::callback
|
||||
opt_func<void(uint64_t address, uint64_t length, memory_permission, bool commit)> on_memory_allocate{};
|
||||
opt_func<void(uint64_t address, uint64_t length, memory_operation, memory_violation_type type)> on_memory_violate{};
|
||||
|
||||
opt_func<void()> on_rdtsc{};
|
||||
opt_func<void()> on_rdtscp{};
|
||||
opt_func<continuation(uint32_t syscall_id, std::string_view syscall_name)> on_syscall{};
|
||||
opt_func<void(std::string_view data)> on_stdout{};
|
||||
opt_func<void(std::string_view type, std::u16string_view name)> on_generic_access{};
|
||||
|
||||
Reference in New Issue
Block a user