unicorn icon indicating copy to clipboard operation
unicorn copied to clipboard

Add UC_HOOK_INSN support for UC_X86_INS_RDTSC and UC_X86_INS_RDRAND

Open Z4ee opened this issue 2 years ago • 0 comments

The current version of the Unicorn Engine does not provide hook support for the UC_X86_INS_RDTSC and UC_X86_INS_RDRAND instructions. These instructions are crucial for applications requiring precise time measurement or random number generation. This proposal suggests adding hook support for these instructions, allowing users to have more flexible control over code execution.

uc_hook_add(uc, &hook, UC_HOOK_INSN, hook_rdtsc, nullptr, 1, 0, UC_X86_INS_RDTSC); // Return: UC_ERR_HOOK
uc_hook_add(uc, &hook, UC_HOOK_INSN, hook_rdrand, nullptr, 1, 0, UC_X86_INS_RDRAND); // Return: UC_ERR_HOOK

Z4ee avatar Oct 27 '23 07:10 Z4ee