Skip to content

Commit

Permalink
Merge pull request #68 from Hex0ffset/readme-warning
Browse files Browse the repository at this point in the history
Present readme instructions to users who don't change the default offsets
  • Loading branch information
Spuckwaffel authored Apr 8, 2024
2 parents 5c78fce + 2d96693 commit 8de8090
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 5 deletions.
14 changes: 9 additions & 5 deletions UEDumper/Engine/Userdefined/Offsets.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ struct Offset
{
int flag = -1; //flag of the Offset struct
std::string name = ""; //name of the Offset struct
int offset = 0; //if using flag OFFSET_ADDRESS, set the address here (dont write base +..., just write the offset)
uint64_t offset = 0; //if using flag OFFSET_ADDRESS, set the address here (dont write base +..., just write the offset)
//leave the rest empty if not using a sig
const char* sig = ""; //sig bytes in format \xAB\xCD\xEF\x00\x...
std::string mask = ""; //xxxxxxx??xxx??x? where x compares the byte and ? is a wildcard.
Expand Down Expand Up @@ -104,9 +104,9 @@ inline std::vector<Offset> setOffsets()
{
std::vector<Offset> offsets;

offsets.push_back({ OFFSET_ADDRESS | OFFSET_DS, "OFFSET_GNAMES", 0x562D340 });
offsets.push_back({ OFFSET_ADDRESS | OFFSET_DS, "OFFSET_GOBJECTS", 0x545C6E0 });
offsets.push_back({ OFFSET_ADDRESS | OFFSET_DS | OFFSET_LIVE_EDITOR, "OFFSET_GWORLD", 0x581A7E0 });
offsets.push_back({ OFFSET_ADDRESS | OFFSET_DS, "OFFSET_GNAMES", 0xDEADBEEF });
offsets.push_back({ OFFSET_ADDRESS | OFFSET_DS, "OFFSET_GOBJECTS", 0xDEADBEEF });
offsets.push_back({ OFFSET_ADDRESS | OFFSET_DS | OFFSET_LIVE_EDITOR, "OFFSET_GWORLD", 0xDEADBEEF });

//offsets.push_back({ OFFSET_ADDRESS | OFFSET_DH, "OFFSET_GNAMES", 0x562D340 });
//offsets.push_back({ OFFSET_ADDRESS | OFFSET_DH, "OFFSET_GOBJECTS", 0x545C6E0 });
Expand Down Expand Up @@ -138,4 +138,8 @@ inline std::vector<Offset> setOffsets()
//offsets.push_back({ OFFSET_ADDRESS | OFFSET_DS, "OFFSET_GOBJECTS", 122940512 });

return offsets;
}
}

// No need to change this. If you're reading this file and changed your offsets, you're good.
// This is part of a check for those who can't read README.md files =)
#define SHOW_README_IF_OFFSETS_ARE_VALUE 0xDEADBEEF
23 changes: 23 additions & 0 deletions UEDumper/Frontend/Windows/HelloWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include <Settings/EngineSettings.h>
#include <Frontend/Fonts/fontAwesomeHelper.h>
#include <Memory/Memory.h>
#include <Engine/Core/Core.h>
#include <Engine/Userdefined/Offsets.h>


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

bool bUserKnowsWhatTheyAreDoing = true;
for (auto& offset : setOffsets()) {
if (offset.offset == SHOW_README_IF_OFFSETS_ARE_VALUE) {
bUserKnowsWhatTheyAreDoing = false;
break;
}
}

static char processName[100] = { 0 };
static char projectName[50] = { 0 };
static char errorText[100] = { 0 };
Expand Down Expand Up @@ -48,6 +58,19 @@ bool windows::HelloWindow::render()
ImGui::TextColored(IGHelper::Colors::grayedOut, "%22s", EngineSettings::getDumperVersion().c_str());
ImGui::SetCursorPos({ posX, 35 });
ImGui::BeginChild("NewProjectChild", ImVec2(520, 280), false, ImGuiWindowFlags_NoScrollWithMouse);

if (!bUserKnowsWhatTheyAreDoing)
{
ImGui::SetCursorPosY(70);
ImGui::TextColored(IGHelper::Colors::white, "Hi there! Looks like you're new to this.");
ImGui::TextColored(IGHelper::Colors::red, "The tool DOES NOT WORK OUT OF THE BOX!");
ImGui::TextColored(IGHelper::Colors::white, "Please read the included README.md file to proceed.");
ImGui::EndChild();
ImGui::EndChild();
return false;
}


ImGui::PushItemWidth(373);
ImGui::Dummy(ImVec2(0, 20));
ImGui::Text("Enter a project name (at least 5 characters)");
Expand Down

0 comments on commit 8de8090

Please sign in to comment.