neverlosecc / source2gen

Source2 games SDK generator
http://s2gen.com
Apache License 2.0
193 stars 31 forks source link

Fix output metadata string for MResourceTypeForInfoType #25

Open cpz opened 7 months ago

cpz commented 7 months ago

E.g: https://github.com/neverlosecc/source2sdk/blob/dota/sdk/resourcesystem.hpp#L605 Related code: https://github.com/neverlosecc/source2gen/blob/main/src/sdk/sdk.cpp#L115

es3n1n commented 5 months ago

The main reason we are getting these "random" bytes is that the size of this value isn't always a 32/16-byte value. Instead, it could be only 8 bytes in length and its value could be fit without the null terminator. image

And now the question I don't have the answer to(for now): Where should we get the reserved size instead? Probably the reversals of how this stuff gets allocated in heap could help us with answering this question.

es3n1n commented 5 months ago

Reopening because this issue isn't fully resolved and we still have a bunch of inconsistent strings.