-
Notifications
You must be signed in to change notification settings - Fork 368
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add IntegrityCheckBypass (fixes interaction/cutscenes breaking in ful…
…l version of RE3)
- Loading branch information
Showing
4 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#include "utility/Scan.hpp" | ||
|
||
#include "IntegrityCheckBypass.hpp" | ||
|
||
struct IntegrityCheckPattern { | ||
std::string pat{}; | ||
uint32_t offset{}; | ||
}; | ||
|
||
std::optional<std::string> IntegrityCheckBypass::on_initialize() { | ||
// Patterns for assigning or accessing of the integrity check boolean | ||
std::vector<IntegrityCheckPattern> possible_patterns{ | ||
/* | ||
cmp qword ptr [rax+18h], 0 | ||
cmovz ecx, r15d | ||
mov cs:bypass_integrity_checks, cl*/ | ||
// Referenced above "steam_api64.dll" | ||
{"48 ? ? 18 00 41 ? ? ? 88 0D ? ? ? ?", 11}, | ||
{"48 ? ? 18 00 0F ? ? 88 0D ? ? ? ? 49 ? ? ? 48", 10}, | ||
}; | ||
|
||
for (auto& possible_pattern : possible_patterns) { | ||
auto integrity_check_ref = utility::scan(g_framework->get_module().as<HMODULE>(), possible_pattern.pat); | ||
|
||
if (!integrity_check_ref) { | ||
continue; | ||
} | ||
|
||
m_bypass_integrity_checks = (bool*)utility::calculate_absolute(*integrity_check_ref + possible_pattern.offset); | ||
} | ||
|
||
// These may be removed, so don't fail altogether | ||
/*if (m_bypass_integrity_checks == nullptr) { | ||
return "Failed to find IntegrityCheckBypass pattern"; | ||
}*/ | ||
|
||
spdlog::info("[{:s}]: bypass_integrity_checks: {:x}", get_name().data(), (uintptr_t)m_bypass_integrity_checks); | ||
|
||
return Mod::on_initialize(); | ||
} | ||
|
||
void IntegrityCheckBypass::on_frame() { | ||
if (m_bypass_integrity_checks != nullptr) { | ||
*m_bypass_integrity_checks = true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#pragma once | ||
|
||
#include "Mod.hpp" | ||
|
||
// Always on for RE3 | ||
// Because we use hooks that modify the integrity of the executable | ||
// And RE3 has unfortunately decided to implement an integrity check on the executable code of the process | ||
class IntegrityCheckBypass : public Mod { | ||
public: | ||
std::string_view get_name() const override { return "IntegrityCheckBypass"; }; | ||
std::optional<std::string> on_initialize() override; | ||
|
||
void on_frame() override; | ||
|
||
private: | ||
// This is what the game uses to bypass its integrity checks altogether or something | ||
bool* m_bypass_integrity_checks{ nullptr }; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters