Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obsidian doesn't work #1

Closed
Snaacky opened this issue Jun 10, 2018 · 6 comments
Closed

Obsidian doesn't work #1

Snaacky opened this issue Jun 10, 2018 · 6 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@Snaacky
Copy link
Owner

Snaacky commented Jun 10, 2018

Update: This information is all pre-Panorama. I'm not sure if the new UI changes any of this information.

Make sure you're on a VAC disabled server before you start reading and writing to memory! This means -insecure +sv_lan 1 in your launch options and only running this code on an offline with bots server.


I've lost most my interest in external CS:GO cheats, leaving behind this unfinished project. Rather than just letting this sit on my PC for an eternity, I decided to let someone else finish it if anyone is up for it.

The code base is "functional" but still not achieving desirable results. What I mean by that is the functions work and do what they're supposed to without error, but are still not changing the skin as expected. The modified skin values are writing to the weapons in memory as expected and the engine update is occurring as expected, however the desired skins aren't rendering. I believe this has something to do with the timing of the memory writes which you can read more about after this little technical breakdown.


Explanation of the functions in the code:

change_skin() contains the bulk of the code. This function grabs the local player (you), iterates over all possible inventory entities (a max of 8 entities), traverses to the possible memory addresses for your inventory entities, checks if the entity exists, if it does, writes the desired skin values, and then forces an update.

force_full_update() forces the CS:GO engine to update. You can tell this is working because the HUD will flicker after you run the function. This function needs to be ran after writing the skin values (or possibly concurrently?) in order to get the desired weapon skin to render.


A bit of background on the skin/weapon variables that change_skin() is writing to:

  • m_iItemIDHigh must be set to -1 in order for the game to use the fallback variables below.
  • m_OriginalOwnerXuidLow must be set to your account ID. The code already grabs this automatically.
  • m_iItemDefinitionIndex is the weapon's ID. Every weapon (AK, AWP, M4, knife, etc.) has their own unique weapon ID. The code already grabs this automatically.
  • m_nFallbackStatTrak is used to set a StatTrak counter on the gun. I haven't gotten to experiment much with this yet so it is currently set to -1 which means no StatTrak counter.
  • m_nFallbackPaintKit is the desired skin or "paint". You can find a link to a list of these in the comment next to the paint variable.
  • m_nFallbackSeed is the seed used to generate certain cosmetic patterns such as Case Hardened's colors and Crimson Web's spider web patterns.
  • m_flFallbackWear is the amount of wear on the weapon in float form. By default, this is set to as pristine condition as possible.

The problem seems to be something to do with the timing of the write and the subsequent engine update. If you write the skin values, they'll persist in memory on the weapon(s) until you force the update. When the update is called, it resets the skin's values back to the default values, as if they were never written to. The problem being that the skins won't render until the update occurs, which when it does, is resetting our write.

I've seen a few different recommended fixes for this:

  • Someone recommended executing force_full_update() on a second thread although that did not seem to work. Neither with threading nor multiprocessing. I also tried starting the thread at different times to try and trigger the proper timing to no avail.
  • Someone else recommended excessively spamming change_skin() and force_full_update() at once which kinda worked when it wasn't freezing or crashing my game. Sometimes it would only update the skin on the gun and not update the skin's name and rarity color on the HUD, sometimes it would only update the skin name and rarity color on the HUD, and sometimes both worked together perfectly fine but I have no idea how I did that.

If you have any more questions, feel free to ask them here. I'll be happy to share any knowledge with anyone interested in getting this working. There is a lot of public information related to CS:GO skin changing on Google. I've already read most of it but maybe you'll find something I missed!

If a long period of time passes and no one has looked at this, I might be open to giving it another shot.

@Snaacky Snaacky added bug Something isn't working help wanted Extra attention is needed labels Jun 10, 2018
@R3D4CTED
Copy link

Interesting. I expected a simple "skinned weapon drop" script, but now I realize that it's more complicated than that.

@Reznnov
Copy link

Reznnov commented Dec 30, 2020

still have this problem. ink how to fix it

@SourLen
Copy link

SourLen commented Dec 31, 2020

Reznov do you know how to fix it?

@Reznnov
Copy link

Reznnov commented Dec 31, 2020 via email

@JIPrettyCool
Copy link

it's 2021, me and my bois still can't fix it

@Snaacky
Copy link
Owner Author

Snaacky commented Mar 28, 2021

Closing this issue and migrating this over to a GitHub Discussions thread which seems more appropriate for this discussion.

#2

@Snaacky Snaacky closed this as completed Mar 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants