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 9d2ab1e commit 2d35296Copy full SHA for 2d35296
ttyd-tools/rel/include/patch.h
@@ -1,5 +1,7 @@
1
#pragma once
2
3
+#include <ttyd/OSCache.h>
4
+
5
#include <cstdint>
6
7
namespace mod::patch {
@@ -12,8 +14,12 @@ Func hookFunction(Func function, Dest destination)
12
14
uint32_t *instructions = reinterpret_cast<uint32_t *>(function);
13
15
16
uint32_t *trampoline = new uint32_t[2];
17
18
// Original instruction
19
trampoline[0] = instructions[0];
20
+ ttyd::OSCache::DCFlushRange(&trampoline[0], sizeof(uint32_t));
21
+ ttyd::OSCache::ICInvalidateRange(&trampoline[0], sizeof(uint32_t));
22
23
// Branch to original function past hook
24
writeBranch(&trampoline[1], &instructions[1]);
25
0 commit comments