Closed DucaRii closed 5 months ago
Looks like a good idea, I'll mark it as an improvement, as soon as someone is available from us we'll try to make it happen, well or if there's a desire you can make a pull request.
yeah im down to pr if i find the time, which of the 2 options i listed do you think would be the better choice i think for readability and for the sake of not having to make too many changes to the codebase the 2nd option i layed out would be better
// MNetworkEnable
// m_hModel (0x200)
// m_ModelName (0x208)
CModelState m_modelState; // 0x160
this is an idea ive had for a while and would, for me at least, increase productivity while reversing
the general idea is that for props that are instances of classes rather than pointers we could directly embed the class implementation into the source and then add the offsets together.
the goal of this would be to make it easier to find out what variable the game is referencing. for example: cs2 frequently accesses CSkeletonInstance::m_modelState.m_hModel with offset 0x200, now if you look up the offset 0x200 in the sdk nothing comes up because m_modelState is embedded and starts at offset 0x160 with m_hModel being at offset 0xa0.
ive whipped up a quick and (very) dirty POC to show what i mean. i didnt want to make too many changes to the code base incase this is not something that should be within the scope of this project.
if this was to be properly implemented, the class dumping could be put into its own function to allow recursively calling it or fields and their offset could be cached in some sort of list?
for my POC i decided to add a 'cacheddump' variable to the class type which is filled up after a class is dumped with that section of the dump
and heres the code that modifies the actual prop dumping, hardcoded for CModelState in a proper solution we definitley shouldnt work with regex, or any string replacing but it worked for the POC with minimal codebase changes
using this, the output changes from:
to: (class metadata removed and indentation fixed for cosmetic purposes)
maybe an alternative solution to embedding the whole class would be to just add a few comments above the prop just like metadata? like so