Support UE4SS v4.0.0 in bypass 1.2

UE4SS v4.0.0 (commit 30afe5ff) is the first official release since the
1195 build this mod was made for. The two are 36 commits apart, and none of
them touches the C++ mod interface: the pinned SDK headers are byte-identical
at both commits, and all 17 UE4SS functions the mod imports exist in both
DLLs. So one DLL serves both builds.

- build_profile.hpp: the single UE4SS hash becomes a list of verified
  builds, v4.0.0 (3843d81a..., the official release zip) and
  v3.0.1-1195-g1ceefac8 (e1fb9a7e...).
- compatibility.cpp: the startup check accepts a DLL from that list, logs
  "Verified UE4SS <build>", and still refuses any other UE4SS.dll.
- verify_build.py: checks the given UE4SS.dll against the list and records
  which build it is.
- prepare_sdk.py: pinned to v4.0.0; the regenerated headers are unchanged,
  only PROVENANCE.txt names the new commit.
- Version 1.2; README, mod.json and the openmods files name both builds.

Built with warnings as errors; the native hook test passes; verify_build.py
passes against the game's PBZ.exe with either UE4SS.dll and refuses a wrong
one. Not yet tested in game on v4.0.0.
This commit is contained in:
KintaroModding committed 2026-11-13 01:23:21 +01:00
1 parent 434f11d743
commit 78fc79b9d9
10 files changed
+58 -29

No files matched your search

+9 -3
View File
@@ -198,14 +198,20 @@ bool install(const std::filesystem::path& directory) {
attempted = true;
logfile = CreateFileW((directory/L"compatibility.log").c_str(), FILE_APPEND_DATA,
FILE_SHARE_READ|FILE_SHARE_WRITE, nullptr, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr);
log("\r\nUE4SS C++ BYPASS 1.1 experimental: startup\r\n");
log("\r\nUE4SS C++ BYPASS 1.2 experimental: startup\r\n");
try {
auto* image = reinterpret_cast<unsigned char*>(GetModuleHandleW(nullptr));
if (file_hash(module_path(nullptr)) != profile::game_sha256)
throw std::runtime_error("Unsupported PBZ.exe SHA-256; no hooks installed");
auto ue4ss = GetModuleHandleW(L"UE4SS.dll");
if (!ue4ss || file_hash(module_path(ue4ss)) != profile::ue4ss_sha256)
throw std::runtime_error("Requires the verified UE4SS build 1195 DLL");
if (!ue4ss) throw std::runtime_error("UE4SS.dll is not loaded; no hooks installed");
const auto ue4ss_hash = file_hash(module_path(ue4ss));
const char* ue4ss_build = nullptr;
for (const auto& build : profile::ue4ss_builds)
if (ue4ss_hash == build.sha256) ue4ss_build = build.name;
if (!ue4ss_build)
throw std::runtime_error("Requires a verified UE4SS DLL (v4.0.0 or v3.0.1-1195); no hooks installed");
log("Verified UE4SS "); log(ue4ss_build); log("\r\n");
verify_memory(image);
lookup = reinterpret_cast<Lookup>(image+profile::lookup_rva);
normalize = reinterpret_cast<Normalize>(image+profile::normalize_rva);