Skip to content

Commit c7114fe

Browse files
Fixes offset in the unused C version of the BL hooker.
1 parent 8a946d3 commit c7114fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hooks/blhook.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ int calcbl(int adr, int target){
120120
/* The BL instruction is actually two Thumb instructions, with one
121121
setting the high part of the LR and the other setting the lo part
122122
while swapping LR and PC. */
123-
int hi=0xF000 | ((offset&0xFFF800)>>11);
123+
int hi=0xF000 | ((offset&0x3FF800)>>11);
124124
int lo=0xF800 | (offset&0x7FF);
125125

126126
//Return the pair as a single 32-bit word.

0 commit comments

Comments
 (0)