sourcehook/sourcehook_impl.h
changeset 86 0c0c0ab2e9ba
parent 58 71016f952503
child 90 828fa4d35bdf
     1.1 --- a/sourcehook/sourcehook_impl.h	Thu Jul 07 13:09:57 2005 +0000
     1.2 +++ b/sourcehook/sourcehook_impl.h	Thu Jul 07 18:21:32 2005 +0000
     1.3 @@ -13,6 +13,11 @@
     1.4  
     1.5  #include "sourcehook.h"
     1.6  
     1.7 +#ifdef __linux__
     1.8 +#include <signal.h>
     1.9 +#include <setjmp.h>
    1.10 +#endif
    1.11 +
    1.12  // Set this to 1 to enable runtime code generation (faster)
    1.13  #define SH_RUNTIME_CODEGEN 1
    1.14  
    1.15 @@ -77,6 +82,22 @@
    1.16  		void RemoveCallClassPatch(CallClassInfo &cc, int vtbl_offs, int vtbl_idx);
    1.17  		void RemoveCallClassPatches(void *ifaceptr, int vtbl_offs, int vtbl_idx);
    1.18  
    1.19 +#ifdef __linux__
    1.20 +		/**
    1.21 +		*	@brief Checks to see if a memory value can be read from a given pointer.
    1.22 +		*
    1.23 +		*	@return True if the value can be read and false if it cannot.
    1.24 +		*
    1.25 +		*	@param ptr The pointer to the memory value.
    1.26 +		*	@param len The length of the memory value to be read from the pointer.
    1.27 +		*/
    1.28 +		static bool IsBadReadPtr(const void *ptr, size_t len);
    1.29 +		static void BadReadHandler(int sig);
    1.30 +
    1.31 +		bool m_BadReadCalled;
    1.32 +		jmp_buf m_BadReadJmpBuf;
    1.33 +#endif
    1.34 +
    1.35  		META_RES m_Status, m_PrevRes, m_CurRes;
    1.36  		const void *m_OrigRet;
    1.37  		const void *m_OverrideRet;