unknowncheats uc-forum.com ucdownloads ucdownloads.com

Go Back   UC-Tutorials - Multiplayer Game Hacking and Cheat Tutorials > First-Person Shooters > Combat Arms

- Sponsored Advertisement -
http://www.myfpscheats.com/


Reply
 
Thread Tools Display Modes
  #1  
Old 05-15-2010, 03:23 AM
disco disco is offline
Administrator
 
Join Date: Feb 2010
Posts: 271
Default [Detected] GameDevice Pointer Example Code

Posted by Gellin.




I began making a combat arms hook yesterday, and after much much much trying to make this undetected i have switched to engine hooking so i decided to share some EXAMPLE CODE.

The pointers are for NA version.

Seems to get detected a few seconds after you enter a game because it close's silently.
Code:
bool IsIngame = false;

void __cdecl PushToConsole( const char* szCommand )//Untested
{
    DWORD *LTClient = ( DWORD* )( 0x37577B3 );

    __asm
    {
        PUSH szCommand;
        CALL DWORD PTR [LTClient + 0x208];
        ADD ESP, 0x4;
    }
} 

void DrawTri(LPDIRECT3DDEVICE9 dev, int x, int y, int w, int h, DWORD Color)//I know this isnt the fastest method to render a rect but its just
{                                                                            //to make sure the d3d hooked
    D3DRECT BarRect = { x, y, x + w, y + h }; 
    dev->Clear(1, &BarRect, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, Color, 0,  0); 
}

HRESULT WINAPI gellPres(LPDIRECT3DDEVICE9 pDevice, CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion)
{
    DrawTri(pDevice, 100, 100, 100, 100, 0xFFFF0000);
        
    if(GetAsyncKeyState(VK_UP)&1)
        IsIngame =! IsIngame;

    if(IsIngame)
    {
        if(GetAsyncKeyState(VK_SPACE) < 0)//Fly hack
            PushToConsole("PlayerGravity 800");//tested and working in EU 
        else
            PushToConsole("PlayerGravity -800");
    }

    return pPres(pDevice, pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion);
}

DWORD GetPointer(int index)
{
    DWORD* devicePtr = ***(DWORD****)0x7E4CE0;

    if( devicePtr == NULL ) 
        return 0;

    return devicePtr[index];
}

bool IsGameReadyForHook()
{
    if( GetModuleHandle( "d3d9.dll"     ) != NULL 
     && GetModuleHandle( "ClientFX.fxd" ) != NULL 
     && GetModuleHandle( "CShell.dll"   ) != NULL )
        return true;

    return false;
}

void Hook()
{
    m_dwDip = GetPointer(17);
   //CALL your detour here
}

DWORD WINAPI dwMainThread(LPVOID)
{
    while ( !IsGameReadyForHook() )
        Sleep(5);

    Hook();

    return 0;
}

BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
{
    DisableThreadLibraryCalls(hDll);

    if ( dwReason == DLL_PROCESS_ATTACH )
    {
        CreateThread(NULL, NULL, dwMainThread, NULL, NULL, NULL);
    }

    return TRUE;
}
Enjoy or Not.

Credits: Credzis tested the fly hack in EU, let me use his comp to get the EU pointers which he converted to NA pointers.
Reply With Quote
Reply

  • Submit Thread to Digg
  • Submit Thread to del.icio.us
  • Submit Thread to StumbleUpon
  • Submit Thread to Google
  • Submit Thread to Facebook
  • Submit Thread to My Yahoo!
  • Submit Thread to MySpace
  • Submit Thread to Twitter
  • Submit Thread to Reddit

Tags
arms, code, combat, detected, gamedevice, pointer

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 07:40 PM.