Basic tut on using C++ for GunZ

On martes, 26 de abril de 2011 0 comentarios

Ok it still chrashes. Probaly because it tries to execute. And can't find it.

So I tought like this:
PHP Code:
#include 
#include "ZFuncs.h"
charChatInput( )
{
    return( 
char* ) ( ZGetGameInterface( ) + 0x3A8 );
}
void Clear( )
{
  (* (
char* ) ( ZGetGameInterface( ) + 0x3A8 ) ) = '\n';
}
void MyThread( )
{
    for( ;;
Sleep20 ) )
    {
        if (
ZGetGameInterface!=0x0) {
        if( 
memcmpChatInput( ), "/dood") == )
        {
        
ZCharacter::SetHP(0);
        
ZCharacter::SetAP(0);
            
Clear( ); //You have to clear you're last input, or you can't input another command.
        
}
        }
    }
}
extern "C"{
    
__declspecdllexport BOOL __stdcall DllMainHINSTANCE hInstDWORD dwReasonLPVOID lpv )
    {
        
DisableThreadLibraryCallshInst );
        if ( 
dwReason == DLL_PROCESS_ATTACH )
        {
            
Beep500500 );
            
CreateThreadNULL0, ( LPTHREAD_START_ROUTINE )&MyThreadNULL0NULL );
        }
            return 
true;
    }
But it still doesn't work.

Maybe is the handling of the ZGetGameInterface wrong
PHP Code:
DWORD ZGetGameInterface()
{
    
DWORD ReturnVal;
    if (
ZGetGameInterfaceAddress!=0x0)
    {
        
__asm
        
{
            
MOV EAXZGetGameInterfaceAddress
            CALL EAX
            MOV ReturnVal
EAX
        
}
    }else{
        return 
0x0;
    }
return 
ReturnVal;

0 comentarios:

Publicar un comentario