Skip to content

Commit

Permalink
update to latest release
Browse files Browse the repository at this point in the history
  • Loading branch information
Spuckwaffel committed Apr 25, 2024
2 parents 121577a + ac86074 commit ef5135e
Show file tree
Hide file tree
Showing 11 changed files with 92 additions and 48 deletions.
2 changes: 1 addition & 1 deletion UEDumper/Engine/Generation/SDK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "Settings/EngineSettings.h"
#include "BasicType.h"
#include "packageSorter.h"
#include "FeatureFlags.h"
#include "Engine/Userdefined/FeatureFlags.h"

#include <algorithm>

Expand Down
22 changes: 22 additions & 0 deletions UEDumper/Engine/Userdefined/FeatureFlags.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#pragma once

#include "UEdefinitions.h"

namespace FeatureFlags {
namespace SDK {
// bitmask
static constexpr int FUNCTION_BODIES = 1 << 0;
static constexpr int FORWARD_DECLARATIONS = 1 << 1;
static constexpr int ADD_INCLUDES = 1 << 2;
static constexpr int STRUCTS_BEFORE_CLASSES = 1 << 3;
static constexpr int STATIC_ASSERTS_OBJECT_SIZE = 1 << 4;
static constexpr int STATIC_ASSERTS_MEMBERS = 1 << 5;

#if WRITE_STATIC_ASSERT_TESTS
static constexpr int STABLE = STATIC_ASSERTS_OBJECT_SIZE | STATIC_ASSERTS_MEMBERS;
#else
static constexpr int STABLE = 0;
#endif
static constexpr int EXPERIMENTAL_INTERNAL = STABLE | FUNCTION_BODIES | FORWARD_DECLARATIONS | ADD_INCLUDES | STRUCTS_BEFORE_CLASSES;
}
}
11 changes: 9 additions & 2 deletions UEDumper/Engine/Userdefined/UEdefinitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@
#define RELEASE_1_8_FINAL 15
#define RELEASE_1_9_BETA 16
#define RELEASE_1_9_FINAL 17
#define RELEASE_1_10_BETA 18
#define RELEASE_1_10_FINAL 19

#define DUMPER_VERSION RELEASE_1_9_BETA
#define DUMPER_VERSION RELEASE_1_10_BETA


/// This file contains engine definitions that you have to edit depending on the game!
Expand All @@ -43,6 +45,7 @@


//supported unreal engine versions, dont edit
#define UE_NOT_SET 99
#define UE_4_19 0
#define UE_4_20 1
#define UE_4_21 2
Expand All @@ -61,7 +64,11 @@
/* UE version settings */

//set your games ue version
#define UE_VERSION UE_5_01
#define UE_VERSION UE_NOT_SET


/* SDK generation */
#define WRITE_STATIC_ASSERT_TESTS TRUE


/* FName settings */
Expand Down
16 changes: 0 additions & 16 deletions UEDumper/FeatureFlags.h

This file was deleted.

24 changes: 20 additions & 4 deletions UEDumper/Frontend/Windows/HelloWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <Memory/Memory.h>
#include <Engine/Core/Core.h>
#include <Engine/Userdefined/Offsets.h>
#include "Frontend/Windows/LogWindow.h"


windows::HelloWindow::HelloWindow()
Expand All @@ -17,14 +18,28 @@ bool windows::HelloWindow::render()
{
if (alreadyCompleted) return true;

bool bUserKnowsWhatTheyAreDoing = true;
for (const auto& offset : setOffsets()) {
if (offset.offset == SHOW_README_IF_OFFSETS_ARE_VALUE) {
static bool bUserKnowsWhatTheyAreDoing = true;
static bool checkOffsets = true;
if(checkOffsets)
{
for (const auto& offset : setOffsets()) {
if (offset.offset == SHOW_README_IF_OFFSETS_ARE_VALUE) {
LogWindow::Log(LogWindow::logLevels::LOGLEVEL_ERROR, "OFFSETS",
"ERROR: Offsets were not changed. Please read the README and specify the correct offsets.");
bUserKnowsWhatTheyAreDoing = false;
break;
}
}
if(EngineSettings::_UE_VERSION == UE_NOT_SET )
{
bUserKnowsWhatTheyAreDoing = false;
break;
LogWindow::Log(LogWindow::logLevels::LOGLEVEL_ERROR, "UE VERSION",
"ERROR: UE Version not set. Please read the README and specify the correct offsets.");
}
checkOffsets = false;
}


static char processName[100] = { 0 };
static char projectName[50] = { 0 };
static char errorText[100] = { 0 };
Expand Down Expand Up @@ -55,6 +70,7 @@ bool windows::HelloWindow::render()
ImGui::SameLine();
float posX = ImGui::GetCursorPosX();
ImGui::Dummy({ 0,0 });
ImGui::SetCursorPos(ImVec2(ImGui::GetCursorPosX() + 10, ImGui::GetCursorPosY() - 10));
ImGui::TextColored(IGHelper::Colors::grayedOut, "%22s", EngineSettings::getDumperVersion().c_str());
ImGui::SetCursorPos({ posX, 35 });
ImGui::BeginChild("NewProjectChild", ImVec2(520, 280), false, ImGuiWindowFlags_NoScrollWithMouse);
Expand Down
55 changes: 32 additions & 23 deletions UEDumper/Frontend/Windows/LiveEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1409,7 +1409,7 @@ void windows::LiveEditor::renderSearchBox()
if (!bRenderSearchBox) return;

static ImVec2 smallWindow = ImVec2(860, 730);
static ImVec2 closeButtonPos = ImVec2(smallWindow.x, 0);
static ImVec2 closeButtonPos = ImVec2(10, 10);
const ImVec2 bigWindow = IGHelper::getWindowSize();

ImGui::SetCursorPos(ImVec2(bigWindow.x / 2 - smallWindow.x / 2, (bigWindow.y / 2 - smallWindow.y / 2) - 100));
Expand Down Expand Up @@ -1543,18 +1543,20 @@ void windows::LiveEditor::renderSearchBox()
}

ImGui::PopStyleVar();


ImGui::EndChild();

if (ImGui::Button("Close", closeButtonPos))
ImGui::SetCursorPosX(smallWindow.x / 2 - 25);
if (ImGui::Button("Close", ImVec2(50, 30)))
bRenderSearchBox = false;

ImGui::EndChild();
}

void windows::LiveEditor::renderSearchResults()
{
ImGui::BeginChild("LiveViewerChildSearch", ImVec2(ImGui::GetWindowSize().x - 15, ImGui::GetWindowSize().y + 20), true);
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, { 0,0 });


auto searchTextString = convertToLowercase(std::string(searchText));
performSearch(searchTextString);
Expand All @@ -1563,7 +1565,7 @@ void windows::LiveEditor::renderSearchResults()
bFindingPaths = true;
std::make_unique<std::future<void>*>(new auto(std::async(std::launch::async, [] {
auto& searchResult = searchResults[searchResultPicked];
auto& root = tabs[tabPicked].struc;
const auto& root = tabs[tabPicked].struc;

discoveredPaths = StrucGraph::getInstance()->findAllPaths(root, NodeAndMember(searchResult, searchResultMember));
if (searchResultMember == "")
Expand All @@ -1580,7 +1582,7 @@ void windows::LiveEditor::renderSearchResults()
})));
};

if (ImGui::BeginListBox("##liveInspectorSearchResults", ImVec2(ImGui::GetWindowSize().x - 15, ImGui::GetWindowSize().y - 50)))
if (ImGui::BeginListBox("##liveInspectorSearchResults", ImVec2(ImGui::GetWindowSize().x - 15, ImGui::GetWindowSize().y - 15)))
{
for (int i = 0; i < searchResults.size(); i++)
{
Expand Down Expand Up @@ -1630,26 +1632,23 @@ void windows::LiveEditor::renderSearchResults()
}
ImGui::EndListBox();
}

ImGui::PopStyleVar();
ImGui::EndChild();
}

void windows::LiveEditor::performSearch()
{
performSearch(convertToLowercase(searchText));
}

void windows::LiveEditor::performSearch(const std::string searchString)
void windows::LiveEditor::performSearch(const std::string& searchString)
{
auto lowercasedSearchString = convertToLowercase(searchString);
const auto lowercasedSearchString = convertToLowercase(searchString);

if (lowercasedSearchString == previousSearchText) return;
previousSearchText = lowercasedSearchString;

bDisplayPaths = false;

auto strucGraph = StrucGraph::getInstance();
const auto strucGraph = StrucGraph::getInstance();

searchResults.clear();
if (lowercasedSearchString == "")
Expand Down Expand Up @@ -1725,11 +1724,16 @@ void windows::LiveEditor::populateStrucGraph(EngineStructs::Struct* struc, Engin
#endif
}

if (node->supers.size() > 0)
{
queue.push_back(std::tuple(node->supers[0], node, std::to_string(reinterpret_cast<uint64_t>(&node->supers[0]))));
}

for (auto& member : node->definedMembers)
{
if (member.type.clickable)
{
auto address = node->memoryAddress + member.offset;
const auto address = node->memoryAddress + member.offset;

switch (member.type.propertyType)
{
Expand All @@ -1739,7 +1743,7 @@ void windows::LiveEditor::populateStrucGraph(EngineStructs::Struct* struc, Engin
EngineStructs::Struct* childStruc;
if (isValidStructName(address, member.type.name, childStruc))
{
queue.push_back(std::tuple<EngineStructs::Struct*, EngineStructs::Struct*, std::string>(childStruc, node, member.name));
queue.push_back(std::tuple(childStruc, node, member.name));
}
break;
case PropertyType::ArrayProperty:
Expand All @@ -1748,24 +1752,29 @@ void windows::LiveEditor::populateStrucGraph(EngineStructs::Struct* struc, Engin
case PropertyType::ObjectProperty:
case PropertyType::ClassProperty:
case PropertyType::StructProperty:
const auto block = LiveMemory::getMemoryBlock(node->memoryAddress);
if (!block) break; // invalid memory block?
if (member.type.subTypes.size() != 1) break; // broken TArray
{
const auto block = LiveMemory::getMemoryBlock(node->memoryAddress);
if (!block) break; // invalid memory block?
if (member.type.subTypes.size() != 1) break; // broken TArray

const auto arr = block->read<TArray<uint64_t>>(address);
EngineStructs::Struct* childStruc;
const auto arr = block->read<TArray<uint64_t>>(address);
EngineStructs::Struct* childStruc;

if (isValidStructName(reinterpret_cast<uint64_t>(arr.Data), member.type.subTypes[0].name, childStruc))
{
queue.push_back(std::tuple<EngineStructs::Struct*, EngineStructs::Struct*, std::string>(childStruc, node, member.name));
if (isValidStructName(reinterpret_cast<uint64_t>(arr.Data), member.type.subTypes[0].name, childStruc))
{
queue.push_back(std::tuple(childStruc, node, member.name));
}
break;
}
break;
default: ;
}
break;
default: ;
}
continue;
}
}

}
}

Expand Down
2 changes: 1 addition & 1 deletion UEDumper/Frontend/Windows/LiveEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ namespace windows
static void renderSearchResults();

static void performSearch();
static void performSearch(const std::string searchString);
static void performSearch(const std::string& searchString);


public:
Expand Down
2 changes: 1 addition & 1 deletion UEDumper/Frontend/Windows/PackageWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "Engine/Generation/MDK.h"
#include "Engine/Generation/SDK.h"
#include "Frontend/Fonts/fontAwesomeHelper.h"
#include "FeatureFlags.h"
#include "Engine/Userdefined/FeatureFlags.h"

void windows::PackageWindow::renderUndefinedStructs()
{
Expand Down
2 changes: 2 additions & 0 deletions UEDumper/Settings/EngineSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ class EngineSettings
"Version 1.8 Release",
"Version 1.9 BETA",
"Version 1.9 Release",
"Version 1.10 BETA",
"Version 1.10 Release",
};

private:
Expand Down
1 change: 1 addition & 0 deletions UEDumper/UEDumper.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@
<ClInclude Include="Engine\structs.h" />
<ClInclude Include="Engine\UEClasses\UnrealClasses.h" />
<ClInclude Include="Engine\Userdefined\Datatypes.h" />
<ClInclude Include="Engine\Userdefined\FeatureFlags.h" />
<ClInclude Include="Engine\Userdefined\Offsets.h" />
<ClInclude Include="Engine\Userdefined\StructDefinitions.h" />
<ClInclude Include="Engine\Userdefined\UEdefinitions.h" />
Expand Down
3 changes: 3 additions & 0 deletions UEDumper/UEDumper.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,9 @@
<ClInclude Include="Resources\DMA\vmmdll.h">
<Filter>Resources\DMA</Filter>
</ClInclude>
<ClInclude Include="Engine\Userdefined\FeatureFlags.h">
<Filter>Engine\User Defined</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="UEDumper.rc">
Expand Down

0 comments on commit ef5135e

Please sign in to comment.