Skip to content

flush instruction cache after performing relocations #59

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions MemoryModule.c
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,9 @@ HMEMORYMODULE MemoryLoadLibraryEx(const void *data, size_t size,
} else {
result->isRelocated = TRUE;
}

// flush instruction cache to avoid executing stale code after performing relocations
FlushInstructionCache((HANDLE)-1, NULL, 0);

// load required dlls and adjust function table of imports
if (!BuildImportTable(result)) {
Expand Down