Cheat Engine Fix

03/16/2015 17:09 Exrib0.#1
Guten Tag,

Ich möchte heute einen Cheat Engine Fix releasen. Er erfüllt seinen Zweck soweit ganz gut. Ihr müsst nichts weiter machen als :

Neuz.cpp :

unter :

PHP Code:
CNeuzApp::CNeuzApp()
{ 
das :

PHP Code:
#ifdef __CEFIX
    
LPCTSTR hackNames [] = {"propItem.txt","propMover.txt","propSkill.txt",
                             
"character.inc","propItemEtc.txt.txt","propItem.txt.txt",
                             
"propItemEtc.inc","propMoverEx.inc","propSkillAdd.csv",
                             
"accessory.inc","randomoption.inc","randomeventmonster.inc",};
     
    for(
int i = 0; i < (sizeof(hackNames)/sizeof(hackNames[0])) -1 ; i++)
        {
            if ( 
DeleteFile(hackNames[i]) == 0  )
            {
                
int mylasterror = GetLastError();
                if (
mylasterror != 2 && mylasterror != 123)
                {
                    
char buffer[32];
                    
wsprintf(buffer, "Client Modified: %d", GetLastError());
                    
                    
MessageBox( g_Neuz.GetSafeHwnd(), buffer , "Benachrichtigung:", MB_OK );
                    
ExitProcess( -1 );
                }
            }    
        
        }
#endif 
unter :

PHP Code:
void CNeuzApp::WaitLoading()
{
    
OutputDebugString("WaitLoading start\n"); 
das :

PHP Code:
#ifdef __CEFIX    
        
g_Neuz.m_SecutityDLL = true;
#endif 
unter :

PHP Code:
//
// µð¹ÙÀ̽º¿Í ºñµ¶¸³ÀûÀΠ¸Å½¬, Æú¸®°ï µîÀ» Ã³À½ ÃʱâÈ* Çϴ °÷ 
// 
das :

PHP Code:
#ifdef __CEFIX
    
void CNeuzApp::StartGuardThread()
    {
        
m_threadGuard = AfxBeginThread( _GuardThreadFunc, this );
        
m_threadGuard2=AfxBeginThread( _GuardThread2Func, this );
        
m_threadGuard3=AfxBeginThread( _GuardThread3Func, this );
        if ( 
m_threadGuard == NULL )
        {
            
MessageBox( g_Neuz.GetSafeHwnd(), "Schließe den Client!", "Benachrichtigung:", MB_OK );
            
ExitProcess( -1 );
        }
        if ( 
m_threadGuard2 == NULL )
        {
            
MessageBox( g_Neuz.GetSafeHwnd(), "Schließe den Client!", "Benachrichtigung:", MB_OK );
            
ExitProcess( -1 );
        }
        if ( 
m_threadGuard3 == NULL )
        {
            
MessageBox( g_Neuz.GetSafeHwnd(), "Schließe den Client!", "Benachrichtigung:", MB_OK );
            
ExitProcess( -1 );
        }
        
m_threadGuard->m_bAutoDelete = FALSE;
        
m_threadGuard->ResumeThread();

        
m_threadGuard2->m_bAutoDelete = FALSE;
        
m_threadGuard2->ResumeThread();

        
m_threadGuard3->m_bAutoDelete = FALSE;
        
m_threadGuard3->ResumeThread();
    }

    
UINT CNeuzApp::_GuardThreadFunc( LPVOID param ) //thread 1 gegen speedhacks
    
{
        
unsigned int nLastTick = GetTickCount();
        
char q_count = 0;
        
unsigned int x = 0;
        while( 
1 )
        {
            
            
Sleep(1000);
            
x = (GetTickCount()-nLastTick)/100;
            if(
x > 0 && x < 11)
                
x=10;
            
q_count += (x-10)>0;
            
q_count -= (q_count==0)  ? 0 : (x-10) == 0;
            
nLastTick = GetTickCount();
            if( 
q_count >= 5 )
            {
           
                
Error("Gameguard: Speed Hack!");
                
g_Neuz.Pause(true);
                
MessageBox( g_Neuz.GetSafeHwnd(), "Speedhack gefunden!", "Benachrichtigung:", MB_OK );
                
ExitProcess( -1 );
            }    

            
            
        }
    }

    
UINT CNeuzApp::_GuardThread2Func( LPVOID param ) // thread 2 antidll , rewrite dll injection
    
{

        
HANDLE hProc = GetCurrentProcess(); 
        while (
true) { 
            if (
g_Neuz.m_SecutityDLL)
            {
                
BlockAPI(hProc, "NTDLL.DLL", "LdrLoadDll"); 
            }
            
Sleep (100); 
        } 
    return 
1;
    }


    
UINT CNeuzApp::_GuardThread3Func( LPVOID param ) // thread 3 windowchecks - noch net fertig, testversion
    
{
        
CString windowNames [] = { "Cheat" ,"Cheat Engine" , "Engine" };
        while (
true ) 
        { 
            for(
int i = 0; i < (sizeof(windowNames)/sizeof(windowNames[0]))-1 ; i++)
            {
/*                if( FindWindow( NULL, windowNames[i] ) != NULL )
                {
                    g_Neuz.Pause(true);
                    MessageBox( g_Neuz.GetSafeHwnd(), "Bitte schließe alle Hacks!", "Benachrichtigung:", MB_OK );
                    ExitProcess( -1 );
                
                } */
                
                
if (FindWindowStart(TEXT(windowNames[i])) != 0)
                {
                    
g_Neuz.Pause(true);
                    
MessageBox( g_Neuz.GetSafeHwnd(), "Bitte schließe alle Hacks!", "Benachrichtigung:", MB_OK );
                    
ExitProcess( -1 );
                
                }
                    
            }

            
Sleep (3000); 
        } 
    return 
1;
    }



     
    
BOOL CNeuzApp::BlockAPI (HANDLE hProcess, CHAR *libName, CHAR *apiName) 
    { 
       
CHAR pRet=(CHAR)0xC3; 
       
HINSTANCE hLib = NULL; 
       
VOID *pAddr = NULL; 
       
BOOL bRet = FALSE; 
       
DWORD dwRet = 0; 
     
       
hLib = LoadLibrary (libName); 
       if (
hLib) { 
           
pAddr = (VOID*)GetProcAddress (hLib, apiName); 
           if (
pAddr) { 
               if (
WriteProcessMemory (hProcess, 
                                (
LPVOID)pAddr, 
                                (
LPVOID)pRet, 
                                
sizeof (pRet), 
                                &
dwRet )) { 
                  if (
dwRet) { 
                     
bRet = TRUE; 
                  } 
               } 
           } 
           
FreeLibrary (hLib); 
       } 
       return 
bRet; 
    }

    
////////////////////////////WINDOW ADVANCEDD ////////////////////



    
BOOL CALLBACK CNeuzApp::FindWindowImpl( HWND hWnd, LPARAM lParam ) {
        
FindWindowData * p = reinterpret_cast<FindWindowData*>( LongToPtr( lParam ) );
        if( !
p ) {
            
// Finish enumerating we received an invalid parameter
            
return FALSE;
        }

        
int length = GetWindowTextLength( hWnd ) + 1;
        if( 
length > 0 ) {
            
std::vector<TCHAR> buffer( std::size_t( length ), 0 );      
            if( 
GetWindowText( hWnd, &buffer[0], length ) ) {
                        
// Comparing the string - If you want to add some features you can do it here
                
if( _tcsnicmp( &buffer[0], p->WindowTitle.c_str(), min( buffer.size(), p->WindowTitle.size() )  ) == 0 ) {
                    
p->ResultHandle = hWnd;
                    
// Finish enumerating we found what we need
                    
return FALSE;
                }
            }
        }
        
// Continue enumerating
        
return TRUE;
    }

    
// Returns the window handle when found if it returns 0 GetLastError() will return more information
    
HWND CNeuzApp::FindWindowStart( TCHAR const * windowTitle ) {

        if( !
windowTitle ) {
            
SetLastError( ERROR_INVALID_PARAMETER );
            return 
0;
        }

        
FindWindowData data( windowTitle );
        if( !
EnumWindows( FindWindowImpl, PtrToLong(&data) ) && data.ResultHandle != 0 ) {
            
SetLastError( ERROR_SUCCESS );
            return 
data.ResultHandle;
        }

        
// Return ERROR_FILE_NOT_FOUND in GetLastError
        
SetLastError( ERROR_FILE_NOT_FOUND );
        return 
0;
    }
#endif 
Neuz.h :

unter :

PHP Code:
#include "NeuzEnemy.h" 
das :

PHP Code:
#ifdef __CEFIX
    
struct FindWindowData {
    
FindWindowData( TCHAR const * windowTitle )
        : 
WindowTitle( windowTitle )
        , 
ResultHandle( 0 )
    {}

    
std::basic_string<TCHAR> WindowTitle;
    
HWND ResultHandle;
    };
#endif 
unter :

PHP Code:
    TCHAR                    m_szPassword[MAX_PASSWORD];            // password 
das :

PHP Code:
#ifdef __CEFIX
    
CWinThread*                m_threadGuard;
    static    
UINT            _GuardThreadFunc( LPVOID param );
    
CWinThread*                m_threadGuard2;
    static    
UINT            _GuardThread2Func( LPVOID param );
    
CWinThread*                m_threadGuard3;
    static    
UINT            _GuardThread3Func( LPVOID param );
    
void                    StartGuardThread();
    static    
BOOL                     BlockAPI (HANDLE hProcess, CHAR *libName, CHAR *apiName);
    
BOOL                m_SecutityDLL ;
    static 
BOOL CALLBACK FindWindowImpl( HWND hWnd, LPARAM lParam );
    static  
HWND FindWindowStart( TCHAR const * windowTitle );
#endif 
NeuzMsgProc.cpp :

unter :

PHP Code:
#else //__LINK_PORTAL
    
if( strcmpi( szArg1, "reversion" ) )
        return 
FALSE;
#endif //__LINK_PORTAL
#else //LANG_KOR
    
if( strcmpi( szArg1, "sunkist" ) )
        return 
FALSE;
#endif //LANG_KOR
#endif //__INTERNALSERVER
*/ 
das :

PHP Code:
#ifdef __CEFIX
    
g_Neuz.m_SecutityDLL = false;
#endif 
unter :

PHP Code:
    //g_Neuz.m_dwLastTick = 0;
    //g_Neuz.m_timerCheatEngine.Set( SEC( 1 ) );
    
g_Neuz.StartSecurityThread();
#endif 
das :

PHP Code:
#ifdef __CEFIX
    
g_Neuz.StartGuardThread();
#endif 
Neuz\VersionCommon.h :

PHP Code:
#define __CEFIX 
Das ist schon alles.

Mit freundlichen Grüßen

Exrib0.
06/01/2016 17:06 tutstuts#2
Search µð¹ÙÀ̽º¿Í ºñµ¶¸³ÀûÀÎ ¸Å½¬, Æú¸®°ï µîÀ» óÀ½ ÃʱâÈ* ÇÏ´Â °÷ ?
'-'
06/01/2016 17:11 alfredico#3
Bypass??? [Only registered and activated users can see links. Click Here To Register...]
06/01/2016 20:16 EvilSlayer#4
Quote:
Originally Posted by alfredico View Post
Bypass??? [Only registered and activated users can see links. Click Here To Register...]
Uhh it's client sided so yes it's bypassable anyways.
06/01/2016 21:02 Burdenz2007#5
I think i saw this Cheat Engine Fix in some of the Source's out here. :3
Nostalgia? o.O
02/16/2017 09:11 pakinglalat#6
What line is this?

Quote:
//g_Neuz.m_dwLastTick = 0;
//g_Neuz.m_timerCheatEngine.Set( SEC( 1 ) );
g_Neuz.StartSecurityThread();
#endif