Hi all,

I've been working on a private 'hobby' hack over the past year and wanted to add a skin changer. I managed to do this (mostly). However, the skins are not setting in game.

Here's the code that sets the values, above this we loop over every weapon in our inventory:
Code:
 
while (!canBreak) //force set it
                                    {
                                        
                                        nmc.WriteInt32((IntPtr)Weapon.m_iBase + Addresses.m_iItemIDLow, -1);
                                        nmc.WriteInt32((IntPtr)Weapon.m_iBase + Addresses.m_nFallbackPaintKit, sm.skinID);
                                        nmc.WriteInt32((IntPtr)Weapon.m_iBase + Addresses.m_nFallbackSeed, 661);
                                        nmc.WriteInt32((IntPtr)Weapon.m_iBase + Addresses.m_nFallbackStatTrak, 999999);
                                        nmc.WriteFloat((IntPtr)Weapon.m_iBase + Addresses.m_flFallbackWear, 0.00001f);
                                        nmc.WriteInt32((IntPtr)Weapon.m_iBase + Addresses.m_iAccountID, Weapon.m_iXuIDLow);

                                        Weapon updatedWeapon = new Weapon();
                                        updatedWeapon = Weapon;
                                        updatedWeapon.m_iTexture = nmc.ReadInt32((IntPtr)Weapon.m_iBase + Addresses.m_nFallbackPaintKit);
                                        Debug.WriteLine("NEW " + sm.friendlyName + ": " + updatedWeapon.m_iTexture + " / " + sm.skinID);
                                        if (updatedWeapon.m_iTexture == sm.skinID)
                                        {
                                            canBreak = true;
                                            //THIS GETS CALLED, BUT THEN WHEN I REFRESH UI IT DOESNT SEEM TO WORK
                                        }
                                        it++;
                                    }
And here's the code that runs the actual UI/ skins refresh:

Code:
                        int iClientState = nmc.ReadInt32((IntPtr)bEngine + Addresses.dwClientState);
                        nmc.WriteInt32((IntPtr)iClientState + 0x174, -1);
                        Thread.Sleep(20);
After setting the variable, the canBreak flag gets set to true, and the while loop ends. This means that the weapon texture in memory has been changed. However, when the second code block executes (After all user's weapons have been updated), nothing actually changes in game.

I tried putting the update code (code block 2) inside the if statement (next to the canBreak = true), but that caused the skin to flash on and off and just kept lagging.

Am I missing something silly?

Thanks guys,
A