mirror of
https://github.com/alliedmodders/metamod-source.git
synced 2025-12-07 02:18:30 +00:00
dvander foxes
This commit is contained in:
parent
5374982bce
commit
96695e209e
@ -248,7 +248,7 @@ namespace SourceHook
|
|||||||
*/
|
*/
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
bool ModuleInMemory(char *addr, size_t len)
|
static inline bool ModuleInMemory(char *addr, size_t len)
|
||||||
{
|
{
|
||||||
#if SH_SYS == SH_SYS_LINUX
|
#if SH_SYS == SH_SYS_LINUX
|
||||||
// On linux, first check /proc/self/maps
|
// On linux, first check /proc/self/maps
|
||||||
@ -322,10 +322,8 @@ namespace SourceHook
|
|||||||
prevHandler = signal(SIGSEGV, BadReadHandler);
|
prevHandler = signal(SIGSEGV, BadReadHandler);
|
||||||
|
|
||||||
volatile const char *p = reinterpret_cast<const char*>(addr);
|
volatile const char *p = reinterpret_cast<const char*>(addr);
|
||||||
char dummy;
|
|
||||||
|
|
||||||
for (size_t i = 0; i < len; i++)
|
for (size_t i = 0; i < len; i++)
|
||||||
dummy = p[i];
|
p[i];
|
||||||
|
|
||||||
g_BadReadCalled = false;
|
g_BadReadCalled = false;
|
||||||
|
|
||||||
@ -346,10 +344,8 @@ namespace SourceHook
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
volatile const char *p = reinterpret_cast<const char *>(addr);
|
volatile const char *p = reinterpret_cast<const char *>(addr);
|
||||||
char dummy;
|
|
||||||
|
|
||||||
for (size_t i = 0; i < len; i++)
|
for (size_t i = 0; i < len; i++)
|
||||||
dummy = p[i];
|
p[i];
|
||||||
|
|
||||||
g_BadReadCalled = false;
|
g_BadReadCalled = false;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user