We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fb766fe commit f92e5b6Copy full SHA for f92e5b6
loader/src/loader/PatchImpl.cpp
@@ -46,6 +46,10 @@ std::vector<Patch::Impl*>& Patch::Impl::allEnabled() {
46
}
47
48
Result<> Patch::Impl::enable() {
49
+ if (m_enabled) {
50
+ return Ok();
51
+ }
52
+
53
auto const thisMin = this->getAddress();
54
auto const thisMax = this->getAddress() + this->m_patch.size() - 1;
55
// TODO: this feels slow. can be faster
@@ -68,6 +72,10 @@ Result<> Patch::Impl::enable() {
68
72
69
73
70
74
Result<> Patch::Impl::disable() {
75
+ if (!m_enabled) {
76
77
78
71
79
auto res = tulip::hook::writeMemory(m_address, m_original.data(), m_original.size());
80
if (!res) return Err("Failed to disable patch: {}", res.unwrapErr());
81
0 commit comments