kkthxbye-code / csgo_bugs

Random CSGO stuff
217 stars 271 forks source link

how to edit vtx? #2

Closed theFreeWall closed 4 years ago

theFreeWall commented 4 years ago

"edit checkSum of FileHeader_t for the corrosponding .vtx file " I decompiled the map with "bspsrc"and got the vmf file Then use gcfscape to find the corresponding mdl, vtx, vdd, phy files from the vpk and export them But I have no way to edit the vtx file, is there any tool? The hammer doesn't seem to modify it directly I am a beginner and have been searching for 7 hours with Google but still no answer

kkthxbye-code commented 4 years ago

Use a hex editor, the header definition can be seen here: https://developer.valvesoftware.com/wiki/VTX#Header

We are interested in checksum, so before the checksum we have:

int version;
int vertCacheSize;
unsigned short maxBonesPerStrip;
unsigned short maxBonesPerTri;
int maxBonesPerVert;

int is 4 bytes unsinged short is 2 bytes

So the checksum is at an offset of 16 bytes.

image

theFreeWall commented 4 years ago

thanks!

semisurrr commented 4 years ago

Would you be changing all 4 bytes or just changing 15?

hinnie123 commented 4 years ago

Would you be changing all 4 bytes or just changing 15?

All 4, as a 32-bit int(eger) is 4 bytes. Edit: Although changing 1 of those 4 bytes will also change the value of the int.