add skunyk siphon

This commit is contained in:
Gray
2024-09-11 16:05:10 -04:00
parent 8220cb4813
commit c106b35d18
5 changed files with 107 additions and 34 deletions

View File

@@ -45,6 +45,43 @@ void* UObject::GetProperty(const std::string& ChildName, bool bWarnIfNotFound) c
return nullptr;
}
void* UObject::GetPropertyFunc(const std::string& ChildName, bool bWarnIfNotFound)
{
auto Func = (UFunction*)this;
void* Property = *(void**)(__int64(Func) + 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 = GetNext(Property);
PropName = Property ? GetFNameOfProp(Property)->ToString() : "";
}
}
if (bWarnIfNotFound)
LOG_WARN(LogFinder, "Unable to find3{}", ChildName);
return nullptr;
}
void* UObject::GetProperty(const std::string& ChildName, bool bWarnIfNotFound)
{
for (auto CurrentClass = ClassPrivate; CurrentClass; CurrentClass = *(UClass**)(__int64(CurrentClass) + Offsets::SuperStruct))
@@ -90,7 +127,7 @@ int UObject::GetOffset(const std::string& ChildName, bool bWarnIfNotFound)
if (!Property)
return -1;
return *(int*)(__int64(Property) + Offsets::Offset_Internal);
return *(int*)(__int64(Property) + Offsets::Offset_Internal);
}
int UObject::GetOffset(const std::string& ChildName, bool bWarnIfNotFound) const
@@ -103,6 +140,16 @@ int UObject::GetOffset(const std::string& ChildName, bool bWarnIfNotFound) const
return *(int*)(__int64(Property) + Offsets::Offset_Internal);
}
int UObject::GetOffsetFunc(const std::string& ChildName, bool bWarnIfNotFound)
{
auto Property = GetPropertyFunc(ChildName, bWarnIfNotFound);
if (!Property)
return -1;
return *(int*)(__int64(Property) + Offsets::Offset_Internal);
}
void* UObject::GetInterfaceAddress(UClass* InterfaceClass)
{
static void* (*GetInterfaceAddressOriginal)(UObject* a1, UClass* a2) = decltype(GetInterfaceAddressOriginal)(Addresses::GetInterfaceAddress);