Skip to content

Commit

Permalink
Added a fix in the generation that checks if subtypes are clickable o…
Browse files Browse the repository at this point in the history
…therwise gibberish gets added to dependencypackages
  • Loading branch information
Spuckwaffel committed Jul 20, 2024
1 parent f62d458 commit d76c9fe
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 19 deletions.
28 changes: 15 additions & 13 deletions UEDumper/Engine/Core/Core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1264,6 +1264,9 @@ void EngineCore::finishPackages()
{
auto& package = packages[i];

if (package.packageName == "AnimatedTexture")
DebugBreak();

for (const auto& struc : package.combinedStructsAndClasses)
{
for (const auto& var : struc->definedMembers)
Expand All @@ -1277,7 +1280,7 @@ void EngineCore::finishPackages()
for (auto& name : struc->superNames)
{
const auto info = getInfoOfObject(name);
if (!info || !info->valid)
if (!info || !info->valid || (info->type != ObjectInfo::OI_Class && info->type != ObjectInfo::OI_Struct))
continue;
//get the super struct
auto superStruc = static_cast<EngineStructs::Struct*>(info->target);
Expand Down Expand Up @@ -1336,6 +1339,8 @@ void EngineCore::finishPackages()

for (auto& subtype : var.type.subTypes)
{
if (!subtype.clickable)
continue;
const auto subInfo = getInfoOfObject(subtype.name);
if (!subInfo || !subInfo->valid)
continue;
Expand All @@ -1344,18 +1349,16 @@ void EngineCore::finishPackages()

if (subtype.propertyType != PropertyType::ObjectProperty && subtype.propertyType != PropertyType::ClassProperty)
{
//casting is fine even if its a enum as owningpackage is the first package
const auto targetStruc = static_cast<EngineStructs::Struct*>(subInfo->target);
if (targetStruc->owningPackage->index != package.index)
package.dependencyPackages.insert(targetStruc->owningPackage);
const auto targetPack = subInfo->type == ObjectInfo::OI_Enum ? static_cast<EngineStructs::Enum*>(subInfo->target)->owningPackage : static_cast<EngineStructs::Struct*>(subInfo->target)->owningPackage;
if (targetPack->index != package.index)
package.dependencyPackages.insert(targetPack);
}
}

const auto targetPack = info->type == ObjectInfo::OI_Enum ? static_cast<EngineStructs::Enum*>(info->target)->owningPackage : static_cast<EngineStructs::Struct*>(info->target)->owningPackage;
if (targetPack->index != package.index)
package.dependencyPackages.insert(targetPack);

//casting is fine even if its a enum as owningpackage is the first package
const auto targetStruc = static_cast<EngineStructs::Struct*>(info->target);
if (targetStruc->owningPackage->index != package.index)
package.dependencyPackages.insert(targetStruc->owningPackage);
}
}

Expand All @@ -1371,10 +1374,9 @@ void EngineCore::finishPackages()
{
type.info = info;

//casting is fine even if its a enum as owningpackage is the first package
const auto targetStruc = static_cast<EngineStructs::Struct*>(info->target);
if (targetStruc->owningPackage->index != package.index)
package.dependencyPackages.insert(targetStruc->owningPackage);
const auto targetPack = info->type == ObjectInfo::OI_Enum ? static_cast<EngineStructs::Enum*>(info->target)->owningPackage : static_cast<EngineStructs::Struct*>(info->target)->owningPackage;
if (targetPack->index != package.index)
package.dependencyPackages.insert(targetPack);
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion UEDumper/Engine/Generation/MDK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ void MDKGeneration::generatePackage(std::ofstream& stream, const EngineStructs::

}

const static std::unordered_set<std::string> reservedNames{ "float", "int", "bool", "double", "long", "char", "TRUE", "FALSE" };
const static std::unordered_set<std::string> reservedNames{ "float", "int", "bool", "double", "long", "char", "TRUE", "FALSE", "try" };

if (std::isdigit(result[0])) result = "_" + result;
if (reservedNames.contains(result)) result += "0";
Expand Down
2 changes: 1 addition & 1 deletion UEDumper/Engine/Generation/SDK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ void SDKGeneration::generatePackage(

}

const static std::unordered_set<std::string> reservedNames{ "float", "int", "bool", "double", "long", "char", "TRUE", "FALSE" };
const static std::unordered_set<std::string> reservedNames{ "float", "int", "bool", "double", "long", "char", "TRUE", "FALSE", "try" };

if (std::isdigit(result[0])) result = "_" + result;
if (reservedNames.contains(result)) result += "0";
Expand Down
2 changes: 2 additions & 0 deletions UEDumper/Engine/UEClasses/UnrealClasses.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ class UField : public UObject {
public:
using UObject::UObject;

int pad;

/** Next Field in the linked list */
UField* Next;

Expand Down
6 changes: 3 additions & 3 deletions UEDumper/Engine/Userdefined/Offsets.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ inline std::vector<Offset> setOffsets()
{
std::vector<Offset> offsets;

offsets.push_back({ OFFSET_ADDRESS | OFFSET_DS, "OFFSET_GNAMES", 0x69E81E8 });
offsets.push_back({ OFFSET_ADDRESS | OFFSET_DS, "OFFSET_GOBJECTS", 0x69ECDB0 });
offsets.push_back({ OFFSET_ADDRESS | OFFSET_DS | OFFSET_LIVE_EDITOR, "OFFSET_GWORLD", 0x6B1D668 });
offsets.push_back({ OFFSET_SIGNATURE_FOLLOW | OFFSET_DS, "OFFSET_GNAMES", 0, "\x48\x8D\x0D\x00\x00\x00\x00\xE8\x00\x00\x00\x00\xC6\x05\x00\x00\x00\x00\x00\x0F\x10\x03", "xxx????x????xx?????xxx" });
offsets.push_back({ OFFSET_SIGNATURE_FOLLOW | OFFSET_DS, "OFFSET_GOBJECTS", 0,"\x48\x8B\x05\x00\x00\x00\x00\x48\x8B\x0C\xC8\x48\x8D\x1C\xD1\xEB\x03\x49\x8B\xDD", "xxx????xxxxxxxxxxxxx" });
offsets.push_back({ OFFSET_SIGNATURE_FOLLOW | OFFSET_DS | OFFSET_LIVE_EDITOR, "OFFSET_GWORLD", 0, "\x48\x8B\x1D\x00\x00\x00\x00\x48\x85\xDB\x74\x3B\x41", "xxx????xxxxxx" });

//offsets.push_back({ OFFSET_ADDRESS | OFFSET_DH, "OFFSET_GNAMES", 0x562D340 });
//offsets.push_back({ OFFSET_ADDRESS | OFFSET_DH, "OFFSET_GOBJECTS", 0x545C6E0 });
Expand Down
2 changes: 1 addition & 1 deletion UEDumper/Engine/Userdefined/UEdefinitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
/* UE version settings */

//set your games ue version
#define UE_VERSION UE_4_20
#define UE_VERSION UE_4_27


/* SDK and MDK generation */
Expand Down

0 comments on commit d76c9fe

Please sign in to comment.