Update patternfind.c
This commit is contained in:
@@ -5,7 +5,8 @@ Licensed under Lesser GNU Public License 3.0
|
||||
|
||||
Changes made:
|
||||
|
||||
- Ported to C, removed dependency on C++ type vector<T>
|
||||
- Uses stdint.h type uint8_t instead of unsigned char (for readability)
|
||||
- Renamed patternfind overloads to patternfind, patternfind_bytes, patternfind_pbyte
|
||||
- Added VirtualProtect calls to patternwrite function to prevent access violation exceptions
|
||||
- Ported to C, removed dependency on C++ type vector<T>.
|
||||
- Uses stdint.h type uint8_t instead of unsigned char (for readability).
|
||||
- Renamed patternfind overloads to patternfind, patternfind_bytes, patternfind_pbyte.
|
||||
- Added VirtualProtect to patternwrite function to prevent access violation exceptions.
|
||||
- Added FlushInstructionCache to patternwrite function.
|
||||
|
@@ -150,6 +150,7 @@ void patternwrite(uint8_t *data, size_t datasize, const char *pattern)
|
||||
for ( size_t i = 0; i < writepatternsize; i++ )
|
||||
patternwritebyte(&data[i], writepattern[i]);
|
||||
result = VirtualProtect(data, writepatternsize, OldProtect, &OldProtect);
|
||||
FlushInstructionCache(GetCurrentProcess(), data, datasize);
|
||||
}
|
||||
|
||||
free(writepattern);
|
||||
|
Reference in New Issue
Block a user