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

+6 -1
View File
@@ -3,7 +3,12 @@
#include <cstddef>
namespace compat::profile {
inline constexpr char game_sha256[] = "4415933ce33476f14c837abb61a1b60af8b78cd81783896501913a7aac69e423";
inline constexpr char ue4ss_sha256[] = "e1fb9a7e1d868afef6a091c2012e711c3ec47f05d100ba37f9631a4f75f31df2";
// Verified UE4SS.dll builds. The pinned SDK headers and all 17 imported UE4SS exports are identical in both.
struct Ue4ssBuild { const char* name; const char* sha256; };
inline constexpr Ue4ssBuild ue4ss_builds[] = {
{"v4.0.0", "3843d81a8280096b0de3c750eebf15507e374c250dc551cbf07e7be7acc1e2ba"},
{"v3.0.1-1195-g1ceefac8", "e1fb9a7e1d868afef6a091c2012e711c3ec47f05d100ba37f9631a4f75f31df2"},
};
inline constexpr std::uint32_t image_size = 0x1e0bb000;
inline constexpr std::uint32_t timestamp = 0x6ae7ae3f;
inline constexpr std::uint32_t normalize_rva = 0x62e77f0;
+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);
+1 -1
View File
@@ -10,7 +10,7 @@ class ScriptCompatibility final : public RC::CppUserModBase {
public:
ScriptCompatibility() {
ModName = STR("UE4SS C++ BYPASS");
ModVersion = STR("1.1");
ModVersion = STR("1.2");
ModDescription = STR("Compatibility for existing and additional project scripts");
ModAuthors = STR("Kintaro");
HMODULE module{};