rendered paste bodybool CDetour::RestoreFunction( BYTE* func, int len ){ MEMORY_BASIC_INFORMATION mbi; bool bRet = false; VirtualQuery( ( void* )orig, &mbi, sizeof( mbi ) ); VirtualProtect( mbi.BaseAddress, mbi.RegionSize, PAGE_EXECUTE_READWRITE, &mbi.Protect ); memcpy( ( void* )func, ( void* )bBackup, len ); if( *( BYTE* )func == *( BYTE* )bBackup ) { bRet = true; }else{ bRet = false; } VirtualProtect( mbi.BaseAddress, mbi.RegionSize, mbi.Protect, &mbi.Protect ); FlushInstructionCache( GetCurrentProcess( ), ( void* )func, len ); return bRet;}bool CDetour::BackupFunction( BYTE* func, int len ){ MEMORY_BASIC_INFORMATION mbi; bool bRet = false; VirtualQuery( ( void* )orig, &mbi, sizeof( mbi ) ); VirtualProtect( mbi.BaseAddress, mbi.RegionSize, PAGE_EXECUTE_READWRITE, &mbi.Protect ); memcpy( ( void* )bBackup, ( void* )func, len ); if( *( BYTE* )bBackup == *( BYTE* )func ) { bRet = true; }else{ bRet = false; } VirtualProtect( mbi.BaseAddress, mbi.RegionSize, mbi.Protect, &mbi.Protect ); FlushInstructionCache( GetCurrentProcess( ), ( void* )func, len ); return bRet;}