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

DllBlock: hook VirtualAlloc/VirtualProtect for dynamic code exclusions #419

Merged
merged 1 commit into from
May 26, 2024

Conversation

dinhngtu
Copy link
Contributor

Compatibility fix for iFlyIME.

The procedure is as following:

  • During NtMapViewOfSection hook: create a list of caller address ranges where dynamic code is allowed
  • Hook VirtualAlloc(Ex)/VirtualProtect(Ex):
    • Find caller IP with _ReturnAddress()
    • If caller IP is in optout range, temporarily disable dynamic code optout before calling real function
  • Hook NtUnmapViewOfSection to cleanup the address range list as needed

Tested with Explorer Patcher, Translucent Flyouts, Sogou Pinyin and iFlyIME.

@MouriNaruto MouriNaruto merged commit db69626 into M2Team:main May 26, 2024
1 check passed
@dinhngtu dinhngtu deleted the iflyfix branch May 26, 2024 01:56
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