Gunz Cheat in GCC

16Jul09

I found this under an old collection files; it’s a cheat for god mode in IJJI Gunz, using AT&T inline ASM.

#include <windows.h>

BYTE gdmeCheck = 0;
BYTE tglCheck = 1;

DWORD WINAPI GetKey ( LPVOID lpParam );
DWORD WINAPI GdMde ( LPVOID lpParam );
DWORD WINAPI GetZChar ( );

BOOL APIENTRY DllMain ( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved )
{
  if( fdwReason == DLL_PROCESS_ATTACH )
  {
    CreateThread( NULL, 0, GetKey, 0, 0, NULL );
    CreateThread( NULL, 0, GdMde, 0, 0, NULL );
  }

  return( TRUE );
}

DWORD WINAPI GetKey ( LPVOID lpParam ) {
  while ( 1 ) {
   if( GetAsyncKeyState( 18 ) < 0 && GetAsyncKeyState( 71 ) < 0 )
   {
      gdmeCheck ^= 1;
      tglCheck ^= 1;
   }

   Sleep( 500 );
  }
  return( 0 );
}

DWORD WINAPI GdMde ( LPVOID lpParam ) {
 while( true ) {
   if( gdmeCheck != 0 ) {
     if( DWORD ZChar = GetZChar( ) != 0 )
       __asm__ (
        "movl %0, %%eax\n\t"
        "movl $0x461C3C00, %%ecx\n\t"
        "movl %%ecx, 0x418(%%eax)\n\t"
        "movl %%ecx, 0x41C(%%eax)\n\t"
        :"=r" (ZChar)
       );
       tglCheck = 1;
   }

   if( tglCheck != 0 )
   {
     if( DWORD ZChar = GetZChar( ) != 0 )
       __asm__ (
        "movl %0, %%eax\n\t"
        "movl $100, %%ecx\n\t"
        "movl %%ecx, 0x418(%%eax)\n\t"
        "movl %%ecx, 0x41C(%%eax)\n\t"
        :"=r" (ZChar)
       );
     tglCheck ^= 1;
   }

   Sleep( 50 );
 }
 return( 0 );
}


DWORD WINAPI GetZChar ( ) {
  DWORD ZChar = 0;
  __asm__ (
    "movl $0x49A380, %%eax\n\t"
    "movl 0x50(%%eax), %%ecx\n\t"
    "movl %%ecx, %0\n\t"
    :"=r" (ZChar)
  );
  return( ZChar );
}

Other than the HP offset, nothing’s changed, so feel free to update it šŸ˜‰

Advertisements


No Responses Yet to “Gunz Cheat in GCC”

  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s


%d bloggers like this: