mirror of
https://github.com/Milxnor/Project-Reboot-3.0.git
synced 2026-01-13 02:42:22 +01:00
it kinda work
This commit is contained in:
@@ -18,6 +18,44 @@ FName* getFNameOfProp(void* Property)
|
||||
return NamePrivate;
|
||||
};
|
||||
|
||||
void* UObject::GetProperty(const std::string& ChildName, bool bWarnIfNotFound) const
|
||||
{
|
||||
for (auto CurrentClass = ClassPrivate; CurrentClass; CurrentClass = *(UClass**)(__int64(CurrentClass) + Offsets::SuperStruct))
|
||||
{
|
||||
void* Property = *(void**)(__int64(CurrentClass) + Offsets::Children);
|
||||
|
||||
if (Property)
|
||||
{
|
||||
// LOG_INFO(LogDev, "Reading prop name..");
|
||||
|
||||
std::string PropName = getFNameOfProp(Property)->ToString();
|
||||
|
||||
// LOG_INFO(LogDev, "PropName: {}", PropName);
|
||||
|
||||
if (PropName == ChildName)
|
||||
{
|
||||
return Property;
|
||||
}
|
||||
|
||||
while (Property)
|
||||
{
|
||||
if (PropName == ChildName)
|
||||
{
|
||||
return Property;
|
||||
}
|
||||
|
||||
Property = Engine_Version >= 425 ? *(void**)(__int64(Property) + 0x20) : ((UField*)Property)->Next;
|
||||
PropName = Property ? getFNameOfProp(Property)->ToString() : "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (bWarnIfNotFound)
|
||||
LOG_WARN(LogFinder, "Unable to find0{}", ChildName);
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void* UObject::GetProperty(const std::string& ChildName, bool bWarnIfNotFound)
|
||||
{
|
||||
for (auto CurrentClass = ClassPrivate; CurrentClass; CurrentClass = *(UClass**)(__int64(CurrentClass) + Offsets::SuperStruct))
|
||||
@@ -66,6 +104,16 @@ int UObject::GetOffset(const std::string& ChildName, bool bWarnIfNotFound)
|
||||
return *(int*)(__int64(Property) + Offsets::Offset_Internal);
|
||||
}
|
||||
|
||||
int UObject::GetOffset(const std::string& ChildName, bool bWarnIfNotFound) const
|
||||
{
|
||||
auto Property = GetProperty(ChildName, bWarnIfNotFound);
|
||||
|
||||
if (!Property)
|
||||
return -1;
|
||||
|
||||
return *(int*)(__int64(Property) + Offsets::Offset_Internal);
|
||||
}
|
||||
|
||||
bool UObject::ReadBitfieldValue(int Offset, uint8_t FieldMask)
|
||||
{
|
||||
return ReadBitfield(this->GetPtr<PlaceholderBitfield>(Offset), FieldMask);
|
||||
|
||||
Reference in New Issue
Block a user