diff -r 62eeb8e6ff24 -r 0c0c0ab2e9ba sourcehook/sourcehook_impl.h --- a/sourcehook/sourcehook_impl.h Thu Jul 07 13:09:57 2005 +0000 +++ b/sourcehook/sourcehook_impl.h Thu Jul 07 18:21:32 2005 +0000 @@ -13,6 +13,11 @@ #include "sourcehook.h" +#ifdef __linux__ +#include +#include +#endif + // Set this to 1 to enable runtime code generation (faster) #define SH_RUNTIME_CODEGEN 1 @@ -77,6 +82,22 @@ void RemoveCallClassPatch(CallClassInfo &cc, int vtbl_offs, int vtbl_idx); void RemoveCallClassPatches(void *ifaceptr, int vtbl_offs, int vtbl_idx); +#ifdef __linux__ + /** + * @brief Checks to see if a memory value can be read from a given pointer. + * + * @return True if the value can be read and false if it cannot. + * + * @param ptr The pointer to the memory value. + * @param len The length of the memory value to be read from the pointer. + */ + static bool IsBadReadPtr(const void *ptr, size_t len); + static void BadReadHandler(int sig); + + bool m_BadReadCalled; + jmp_buf m_BadReadJmpBuf; +#endif + META_RES m_Status, m_PrevRes, m_CurRes; const void *m_OrigRet; const void *m_OverrideRet;