Skip to content

Commit

Permalink
use FlushInstructionCache to avoid cache old instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
microcai committed Nov 9, 2024
1 parent e6abf9e commit 8ed2f31
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/executable_allocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ void ExecutableAllocator::protect(void* raw_ptr, std::size_t size)
{
DWORD old;
VirtualProtect(raw_ptr, size, PAGE_EXECUTE_READ, &old);
FlushInstructionCache(GetCurrentProcess(), raw_ptr, size);
}

void ExecutableAllocator::unprotect(void* raw_ptr, std::size_t size)
Expand Down

0 comments on commit 8ed2f31

Please sign in to comment.