Results 1 to 9 of 9
  1. #1
    kmanev073's Avatar
    Join Date
    Feb 2011
    Gender
    male
    Location
    Bulgaria
    Posts
    2,400
    Reputation
    97
    Thanks
    2,537
    My Mood
    Cool

    Having trouble with one weapon class hack... Everybody enter and have fun !

    Hi guys,
    I wanted to make an class hack but i am having trouble with the weapon mgr hacks... i mean BasicPlayerInfo hacks are working but... no need more comments this is the code that i made (actually i wont post the whole base... only the problem code) :

    Code:
    DWORD cshell = (DWORD)GetModuleHandleA("CShell.dll");
    
    #define weaponMgr			0xAAC3D0
    #define basicPlayerInfo		0xA452C8
    
    DWORD pWeaponMgr = *(DWORD*)(cshell + weaponMgr);													
    DWORD pBasicPlayerInfo = *(DWORD*)(cshell + basicPlayerInfo);	
    
    class cWeaponList
    {
    	public:
    	char spacer00[2];
    	unsigned short WeaponClass;
    	int WeaponIndex;
    	char WeaponName[12];
    	char spacer02[1288];
    	float SpreadMin[9];
    	char spacer03[324];
    	float SpreadMax[9];
    	char spacer04[324];
    	float WeaponRange;
    	unsigned short MaxAmmo;
    	unsigned short AmmoPerMagazine;
    	unsigned short NanoMaxAmmo;
    	unsigned short NanoAmmoPerMagazine;
    	float AmmoDamage;
    	float UnlimitedAmmo;
    	int TargetSlot;
    	int SubType;
    	float DamageFactorByDistance;
    	float DamageVariationFactor;
    	float ShotsPerMinute;
    	char spacer05[24];
    	unsigned char ShotsPerAmmo;
    	char spacer06;
    	unsigned short WeaponPrice;
    	unsigned short AmmoPrice;
    	bool ReloadSingleAmmo;
    	char spacer07[3];
    	float BoomDuration;
    	char spacer08[480];
    	float KnifeNormalRange[4];
    	float KnifeYawPitch[2];
    	float KnifeNormalAnimationRate[3];
    	float KnifeBigshotRange[4];
    	float KnifeBigshotYawPitch[2];
    	float KnifeBigshotAnimationRate[3];
    	char spacer9[72];
    	unsigned char FireMode;
    	char spacer10[3];
    	unsigned char ZoomMode;
    	char spacer11[3];
    	unsigned char ZoomAttributes;
    	char spacer12[3];
    	unsigned char ReloadAttributes;
    	char spacer13[3];
    	unsigned char KnifeAttributes;
    	char spacer14[3];
    	bool IsDroppedWhenDie;
    	char spacer15[8];
    	float StunTime;
    	int SubWeaponIndex;
    	float DamageRatioPerNode;
    	char spacer16[236];
    	float KnifeNormalAmmoDamage[3];
    	float KnifeBigShotAmmoDamage[3];
    	char spacer17[28];
    	float SmokeAlpha;
    	char spacer18[3416];
    	D3DXVECTOR3 BulletPosOffset;
    	char spacer19[2848];
    	float SpeedPenalty[3];
    	char spacer20[4];
    	float FireAnimationMultiplier[3];
    	char spacer21[164];
    	int DelayOneShootTime[3];
    	char spacer22[276];
    	float ThrowVelAngleGravityAirResTime[3];
    	char spacer23[4];
    	unsigned char BoomType;
    	unsigned char BoomDurationDamage;
    	char spacer24[2];
    	float BoomDamageCheckInterval;
    	float SideEffectDamage;
    	float SideEffectTimeGap;
    	float DamagePenaltyTimeAndMoveRate[2];
    	float NanoDamagePenaltyTimeAndMoveRate[2];
    	float WallShotDamageRatio;
    	float ReloadAnimRatio;
    	float ChangeWeaponAnimRatio;
    	char spacer25[188];
    	bool HaveKnife;
    	char spacer26[39];
    	float KnockBack;
    };
    
    if(pWeaponMgr)
    	{
    	for (int i=0;i<601;i++)
    		{		
    			cWeaponList * WeaponList = *(cWeaponList ** )(cshell + weaponMgr + (4*i));
    			if (WeaponList)
    			{
    				WeaponList->ReloadAnimRatio = 150.0f;
    				WeaponList->ChangeWeaponAnimRatio = 100.0f;
    			}
    		}
    	}
    i get an send error report then the game crashes

  2. #2
    DaRk's Avatar
    Join Date
    Dec 2010
    Gender
    male
    Location
    MPGH
    Posts
    1,910
    Reputation
    119
    Thanks
    3,986
    My Mood
    Asleep
    the most common reason would be that ur classes is wrong..just reverse what u need.. u dont have to reverse everything
    for expamle:
    class cWeapon
    {
    public:
    char spacer[9892];
    float ReloadAnimRatio;
    float ChangeWeaponAnimRatio;
    };
    u dont have to reverse useless stuff..

  3. The Following User Says Thank You to DaRk For This Useful Post:

    Insane~* (03-19-2012)

  4. #3
    ~FALLEN~'s Avatar
    Join Date
    May 2009
    Gender
    male
    Location
    devenv.exe
    Posts
    529
    Reputation
    23
    Thanks
    328
    My Mood
    Inspired
    Updated one...

    Code:
    class cWeaponList{
    	public:
    		char spacer00[2];
    		unsigned short WeaponClass;
    		unsigned int WeaponIndex;
    		char WeaponName[12];
    		char spacer02[1288];
    		float SpreadMin[9];
    		char spacer03[324];
    		float SpreadMax[9];
    		char spacer04[324];
    		float WeaponRange;
    		unsigned short MaxAmmo;
    		unsigned short AmmoPerMagazine;
    		unsigned short NanoMaxAmmo;
    		unsigned short NanoAmmoPerMagazine;
    		float AmmoDamage;
    		float UnlimitedAmmo;
    		int TargetSlot;
    		int SubType;
    		float DamageFactorByDistance;
    		float DamageVariationFactor;
    		float ShotsPerMinute;
    		char spacer05[20];
    		unsigned char ShotsPerAmmo;
    		char spacer06;
    		unsigned short WeaponPrice;
    		unsigned short AmmoPrice;
    		bool ReloadSingleAmmo;
    		char spacer07[3];
    		float BoomDuration;
    		char spacer08[482];
    		float KnifeNormalRange[4];
    		float KnifeYawPitch[2];
    		float KnifeNormalAnimationRate[3];
    		float KnifeBigshotRange[4];
    		float KnifeBigshotYawPitch[2];
    		float KnifeBigshotAnimationRate[3];
    		char spacer9[64];
    		unsigned char FireMode;
    		char spacer10[3];
    		unsigned char ZoomMode;
    		char spacer11[3];
    		unsigned char ZoomAttributes;
    		char spacer12[3];
    		unsigned char ReloadAttributes;
    		char spacer13[3];
    		unsigned char KnifeAttributes;
    		char spacer14[3];
    		bool IsDroppedWhenDie;
    		char spacer15[11];
    		float StunTime;
    		int SubWeaponIndex;
    		float DamageRatioPerNode;
    		char spacer16[236];
    		float KnifeNormalAmmoDamage[3];
    		float KnifeBigShotAmmoDamage[3];
    		char spacer17[28];
    		float SmokeAlpha;
    		char spacer18[3392];
    		D3DXVECTOR3 BulletPosOffset;
    		char spacer19[2848];
    		float SpeedPenalty[3];
    		char spacer20[4];
    		float FireAnimationMultiplier[3];
    		char spacer21[160];
    		int DelayOneShootTime[3];
    		char spacer22[276];
    		float ThrowVelAngleGravityAirResTime[3];
    		char spacer23[8];
    		unsigned char BoomType;
    		unsigned char BoomDurationDamage;
    		char spacer24[2];
    		float BoomDamageCheckInterval;
    		float SideEffectDamage;
    		float SideEffectTimeGap;
    		float DamagePenaltyTimeAndMoveRate[2];
    		float NanoDamagePenaltyTimeAndMoveRate[2];
    		float WallShotDamageRatio;
    		char spacer25[48];
    		float ReloadAnimRatio;
    		float ChangeWeaponAnimRatio;
    		char spacer26[188];
    		bool HaveKnife;
    		char spacer27[39];
    		float KnockBack;
    	};

  5. The Following 2 Users Say Thank You to ~FALLEN~ For This Useful Post:

    -iFaDy..* (03-19-2012),giniyat101 (03-19-2012)

  6. #4
    kmanev073's Avatar
    Join Date
    Feb 2011
    Gender
    male
    Location
    Bulgaria
    Posts
    2,400
    Reputation
    97
    Thanks
    2,537
    My Mood
    Cool
    @DaRk @~FALLEN~ thank you for the response guys but.. hte result is the same maybe something in the loop or... ? any other idea?

  7. #5
    giniyat101's Avatar
    Join Date
    Sep 2011
    Gender
    male
    Location
    Not telling.
    Posts
    1,935
    Reputation
    130
    Thanks
    1,380
    My Mood
    Dead
    @kmanev073
    check this:
    https://www.mpgh.net/forum/242-crossf...mple-menu.html
    i used classes
    try using the newest class..


     



    [img]https://i43.photobucke*****m/albums/e367/DeteSting/Steam-update.gif[/img]

  8. #6
    kmanev073's Avatar
    Join Date
    Feb 2011
    Gender
    male
    Location
    Bulgaria
    Posts
    2,400
    Reputation
    97
    Thanks
    2,537
    My Mood
    Cool
    Quote Originally Posted by giniyat101 View Post
    @kmanev073
    check this:
    https://www.mpgh.net/forum/242-crossf...mple-menu.html
    i used classes
    try using the newest class..
    THEFUQ dude it worked the proble was that " * noReload and * noChange" in the end LOL why can you explain why i need a bool here ? And why i ave to use '*' in declarations of DWORDs or any type... LOL

  9. #7
    ~FALLEN~'s Avatar
    Join Date
    May 2009
    Gender
    male
    Location
    devenv.exe
    Posts
    529
    Reputation
    23
    Thanks
    328
    My Mood
    Inspired
    Are you checking for null pointers? If you try to access a null pointer an exception is thrown and the application must terminate.

  10. #8
    giniyat101's Avatar
    Join Date
    Sep 2011
    Gender
    male
    Location
    Not telling.
    Posts
    1,935
    Reputation
    130
    Thanks
    1,380
    My Mood
    Dead
    Quote Originally Posted by kmanev073 View Post
    THEFUQ dude it worked the proble was that " * noReload and * noChange" in the end LOL why can you explain why i need a bool here ? And why i ave to use '*' in declarations of DWORDs or any type... LOL
    you mean these 2 lines:
    Code:
    pWeapon->ReloadAnimRatio = 1.0f + 99.0f * noReload;
    pWeapon->ChangeWeaponAnimRatio = 1.0f + 99.0f * noChange;
    * is multiply, + is addition, and the multiply is executed before addition
    so when noReload == 0

    pWeapon->ReloadAnimRatio = 1.0f + 99.0f * 0 = 1.0f + 0 = 1.0f

    and when it is == 1

    pWeapon->ReloadAnimRatio = 1.0f + 99.0f * 1 = 1.0f + 99.0f = 100.0f


     



    [img]https://i43.photobucke*****m/albums/e367/DeteSting/Steam-update.gif[/img]

  11. The Following 2 Users Say Thank You to giniyat101 For This Useful Post:

    Dragon(H)ell (03-20-2012),kmanev073 (03-20-2012)

  12. #9
    kmanev073's Avatar
    Join Date
    Feb 2011
    Gender
    male
    Location
    Bulgaria
    Posts
    2,400
    Reputation
    97
    Thanks
    2,537
    My Mood
    Cool
    Quote Originally Posted by giniyat101 View Post
    you mean these 2 lines:
    Code:
    pWeapon->ReloadAnimRatio = 1.0f + 99.0f * noReload;
    pWeapon->ChangeWeaponAnimRatio = 1.0f + 99.0f * noChange;
    * is multiply, + is addition, and the multiply is executed before addition
    so when noReload == 0

    pWeapon->ReloadAnimRatio = 1.0f + 99.0f * 0 = 1.0f + 0 = 1.0f

    and when it is == 1

    pWeapon->ReloadAnimRatio = 1.0f + 99.0f * 1 = 1.0f + 99.0f = 100.0f
    lol great... i dindnt know that you can multy ply bool with int thanks

    ---------- Post added at 04:12 PM ---------- Previous post was at 03:44 PM ----------

    Quote Originally Posted by ~FALLEN~ View Post
    Are you checking for null pointers? If you try to access a null pointer an exception is thrown and the application must terminate.
    yes dude i check for pWeaponMgr and then for the weaponClass...

Similar Threads

  1. [Solved] I am having trouble with CA hacks...
    By iVirus in forum Combat Arms Help
    Replies: 5
    Last Post: 08-21-2011, 11:33 AM
  2. Hello,having troubles with hacks<<! Me I need help.
    By CodeNameDevil7 in forum Combat Arms Help
    Replies: 7
    Last Post: 03-30-2011, 08:40 AM
  3. Having trouble with MPGH public hack??
    By henrychen69 in forum Combat Arms Help
    Replies: 2
    Last Post: 09-03-2010, 03:30 AM
  4. [HELP] If you are having trouble with hacks. 6/19/10
    By DawgiiStylz in forum CrossFire Help
    Replies: 26
    Last Post: 06-23-2010, 07:10 PM
  5. Having trouble with the latest hack
    By flytuff in forum Combat Arms Hacks & Cheats
    Replies: 0
    Last Post: 01-11-2009, 06:16 PM