Skip to content
This repository has been archived by the owner on Jan 22, 2021. It is now read-only.

Commit

Permalink
Merge pull request #38 from CorrM/ProcessEvent
Browse files Browse the repository at this point in the history
- Support `ProcessEvent`.
- Add colors for GObjects input field.
- Add some useful items on `Menu Button`.
- Add `Donate` Popup.
- Some Improves for `GObjects Finder`.
- Add example `JsonEngine` file `DeadByDayLight.json`.
- Some Bugs fixed.
  • Loading branch information
CorrM authored Jun 25, 2019
2 parents a4a4de3 + 82b62cb commit c9e69e5
Show file tree
Hide file tree
Showing 12 changed files with 100 additions and 89 deletions.
Binary file modified DebugSymbols/UnrealFinderTool-x32.pdb
Binary file not shown.
Binary file modified DebugSymbols/UnrealFinderTool-x64.pdb
Binary file not shown.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ Name | Reason
[@harakirinox](https://www.unknowncheats.me/forum/members/1692305.html) | BypassPH (Read/Write Kernal)

## Change Log
##### 25-07-2019 - 3.1.0
- Support `ProcessEvent`.
- Add colors for GObjects input field.
- Add some useful items on `Menu Button`.
- Add `Donate` Popup.
- Some Improves for `GObjects Finder`.
- Add example `JsonEngine` file `DeadByDayLight.json`.
- Some Bugs fixed.

##### 18-07-2019 - Atomic edition
- Improves for `SDK-Generator`:
- Now it's `super super fast` And Generate a `Full Dump`.
Expand Down
16 changes: 2 additions & 14 deletions UnrealFinderTool/Config/EngineCore/DeadByDayLight.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,12 @@
{ "InternalIndex": "int" },
{ "Class": "UClass*" },
{ "Name": "FName" },
{ "pad_01": "*" },
{ "pad_01": "*" },
{ "Outer": "UObject*" }
],
"note": ""
},
{
"name": "UStruct",
"super": "UField",
"vars": [
{ "SuperField": "UStruct*" },
{ "Children": "UField*" },
{ "PropertySize": "int" },
{ "MinAlignment": "int" },
{ "pad_02": "64" }
],
"note": ""
},
{
{
"name": "UProperty",
"super": "UField",
"vars": [
Expand Down
2 changes: 2 additions & 0 deletions UnrealFinderTool/ImControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#define TOOL_VERSION "3.1.0"
#define TOOL_VERSION_TITLE "Atomic edition"

#define IM_COL4(R, G, B, A) ImVec4((float)R / 255.f, (float)G / 255.f, (float)B / 255.f, (float)A / 255.f)

#define ENABLE_DISABLE_WIDGET(uiCode, disabledBool) { static bool disCheck = false; if (disabledBool) { disCheck = true; ui::PushItemFlag(ImGuiItemFlags_Disabled, true); ui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f); } uiCode; if (disCheck && disabledBool) { ImGui::PopItemFlag(); ImGui::PopStyleVar(); disCheck = false; } }
#define ENABLE_DISABLE_WIDGET_IF(uiCode, disabledBool, body) { static bool disCheck = false; if (disabledBool) { disCheck = true; ui::PushItemFlag(ImGuiItemFlags_Disabled, true); ui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);} if(uiCode) body if (disCheck && disabledBool) { ImGui::PopItemFlag(); ImGui::PopStyleVar(); disCheck = false; } }

Expand Down
11 changes: 5 additions & 6 deletions UnrealFinderTool/PatternScan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ PatternScanResult PatternScan::FindPattern(Memory* mem, uintptr_t dwStart, uintp
const size_t allocSize = dwEnd - dwStart >= info.RegionSize ? info.RegionSize : dwEnd - dwStart;

// Bad Memory
if (!(info.State & MEM_COMMIT) || !(info.Type & MEM_PRIVATE) || !(info.Protect & (PAGE_READONLY | PAGE_READWRITE | PAGE_WRITECOPY)))
if (!(info.State & MEM_COMMIT) || info.Protect & (PAGE_NOACCESS | PAGE_WRITECOPY | PAGE_TARGETS_INVALID))
{
// Get next address
currentAddress += allocSize;
Expand Down Expand Up @@ -151,14 +151,13 @@ PatternScanResult PatternScan::FindPattern(Memory* mem, uintptr_t dwStart, uintp
{
for (RegionHolder memRegion : mem_regions)
{
SIZE_T allocCount = (dwEnd - dwStart) > info.RegionSize ? info.RegionSize : dwEnd - dwStart;
const auto pBuf = static_cast<PBYTE>(malloc(allocCount));
const auto pBuf = new BYTE[memRegion.second];

// Read one page or skip if failed
const SIZE_T dwOut = mem->ReadBytes(memRegion.first, pBuf, allocCount);
const SIZE_T dwOut = mem->ReadBytes(memRegion.first, pBuf, memRegion.second);
if (dwOut == 0)
{
free(pBuf);
delete[] pBuf;
continue;
}

Expand Down Expand Up @@ -192,7 +191,7 @@ PatternScanResult PatternScan::FindPattern(Memory* mem, uintptr_t dwStart, uintp
}
}

free(pBuf);
delete[] pBuf;
}
}

Expand Down
2 changes: 1 addition & 1 deletion UnrealFinderTool/SdkGen/Engine/IGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class IGenerator
/// <returns>true if the arrays should get dumped.</returns>
virtual bool ShouldDumpArrays() const
{
return true;
return false;
}

/// <summary>
Expand Down
13 changes: 6 additions & 7 deletions UnrealFinderTool/SdkGen/Engine/Package.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ void Package::GenerateClass(const UEClass& classObj)
std::vector<uintptr_t> vTable;

size_t methodCount = 0;
while (true)
while (methodCount < 500)
{
MEMORY_BASIC_INFORMATION info;
uintptr_t vAddress;
Expand All @@ -508,8 +508,8 @@ void Package::GenerateClass(const UEClass& classObj)
vAddress = Utils::MemoryObj->ReadAddress(vTableAddress + (methodCount * ptrSize));

// Check valid address
auto res = VirtualQueryEx(Utils::MemoryObj->ProcessHandle, LPVOID(vAddress), &info, sizeof info);
if (res == 0 || !(info.Protect & PAGE_EXECUTE_READWRITE) && !(info.Protect & PAGE_EXECUTE_READ))
auto res = VirtualQueryEx(Utils::MemoryObj->ProcessHandle, reinterpret_cast<LPVOID>(vAddress), &info, sizeof info);
if (res == NULL || !(info.Protect & PAGE_EXECUTE_READWRITE) && !(info.Protect & PAGE_EXECUTE_READ))
break;

vTable.push_back(vAddress);
Expand All @@ -520,7 +520,7 @@ void Package::GenerateClass(const UEClass& classObj)
{
for (auto i = 0u; i < methodCount; ++i)
{
if (vTable[i] != 0)
if (vTable[i] != NULL)
{
auto scanResult = PatternScan::FindPattern(Utils::MemoryObj, vTable[i], vTable[i] + 0x200, { std::get<0>(pattern) }, true);
auto toFind = scanResult.find(std::get<0>(pattern).Name);
Expand Down Expand Up @@ -736,9 +736,9 @@ void Package::GenerateMethods(const UEClass& classObj, std::vector<Method>& meth
{
p.CppType = generator->GetOverrideType("bool");
}
switch (p.ParamType)

if (p.ParamType == Type::Default)
{
case Type::Default:
if (prop.GetArrayDim() > 1)
{
p.CppType = p.CppType + "*";
Expand All @@ -747,7 +747,6 @@ void Package::GenerateMethods(const UEClass& classObj, std::vector<Method>& meth
{
p.PassByReference = true;
}
break;
}

p.Name = generator->GetSafeKeywordsName(p.Name);
Expand Down
4 changes: 3 additions & 1 deletion UnrealFinderTool/SdkGen/MainGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ class Generator final : public IGenerator
keywordsName =
{
{"return", "returnValue"},
{"continue", "continueValue"},
{"break", "breakValue"},
{"int", "intValue"}
};

Expand All @@ -37,7 +39,7 @@ class Generator final : public IGenerator
virtualFunctionPattern["Class CoreUObject.Object"] =
{
{
PatternScan::Parse("ProcessEvent", 0, "45 33 F6 4D 8B E0", 0xFF),
PatternScan::Parse("ProcessEvent", 0, "FF FF FF FF FF", 0xFE),
R"( inline void ProcessEvent(class UFunction* function, void* parms)
{
return GetVFunction<void(*)(UObject*, class UFunction*, void*)>(this, %d)(this, function, parms);
Expand Down
19 changes: 12 additions & 7 deletions UnrealFinderTool/SdkGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void SdkGenerator::Dump(const fs::path& path, std::string& state)
std::string str = NamesStore().GetByIndex(i);
if (!str.empty())
tfm::format(o, "[%06i] %s\n", int(i), NamesStore().GetByIndex(i).c_str());
state = "Names Progress [ " + std::to_string(i) + " / " + std::to_string(vecSize) + " ].";
state = "Names [ " + std::to_string(i) + " / " + std::to_string(vecSize) + " ].";
}
}

Expand All @@ -130,7 +130,7 @@ void SdkGenerator::Dump(const fs::path& path, std::string& state)
const UEObject* obj = ObjectsStore().GetByIndex(i);
tfm::format(o, "[%06i] %-100s 0x%" PRIXPTR "\n", obj->GetIndex(), obj->GetFullName(), obj->GetAddress());
}
state = "Objects Progress [ " + std::to_string(i) + " / " + std::to_string(vecSize) + " ].";
state = "Objects [ " + std::to_string(i) + " / " + std::to_string(vecSize) + " ].";
}
}
}
Expand Down Expand Up @@ -202,9 +202,16 @@ void SdkGenerator::ProcessPackages(const fs::path& path, size_t* pPackagesCount,
*/
{
state = "Dumping '" + Utils::Settings.SdkGen.CorePackageName + "'.";
UEObject* obj = packageObjects[0];

auto package = std::make_unique<Package>(obj);
// Get CoreUObject, Some times CoreUObject not the first Package
UEObject* coreUObject;
for (auto& pack : packageObjects)
{
if (pack->GetName() == Utils::Settings.SdkGen.CorePackageName)
coreUObject = pack;
}

auto package = std::make_unique<Package>(coreUObject);
std::mutex tmp_lock;
package->Process(processedObjects, tmp_lock);
if (package->Save(sdkPath))
Expand All @@ -215,16 +222,14 @@ void SdkGenerator::ProcessPackages(const fs::path& path, size_t* pPackagesCount,
"E: " + std::to_string(package->Enums.size()) + " ]"
);

Package::PackageMap[*obj] = package.get();
Package::PackageMap[*coreUObject] = package.get();
packages.emplace_back(std::move(package));
}

// Set Sleep Every
Utils::Settings.Parallel.SleepEvery = 30;
}

Sleep(100);

++*pPackagesDone;
state = "Dumping with " + std::to_string(threadCount) + " Threads.";

Expand Down
Loading

0 comments on commit c9e69e5

Please sign in to comment.