Skip to content

Commit

Permalink
who wouldve guessed, ue doing ue things... SDK generation issue fixed…
Browse files Browse the repository at this point in the history
… for 5.3 and above
  • Loading branch information
Spuckwaffel committed Aug 1, 2024
1 parent 8cbc1e5 commit 9de0ab8
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 8 deletions.
14 changes: 14 additions & 0 deletions UEDumper/Engine/Generation/BasicType.h
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,8 @@ class TWeakObjectPtr : public FWeakObjectPtr
definedStructs.push_back(dStruct);

dStruct.name = "TPersistentObjectPtr";

#if UE_VERSION < UE_5_03
dStruct.definition =
R"(
template<typename TObjectID>
Expand All @@ -329,6 +331,18 @@ class TPersistentObjectPtr
TObjectID ObjectID;
};
)";
#else
dStruct.definition =
R"(
template<typename TObjectID>
class TPersistentObjectPtr
{
public:
FWeakObjectPtr WeakPtr;
TObjectID ObjectID;
};
)";
#endif

definedStructs.push_back(dStruct);

Expand Down
6 changes: 3 additions & 3 deletions UEDumper/Engine/Generation/SDK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -629,10 +629,10 @@ void SDKGeneration::Generate(int& progressDone, int& totalProgress, int featureF


std::unordered_map<std::string, std::string> originalPackageToMerged;
for (auto& pack : newPackages)
for (auto& pack : sortedPackages)
{
for (auto& mergedPack : pack.mergedPackages) {
originalPackageToMerged.insert(std::pair<std::string, std::string>(mergedPack->packageName, pack.package.packageName));
for (auto& mergedPack : pack->mergedPackages) {
originalPackageToMerged.insert(std::pair<std::string, std::string>(mergedPack->packageName, pack->package.packageName));
}
}

Expand Down
2 changes: 1 addition & 1 deletion UEDumper/Engine/Generation/packageSorter.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ inline std::vector<MergedPackage*> sortPackages(int& progressDone, int& totalPro
if(isSubset(pack.mergedPackages, cmpPack.mergedPackages))
{
//blacklist the smaller package / the one which is the subset
blacklistedPkgs.insert(pack.mergedPackages.size() <= cmpPack.mergedPackages.size() ? pack.mergedPackages.size() : cmpPack.package.index);
blacklistedPkgs.insert(pack.mergedPackages.size() <= cmpPack.mergedPackages.size() ? pack.package.index : cmpPack.package.index);
break;
}
}
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 @@ -107,9 +107,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_ADDRESS | OFFSET_DS, "OFFSET_GNAMES", 0x6C42D80 });
offsets.push_back({ OFFSET_ADDRESS | OFFSET_DS, "OFFSET_GOBJECTS", 0x6CE91B0 });
offsets.push_back({ OFFSET_ADDRESS | OFFSET_DS | OFFSET_LIVE_EDITOR, "OFFSET_GWORLD", 0x6E55EB8 });

return offsets;
}
Expand Down
4 changes: 4 additions & 0 deletions UEDumper/Engine/Userdefined/StructDefinitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,12 @@ inline void addStructs()
TpersistentObjectPtr.noFixedSize = true;
TpersistentObjectPtr.definedMembers = std::vector<EngineStructs::Member>{
{{true, PropertyType::ObjectProperty, "FWeakObjectPtr"}, "WeakPtr", 0, 8},
#if UE_VERSION < UE_5_03
{{false, PropertyType::IntProperty, TYPE_I32}, "TagAtLastTest", 8, 4},
{{false, PropertyType::ObjectProperty, "TObjectID"}, "ObjectID", 12, 4},
#else
{{false, PropertyType::ObjectProperty, "TObjectID"}, "ObjectID", 8, 4},
#endif
};
//add it
EngineCore::createStruct(TpersistentObjectPtr);
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_5_03


/* SDK and MDK generation */
Expand Down

0 comments on commit 9de0ab8

Please sign in to comment.