neverlosecc / source2gen

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

:circus_tent: #21

Closed cpz closed 8 months ago

cpz commented 8 months ago
  1. Add Schema stats at end of dumping SDK
  2. Netvars now have more static metadata described (e.g. MNetworkEncodeFlags, MNetworkEncoder)
  3. Classes now does have static metadata describe
  4. Classes now does have flags describe (e.g. Is polymorphic, is abstract and etc)
  5. Enum class now does have static metadata describe
  6. Enum values now does have static metadata describe
  7. Fully rebuilt SchemaClassInfoData_t
  8. Update SchemaClassFlags_t
  9. Update SchemaEnumeratorInfoData_t
  10. Add SchemaFieldMetadataOverrideData_t with SchemaFieldMetadataOverrideSetData_t
  11. Add some functions to SchemaSystem
  12. It seems that valve is doing its best as always to keep everything good and without bugs, so we need to fix std::uint8_t::max to 8 by default in align_of. GetAligment wrapper added to SchemaClassInfoData_t
  13. Add util with PrettifyNum
  14. Add wrappers std::vector for fields, static fields, static metadata, static metadata overrides for CSchemaClassInfo
  15. Add wrappers for GetPrevClassName, HasVirtualTable, RecursiveHasVirtualTable, IsInherits, IsRecusriveInherits, GetSize to CSchemaClassInfo
  16. CSchemaClassBinding and CSchemaEnumBinding is now aliases
  17. Add ValidateClasses to SchemaSystem and minor refactor
  18. Add CSchemaEnumInfoData which basically class with wrappers
  19. Minor changes in sdk gen (like missing const, using std::vector foreach instead of default for and etc
  20. "No members available" change to "No schema binary for binding" since it how valve describes such classes
  21. Add acknowledgement
  22. Remove unused SchemaString, SchemaArray
  23. Add SchemaClassInfoFunctionIndex to SchemaClassInfoData_t and added wrappers for these functions.
  24. Added CopyInstance, CreateInstance, CreateInstanceWithMemory, DestroyInstance, DestroyInstanceWithMemory, SchemaClassBinding to CSchemaClassBinding

Reverse Engineering Circus arrived with some ready to cook paste :clown:

cpz commented 8 months ago

image image

Some previews of new metadata in enums\classes

cpz commented 8 months ago

Sometimes it gives us 255 in aligment, so I decided to force 4 if its std::uint8_t::max, idc if its wrong

cpz commented 8 months ago

image

todo for future, if there class with pad 0x8 and has flag 'SCHEMA_CF1_HAS_VIRTUAL_MEMBERS' then probably we can make smth like:

// Registered binary: client.dll (project 'client')
// Alignment: 8
// Size: 0x78
// Has VTable
// Has Trivial Destructor
// 
// MNetworkVarNames Vector localSound
// MNetworkVarNames int32 soundscapeIndex
// MNetworkVarNames uint8 localBits
// MNetworkVarNames int soundscapeEntityListIndex
// MNetworkVarNames uint32 soundEventHash
struct audioparams_t
{
public: 
        virtual void Destroy() = 0;

public:
    // MNetworkEnable
    // MNetworkEncoder "coord"
    Vector localSound[8]; // 0x8    
    // MNetworkEnable
    int32_t soundscapeIndex; // 0x68    
    // MNetworkEnable
    uint8_t localBits; // 0x6c  
private:
    [[maybe_unused]] uint8_t __pad006d[0x3]; // 0x6d
public:
    // MNetworkEnable
    int32_t soundscapeEntityListIndex; // 0x70  
    // MNetworkEnable
    uint32_t soundEventHash; // 0x74    
};

or whatever

cpz commented 8 months ago

Added acknowledgement (but basically, praydog reverse was used as reference, idk its should be added to acknowledgement).

Based on this comment

But I think we should do everything proper because of these situations where: roflmuffin/CounterStrikeSharp refers to Source2ZE/CS2Fixes which has parts of our code and nobody mentions this project.