Change your weapon

Posts 1–5 of 5 · Page 1 of 1
Change your weapon
In this tutorial i will show you how to change your weapon ingame.
You need to be host for it.

Things you need:
  • brain.exe
  • Cheat Engine


First we need to find the needed addresses. You have to find 3 addresses for the primary, secondary,... weapon.
How to find them: You can search for Changed Value in CE after you changed your primary weapon or you can search for Exact Value using the weaponlist by @LOLxFUN (http://www.mpgh.net/forum/showthread.php?t=479847). After you have found the 3 addresses you can also do this for your secondary weapon and if you start brain.exe you can also find the addresses for your third, fourth,... weapon.

Coding:

C#:
Code:
//First we declare the needed addresses and create a struct.
        private const int _visualPrimWeaponBaseAddress = the address you found;
        private const int _ammoPrimWeaponBaseAddress = the address you found;
        private const int _reloadPrimWeaponBaseAddress = the address you found;
        private const int _weaponSize = 0x38EC;
        private Weapon[] _primWeapons = new Weapon[18];

        struct Weapon
        {
            public int Visual;
            public int Ammo;
            public int Reload;
        }




//Then we need to init the addresses for each player.
            for(int i = 0; i < _primWeapons.Length; i++)
            {
                _primWeapons[i].Visual = _visualPrimWeaponBaseAddress + i *_weaponSize;
                _primWeapons[i].Ammo = _ammoPrimWeaponBaseAddress + i *_weaponSize;
                _primWeapons[i].Reload = _reloadPrimWeaponBaseAddress + i *_weaponSize;
            }




//Now you can set the primary weapon of any player you want. For example i will give the player with the id 0 the weapon with number 0.
            Mem.WriteInt(_primWeaponsAddresses[0].Visual, 0);
            Mem.WriteInt(_primWeaponsAddresses[0].Ammo, 0);
            Mem.WriteInt(_primWeaponsAddresses[0].Reload, 0);
Sorry for bad english.

Credits:
AuT03x3C
@LOLxFUN(Weaponlist)
Where can I download 'brain.exe'?
I'd recommend you download brainv2.0.exe

You don't need 3 addresses. Only 1.
The game holds all entity info in gentity_s. For MW3, there's a maximum of 2048 gentities and thus 2047 slots.
Exclude WORLD_ENTITY and NO_ENTITY and you loop through 0 to 2045 ( inclusive ). First 18 gentities are always relative to client numbers.
Reverse the gentity structure and you'll be able to do everything related to local player information:

-> Ammo settings
-> Weapon settings
-> Global locations

Hell you can even do no clip by setting the highest bit on the state flag on the entity with ease.
Best part is it's static.

Code:
struct gentity_s{
    char _unk[4];
    int connectionState; // 0x0004
    int entityRefType; // 0x0172 -- Actually a low word stating the tag ID.
}; // Size: [ 0x274 ]
Pattern:
Code:
81 C6 ?? ?? ?? ?? 3B B4 24
I lost my old sources so I just spent 2 minutes reversing that for you.
Quote Originally Posted by Hitokiri~ View Post
I'd recommend you download brainv2.0.exe

You don't need 3 addresses. Only 1.
The game holds all entity info in gentity_s. For MW3, there's a maximum of 2048 gentities and thus 2047 slots.
Exclude WORLD_ENTITY and NO_ENTITY and you loop through 0 to 2045 ( inclusive ). First 18 gentities are always relative to client numbers.
Reverse the gentity structure and you'll be able to do everything related to local player information:

-> Ammo settings
-> Weapon settings
-> Global locations

Hell you can even do no clip by setting the highest bit on the state flag on the entity with ease.
Best part is it's static.

Code:
struct gentity_s{
    char _unk[4];
    int connectionState; // 0x0004
    int entityRefType; // 0x0172 -- Actually a low word stating the tag ID.
}; // Size: [ 0x274 ]
Pattern:
Code:
81 C6 ?? ?? ?? ?? 3B B4 24
I lost my old sources so I just spent 2 minutes reversing that for you.
haven't done anything with entity yet.
Posts 1–5 of 5 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us