void changeWeaponText(//define our function
char * string,//our string
bool isLooped,//is this for all guns?
char * specificGun//If it isnt, pick a gun to change
)
{
unsigned long cshell = (unsigned long)(GetModuleHandleA("CShell.dll"));//handle to CF
unsigned long weapon = *(unsigned long*)(cshell+0xAB2940);//pointer to weaponclass
int sizeString = strlen(string);//size of our string
if(weapon!=0)//check if the weapon class is not 0
{
if(isLooped==1)//if the function is set to replace the text to all weapons, then continue
{
for(int i=0;i<999;i++)//loop for all guns (i put in a generic number)
{
unsigned long weapons=*(unsigned long*)(weapon+(i*4));//declare our weapons
if(weapons!=0)//check if the weapons are not 0
{
char * weaponName = (char*)(weapons+0x000008);//declare the offset where the string is stored
memcpy(weaponName,string,sizeString);//change the stored string to our string.
}
}
}
if(isLooped==0)//If you want to loop it to only one gun, check for this
{
for(int i=0;i<999;i++)//loop for all guns;999=generic number
{
unsigned long weapons=*(unsigned long*)(weapon+(i*4));//declare our weapons
if(weapons!=0)//check if weapons are not equal to 0
{
char * weaponName = (char*)(weapons+0x000008);//declare the offset where it is stored
if(!(strcmp(weaponName,specificGun)))//check if the gun matches the third parameter of our function (the specific gun you wan't to change)
memcpy(weaponName,string,sizeString);//change the text to our string
}
}
}
}
}
changeWeaponText("123456789",0,"M16");

Nice Job!