Skip to content
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

Uc hook tcg improve #2011

Merged
merged 4 commits into from
Feb 10, 2025
Merged

Conversation

dotCirill
Copy link
Contributor

Improve UC_HOOK_TCG_OPCODE feature.

Currently UC_HOOK_TCG_OPCODE is supported only for x86.

Such hooks can be usefull for implementing CMPLOG in unicorn-afl.

@dotCirill dotCirill marked this pull request as ready for review February 7, 2025 22:19
@wtdcode
Copy link
Member

wtdcode commented Feb 8, 2025

The history seems weird, I think you should target dev branch.

@dotCirill dotCirill changed the base branch from master to dev February 8, 2025 11:56
@dotCirill
Copy link
Contributor Author

Yes, target should be dev branch.

@wtdcode
Copy link
Member

wtdcode commented Feb 10, 2025

Looks good, thanks.

@wtdcode wtdcode merged commit dc1f7a8 into unicorn-engine:dev Feb 10, 2025
30 of 36 checks passed
@wtdcode
Copy link
Member

wtdcode commented Feb 10, 2025

I regret not checking the code rigorously, and unfortunately the PR has several flaws.

  • address parameter is not correctly implemented. It should point to the instruction instead of the stale register value (you were referring to the runtime value during translation stage.
  • it is incorrect to convert TCGv_i32 to TCGv_i64 directly. It is UB and an extension instruction is needed.

But anyway, it's not your fault and thus I fixed them by myself already. Thanks for your contributions.

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