File tree Expand file tree Collapse file tree 3 files changed +18
-4
lines changed Expand file tree Collapse file tree 3 files changed +18
-4
lines changed Original file line number Diff line number Diff line change 7
7
namespace mod ::patch {
8
8
9
9
void writeBranch (void *ptr, void *destination);
10
+ void writeBranchLR (void *ptr, void *destination);
11
+ void writeBranchMain (void *ptr, void *destination, uint32_t branch);
10
12
11
13
template <typename Func, typename Dest>
12
14
Func hookFunction (Func function, Dest destination)
Original file line number Diff line number Diff line change 6
6
7
7
namespace mod {
8
8
9
- const char *VersionNumber = " v3.0.27 " ;
9
+ const char *VersionNumber = " v3.0.28 " ;
10
10
11
11
const char *RootLines[] =
12
12
{
Original file line number Diff line number Diff line change 6
6
namespace mod ::patch {
7
7
8
8
void writeBranch (void *ptr, void *destination)
9
+ {
10
+ uint32_t branch = 0x48000000 ; // b
11
+ writeBranchMain (ptr, destination, branch);
12
+ }
13
+
14
+ void writeBranchLR (void *ptr, void *destination)
15
+ {
16
+ uint32_t branch = 0x48000001 ; // bl
17
+ writeBranchMain (ptr, destination, branch);
18
+ }
19
+
20
+ void writeBranchMain (void *ptr, void *destination, uint32_t branch)
9
21
{
10
22
uint32_t delta = reinterpret_cast <uint32_t >(destination) - reinterpret_cast <uint32_t >(ptr);
11
- uint32_t value = 0x48000000 ;
12
- value |= (delta & 0x03FFFFFC );
23
+
24
+ branch |= (delta & 0x03FFFFFC );
13
25
14
26
uint32_t *p = reinterpret_cast <uint32_t *>(ptr);
15
- *p = value ;
27
+ *p = branch ;
16
28
17
29
clear_DC_IC_Cache (ptr, sizeof (uint32_t ));
18
30
}
You can’t perform that action at this time.
0 commit comments