Thread: Will this work?

Results 1 to 2 of 2
  1. #1
    ipod crazy's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Location
    sdfdfds
    Posts
    9
    Reputation
    10
    Thanks
    2

    Will this work?

    This is the source code for auto wall on cod 4.
    Code:
    Code:
    /************************************************************************/
    /*                                                                      */
    /************************************************************************/
    
    #ifndef _C_AUTOWALL_H_
    #define _C_AUTOWALL_H_
    
    class CAutoWall
    {
    private:
    
    	void	DisableBulletImpacts( );
    	void	DisableBulletTrails( );
    
    	void	EnableBulletImpacts( );
    	void	EnableBulletTrails( );
    
    	void	SetupBulletTrace( bulletTrace_t* btr, vec3_t start, vec3_t end, int skipNum );
    
    
    public:
     
    	CAutoWall( );
    	~CAutoWall( );
    
    	bool	GetRemainingPower( vec3_t vieworg, centity_t* cent, vec3_t origin, float* remainingPower  );
    };
    
    extern CAutoWall AutoWall;
    
    #endif
    
    
    
    
    code:
    CAutoWall::CAutoWall( )
    {
    
    }
    
    // ----------------------------------------------------------------------
    
    CAutoWall::~CAutoWall( )
    {
    
    }
    
    void CAutoWall::SetupBulletTrace( bulletTrace_t* btr, vec3_t start, vec3_t end, int skipNum )
    {
    	btr->worldEntNum = 1022;
    	btr->skipNum = skipNum;
    	btr->power = 1.0f;
    	btr->bulletType = 1;
    	VectorCopy( cg->refdef.Vieworg, btr->vieworg );
    	VectorCopy( start, btr->start );
    	VectorCopy( end, btr->end );
    
    	vec3_t delta;
    	VectorSubtract( end, start, delta );
    
    	vec3_t angles;
    	Math.vectoangles( delta, angles );
    	Math.AngleVectors( angles, btr->viewDirection, NULL, NULL );
    }
    
    void DrawBulletTrajectory( centity_t* cent, int a2, bulletTrace_t* bulletTrace, weapon_t* weapon, vec3_t vieworg, int serverTimeDelta )
    {
    	DWORD dwCallAddr = 0x00455A80;
    	__asm
    	{
    		push	[ serverTimeDelta ];
    		push	[ vieworg ];
    		push	[ weapon ];
    		push	[ bulletTrace ];
    		push	[ a2 ];
    		mov		edi, [ cent ];
    		call	[ dwCallAddr ];
    		add		esp, 0x14;
    	}
    }
    
    void PatchBytes( void * lpAddress, const char * szBytes, int nLen )
    {
    	// Needed by VirtualProtect.
    	DWORD dwBack = 0;
    	VirtualProtect( lpAddress, nLen, PAGE_READWRITE, &dwBack );
    
    	// Write Byte-After-Byte.
    	for( int i = 0; i < nLen; i++ )
    		*( BYTE * )( ( DWORD )lpAddress + i ) = szBytes[ i ];
    
    	// Restore old protection.
    	VirtualProtect( lpAddress, nLen, dwBack, &dwBack );
    }
    
    
    void CAutoWall::DisableBulletImpacts( )
    {
    	PatchBytes( ( void* )0x00455A20, "\xC3", 1 );
    }
    
    // ----------------------------------------------------------------------
    
    void CAutoWall::DisableBulletTrails( )
    {
    	PatchBytes( ( void* )0x00458110, "\xC3", 1 );
    }
    
    // ----------------------------------------------------------------------
    
    void CAutoWall::EnableBulletImpacts( )
    {
    	PatchBytes( ( void* )0x00455A20, "\x8B", 1 );
    }
    
    // ----------------------------------------------------------------------
    
    void CAutoWall::EnableBulletTrails( )
    {
    	PatchBytes( ( void* )0x00458110, "\x83", 1 );
    }
    
    // ----------------------------------------------------------------------
    
    weapon_t**		cg_weapons2			= ( weapon_t** )0x00736DB8;
    
    bool CAutoWall::GetRemainingPower( vec3_t vieworg, centity_t* cent, vec3_t origin, float* remainingPower )
    {
    	bulletTrace_t bulletTrace;
    	SetupBulletTrace( &bulletTrace, vieworg, origin, 0 );
    
    	int serverTimeDelta = cg->nextSnap->serverTime - cg->snap->serverTime;
    
    	if ( serverTimeDelta < 0 )
    		serverTimeDelta = 0;
    
    	DisableBulletImpacts( );
    	DisableBulletTrails( );
    
    	DrawBulletTrajectory( &cg->predictedPlayerEntity, 0, &bulletTrace, cg_weapons2[ cg->predictedPlayerState.weapon ], vieworg, serverTimeDelta );
    
    	EnableBulletImpacts( );
    	EnableBulletTrails( );
    	if ( bulletTrace.skipNum == cent->clientNum )
    	{
    		*remainingPower = bulletTrace.power;
    
    		return true;
    	}
    	else
    	{
    		*remainingPower = 0.0f;
    
    		return false;
    	}
    }
    Last edited by master131; 01-20-2012 at 06:47 PM.

  2. #2
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,802
    Reputation
    3165
    Thanks
    73,322
    My Mood
    Breezy
    Of course it won't work, COD4 and MW3 are different and those addresses are wrong... Also, next time, use a proper code box...

    /closed
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.6.1 *NEW* Windows 10 compatible!
    A powerful and advanced injector in a simple GUI.
    Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!

    Minion Since: 13th January 2011
    Moderator Since: 6th May 2011
    Global Moderator Since: 29th April 2012
    Super User/Unknown Since: 23rd July 2013
    'Game Hacking' Team Since: 30th July 2013

    --My Art--
    [Roxas - Pixel Art, WIP]
    [Natsu - Drawn]
    [Natsu - Coloured]


    All drawings are coloured using Photoshop.

    --Gifts--
    [Kyle]

Similar Threads

  1. Will this Work?
    By xxxPROFINITYxxx in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 14
    Last Post: 08-16-2010, 06:13 AM
  2. [HELP] Will This Work?
    By ^...,^ in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 9
    Last Post: 06-04-2010, 08:07 PM
  3. Will this work?
    By toonshorty in forum Call of Duty Modern Warfare 2 Help
    Replies: 8
    Last Post: 04-12-2010, 09:11 PM
  4. [REQUEST] Can you change the Damage of guns? Will this work?
    By W$fSEDfw435sef in forum Combat Arms Mod Discussion
    Replies: 8
    Last Post: 01-02-2010, 11:26 PM
  5. will this work?
    By mpentlan01 in forum WarRock - International Hacks
    Replies: 9
    Last Post: 06-08-2009, 01:32 PM