Skip to content

Conversation

shmocz
Copy link
Contributor

@shmocz shmocz commented Feb 13, 2025

VirtualProtect fails if fourth argument is NULL, see: https://learn.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-virtualprotect

On some versions of wine this leads to null pointer dereference and crash.

VirtualProtect fails if fourth argument is NULL, see: https://learn.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-virtualprotect

On some versions of wine this leads to null pointer dereference and crash.
Copy link

github-actions bot commented Feb 13, 2025

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.

@Belonit
Copy link
Member

Belonit commented Feb 14, 2025

@shmocz Microsoft doc says that we should also use the FlushinstructionCache function, what do you think about this?

@shmocz
Copy link
Contributor Author

shmocz commented Feb 20, 2025

Based on quick search, self-modifying code should work on x86 systems without explicit cache flush. I suggest we still add it just to be consistent with documentation, with a comment clarifying that it's use isn't strictly necessary.

@Belonit Belonit merged commit 1cb5e7b into CnCNet:main Feb 20, 2025
2 checks passed
ZivDero added a commit to Phobos-developers/Phobos that referenced this pull request Mar 7, 2025
ZivDero added a commit to Phobos-developers/Phobos that referenced this pull request Mar 7, 2025
ZivDero added a commit to Phobos-developers/Phobos that referenced this pull request Mar 7, 2025
Fix incompatiblity with CnCNet/yrpp-spawner#27

Co-authored-by: Trsdy <914137150@qq.com>
Coronia pushed a commit to Phobos-developers/Phobos that referenced this pull request Mar 8, 2025
Fix incompatiblity with CnCNet/yrpp-spawner#27

Co-authored-by: Trsdy <914137150@qq.com>
Metadorius pushed a commit to Metadorius/Phobos that referenced this pull request Mar 30, 2025
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