8000 make i386 instructions RDTSC and RDTSCP hookable by t0rr3sp3dr0 · Pull Request #2066 · unicorn-engine/unicorn · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

make i386 instructions RDTSC and RDTSCP hookable #2066

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 20, 2024

Conversation

t0rr3sp3dr0
Copy link
Contributor
@t0rr3sp3dr0 t0rr3sp3dr0 commented Dec 14, 2024

This patch allows the RDTSC and RDTSCP instructions to be hooked. The code is based on the CPUID hook implementation.

Fixes #2065

Signed-off-by: Pedro Tôrres <t0rr3sp3dr0@gmail.com>
Signed-off-by: Pedro Tôrres <t0rr3sp3dr0@gmail.com>
@wtdcode
Copy link
Member
wtdcode commented Dec 18, 2024

I'm good with this PR. Would you mind writing a small unit test to tests/unit/test_x86.c? This ensures our future release won't break your usages.

Signed-off-by: Pedro Tôrres <t0rr3sp3dr0@gmail.com>
@t0rr3sp3dr0
Copy link
Contributor Author

@wtdcode PTAL

@wtdcode
Copy link
Member
wtdcode commented Dec 19, 2024

@wtdcode PTAL

Looks good and thanks. Will merge once CI passes. (Windows is broken at this moment)

@t0rr3sp3dr0
Copy link
Contributor Author

We need to rerun the failed CI job. It has failed with mv: cannot move 'Debug' to 'instdir': Permission denied and I don’t think this is related to my changes. I guess it’s just some flakiness.

@wtdcode wtdcode merged commit 7737e7b into unicorn-engine:dev Dec 20, 2024
36 checks passed
@wtdcode
Copy link
Member
wtdcode commented Dec 20, 2024

Thanks!

hyunmin-furiosa pushed a commit to hyunmin-furiosa/unicorn that referenced this pull request Jan 17, 2025
* instruction hooks for RDTSC and RDTSCP

Signed-off-by: Pedro Tôrres <t0rr3sp3dr0@gmail.com>

* update hookable instruction list

Signed-off-by: Pedro Tôrres <t0rr3sp3dr0@gmail.com>

* test RDTSC and RDTSCP instruction hooks

Signed-off-by: Pedro Tôrres <t0rr3sp3dr0@gmail.com>

---------

Signed-off-by: Pedro Tôrres <t0rr3sp3dr0@gmail.com>
Co-authored-by: mio <mio@lazym.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0